Bug 471802 - Crash after editing a plural
Summary: Crash after editing a plural
Status: RESOLVED FIXED
Alias: None
Product: lokalize
Classification: Applications
Component: general (other bugs)
Version First Reported In: 23.04.2
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: Simon Depiets
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2023-06-30 18:48 UTC by Freek de Kruijf
Modified: 2025-01-29 14:57 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Content of output1.txt (1.32 MB, text/plain)
2023-07-06 19:29 UTC, Freek de Kruijf
Details
output of valgrind --error-limit=no lokalize --project vertalingen/KF5trunk.lokalize > output.txt 2>&1 3>&1 (410.82 KB, text/plain)
2023-07-07 10:29 UTC, Freek de Kruijf
Details
output of QT_LOGGING_RULES="org.kde.lokalize=true" lokalize --project vertalingen/KF5trunk.lokalize > output.txt 2>&1 3>&1 (1.98 KB, text/plain)
2023-07-14 12:02 UTC, Freek de Kruijf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Freek de Kruijf 2023-06-30 18:48:42 UTC
Application: lokalize (23.04.2)

Qt Version: 5.15.10
Frameworks Version: 5.107.0
Operating System: Linux 6.3.9-1-default x86_64
Windowing System: X11
Distribution: "openSUSE Tumbleweed"
DrKonqi: 5.27.6 [KCrashBackend]

-- Information about the crash:
I tried to edit the file nl/messages/kdebugsettings/kdebugsettings.po in which one element needed editing. This element has a plural. Apparently the element with the plural (rules) needed to add an s to make the Dutch word (regel) a plural, which is regels.
The first time I simply entered the s and lokalize crashed, leaving the .po file unchanged. The second time, of which this the bug report, it crashed again by entering the s. However now this file has nothing to edit anymore.

The crash can be reproduced every time.

-- Backtrace:
Application: Lokalize (lokalize), signal: Segmentation fault

[KCrash Handler]
#4  QMapNodeBase::color (this=0x0) at tools/qmap.h:93
#5  QMapDataBase::freeNodeAndRebalance (this=0x55a116cdea40, z=0x55a1191196c0) at tools/qmap.cpp:234
#6  0x00007fcbc4742b9e in QMapData<QObject const*, QPointer<Breeze::WidgetStateData> >::deleteNode (z=<optimized out>, this=<optimized out>) at /usr/include/qt5/QtCore/qmap.h:281
#7  0x00007fcbc46faf1a in Breeze::BaseDataMap<QObject, Breeze::WidgetStateData>::unregisterWidget (this=0x55a115b55228, key=0x55a119110c50) at /usr/src/debug/breeze-5.27.6/build/kstyle/breeze_autogen/4NBMFDNHZT/../../../../kstyle/animations/breezedatamap.h:95
#8  0x00007fcbc4702e21 in Breeze::WidgetStateEngine::unregisterWidget (object=0x55a119110c50, this=0x55a115b551b0) at /usr/src/debug/breeze-5.27.6/build/kstyle/breeze_autogen/4NBMFDNHZT/../../../../kstyle/animations/breezewidgetstateengine.h:144
#9  Breeze::WidgetStateEngine::unregisterWidget (object=0x55a119110c50, this=0x55a115b551b0) at /usr/src/debug/breeze-5.27.6/build/kstyle/breeze_autogen/4NBMFDNHZT/../../../../kstyle/animations/breezewidgetstateengine.h:132
#10 Breeze::WidgetStateEngine::qt_static_metacall (_o=0x55a115b551b0, _a=0x7fff55cc9ce0, _id=<optimized out>, _c=<optimized out>) at /usr/src/debug/breeze-5.27.6/build/kstyle/breeze_autogen/4NBMFDNHZT/moc_breezewidgetstateengine.cpp:74
#11 0x00007fcbd4525743 in doActivate<false> (sender=0x55a119110c50, signal_index=0, argv=0x7fff55cc9ce0) at kernel/qobject.cpp:3937
#12 0x00007fcbd451e40f in QMetaObject::activate (sender=sender@entry=0x55a119110c50, m=m@entry=0x7fcbd47be840 <QObject::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7fff55cc9ce0) at kernel/qobject.cpp:3985
#13 0x00007fcbd451e4bf in QObject::destroyed (this=this@entry=0x55a119110c50, _t1=<optimized out>, _t1@entry=0x55a119110c50) at .moc/moc_qobject.cpp:219
#14 0x00007fcbd53e297b in QWidget::~QWidget (this=this@entry=0x55a119110c50, __in_chrg=<optimized out>) at kernel/qwidget.cpp:1499
#15 0x00007fcbd549553d in QAbstractScrollAreaScrollBarContainer::~QAbstractScrollAreaScrollBarContainer (this=0x55a119110c50, __in_chrg=<optimized out>) at widgets/qabstractscrollarea_p.h:128
#16 QAbstractScrollAreaScrollBarContainer::~QAbstractScrollAreaScrollBarContainer (this=0x55a119110c50, __in_chrg=<optimized out>) at widgets/qabstractscrollarea_p.h:128
#17 0x00007fcbd4516e4e in QObjectPrivate::deleteChildren (this=this@entry=0x7fcb8c0bf0a0) at kernel/qobject.cpp:2137
#18 0x00007fcbd53e26a6 in QWidget::~QWidget (this=0x55a11910f670, __in_chrg=<optimized out>) at kernel/qwidget.cpp:1524
#19 0x00007fcbd5542de9 in QScrollArea::~QScrollArea (this=0x55a11910f670, __in_chrg=<optimized out>) at widgets/qscrollarea.cpp:173
#20 0x00007fcbd4516e4e in QObjectPrivate::deleteChildren (this=this@entry=0x55a11910d920) at kernel/qobject.cpp:2137
#21 0x00007fcbd53e26a6 in QWidget::~QWidget (this=this@entry=0x55a119109c70, __in_chrg=<optimized out>) at kernel/qwidget.cpp:1524
#22 0x00007fcbd54c44ed in QDockWidget::~QDockWidget (this=this@entry=0x55a119109c70, __in_chrg=<optimized out>) at widgets/qdockwidget.cpp:1314
#23 0x000055a11536f41c in GlossaryNS::GlossaryView::~GlossaryView (this=<optimized out>, this=<optimized out>) at /usr/src/debug/lokalize-23.04.2/src/glossary/glossaryview.cpp:71
#24 GlossaryNS::GlossaryView::~GlossaryView (this=<optimized out>, this=<optimized out>) at /usr/src/debug/lokalize-23.04.2/src/glossary/glossaryview.cpp:71
#25 0x00007fcbd4516e4e in QObjectPrivate::deleteChildren (this=this@entry=0x55a11861c6a0) at kernel/qobject.cpp:2137
#26 0x00007fcbd53e26a6 in QWidget::~QWidget (this=0x55a118127bc0, __in_chrg=<optimized out>) at kernel/qwidget.cpp:1524
#27 0x000055a115347ec9 in EditorTab::~EditorTab (this=<optimized out>, this=<optimized out>) at /usr/src/debug/lokalize-23.04.2/src/editortab.cpp:139
#28 0x00007fcbd4519077 in QObject::event (this=0x55a118127bc0, e=0x55a117cc5ef0) at kernel/qobject.cpp:1334
#29 0x00007fcbd53a519e in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x55a118127bc0, e=0x55a117cc5ef0) at kernel/qapplication.cpp:3640
#30 0x00007fcbd44ed4f8 in QCoreApplication::notifyInternal2 (receiver=0x55a118127bc0, event=0x55a117cc5ef0) at kernel/qcoreapplication.cpp:1064
#31 0x00007fcbd44ed6be in QCoreApplication::sendEvent (receiver=<optimized out>, event=<optimized out>) at kernel/qcoreapplication.cpp:1462
#32 0x00007fcbd44f0af1 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x55a115973f50) at kernel/qcoreapplication.cpp:1821
#33 0x00007fcbd44f1038 in QCoreApplication::sendPostedEvents (receiver=<optimized out>, event_type=<optimized out>) at kernel/qcoreapplication.cpp:1680
#34 0x00007fcbd4546c83 in postEventSourceDispatch (s=0x55a115a67bf0) at kernel/qeventdispatcher_glib.cpp:277
#35 0x00007fcbd27168d8 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#36 0x00007fcbd2716ce8 in ?? () from /lib64/libglib-2.0.so.0
#37 0x00007fcbd2716d7c in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#38 0x00007fcbd4546496 in QEventDispatcherGlib::processEvents (this=0x55a115a77420, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#39 0x00007fcbd44ebf8b in QEventLoop::exec (this=this@entry=0x7fff55cca340, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#40 0x00007fcbd44f4420 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#41 0x000055a11531d982 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/lokalize-23.04.2/src/main.cpp:126
[Inferior 1 (process 24698) detached]

Reported using DrKonqi
Comment 1 Albert Astals Cid 2023-07-03 19:41:51 UTC
I can't reproduce the crash at all :/

Can you run lokalize via valgrind?

in a terminal

lokalize valgrind

And then do the same that makes it crash and attach the output of lokalize even if it doesn't crash (be patient, valgrind makes everything slower)
Comment 2 Freek de Kruijf 2023-07-06 07:59:14 UTC
(In reply to Albert Astals Cid from comment #1)
> I can't reproduce the crash at all :/
> 
> Can you run lokalize via valgrind?
> 
> in a terminal
> 
> lokalize valgrind
> 
> And then do the same that makes it crash and attach the output of lokalize
> even if it doesn't crash (be patient, valgrind makes everything slower)

Below is the output

k@eiktum:~> lokalize  --project vertalingen/KF5trunk.lokalize valgrind
org.kde.lokalize: db "default140584906626752" opened 2 "nl"
org.kde.lokalize: db "kde4-nl140584906626752" opened 10 "nl"
QStatusBar::insertWidget: Index out of range (5), appending widget
org.kde.lokalize: db "GNU140584906626752" opened 0 "nl"
org.kde.lokalize: db "en_US-en140584906626752" opened 0 "en"
org.kde.lokalize: "/reserv/k/vertalingen/messages/tokodon/tokodon.po" has different number of entries
org.kde.lokalize: indexed "/home/freek/vertalingen/svn/trunkkf5/nl/messages/tokodon/tokodon.po" for word completion in 0 msecs
KCrash: Application 'lokalize' crashing...
KCrash: Attempting to start /usr/libexec/drkonqi

[1]+  Gepauzeerd              lokalize --project vertalingen/KF5trunk.lokalize valgrind
k@eiktum:~> Unable to find file for pid 5459 expected at "kcrash-metadata/5459.ini"
QSocketNotifier: Invalid socket 5 and type 'Read', disabling...
Unable to start Dr. Konqi
Re-raising signal for core dump handling.

[1]+  Segmentatiefout         (geheugendump gemaakt) lokalize --project vertalingen/KF5trunk.lokalize valgrind
k@eiktum:~>
Comment 3 Albert Astals Cid 2023-07-06 08:50:41 UTC
sorry i wrote it the other way around

valgrind lokalize

and attach the output of that
Comment 4 Freek de Kruijf 2023-07-06 19:00:55 UTC
(In reply to Albert Astals Cid from comment #3)
> sorry i wrote it the other way around
> 
> valgrind lokalize
> 
> and attach the output of that

There was quite a lot before the data below, but only at the beginning, which was not saved, it was different from what seems to be repeated many many times. If needed I can try to repeat and store the output using " > output.txt 2>&1 3>&1" after the command.

==4308== Conditional jump or move depends on uninitialised value(s)
==4308==    at 0x1DC8B3BB: ???
==4308==    by 0x1E7A6577: ???
==4308== 
==4308== Conditional jump or move depends on uninitialised value(s)
==4308==    at 0x1DC8ECBB: ???
==4308==    by 0x23500BD7: ???
==4308== 
==4308== Conditional jump or move depends on uninitialised value(s)
==4308==    at 0x1DC8DF63: ???
==4308==    by 0x23500BD7: ???
==4308== 
==4308== Conditional jump or move depends on uninitialised value(s)
==4308==    at 0x1DC8D163: ???
==4308==    by 0x23500BD7: ???
==4308== 
==4308== Conditional jump or move depends on uninitialised value(s)
==4308==    at 0x1DC8C343: ???
==4308==    by 0x23500BD7: ???
==4308== 
==4308== Conditional jump or move depends on uninitialised value(s)
==4308==    at 0x1DC8B3BB: ???
==4308==    by 0x23500BD7: ???
==4308== 
==4308== Conditional jump or move depends on uninitialised value(s)
==4308==    at 0x1DC8DF63: ???
==4308==    by 0x1E6EC3B7: ???
==4308== 
==4308== Conditional jump or move depends on uninitialised value(s)
==4308==    at 0x1DC8D163: ???
==4308==    by 0x1E6EC3B7: ???
==4308== 
==4308== Conditional jump or move depends on uninitialised value(s)
==4308==    at 0x1DC8C343: ???
==4308==    by 0x1E6EC3B7: ???
==4308== 
==4308== Conditional jump or move depends on uninitialised value(s)
==4308==    at 0x1DC8B3BB: ???
==4308==    by 0x1E6EC3B7: ???
==4308== 
==4308== Conditional jump or move depends on uninitialised value(s)
==4308==    at 0x1DC8DF63: ???
==4308==    by 0xD5CE577: ???
==4308== 
==4308== 
==4308== More than 1000 different errors detected.  I'm not reporting any more.
==4308== Final error counts will be inaccurate.  Go fix your program!
==4308== Rerun with --error-limit=no to disable this cutoff.  Note
==4308== that errors may occur in your program without prior warning from
==4308== Valgrind, because errors are no longer being displayed.
==4308== 
org.kde.lokalize: db "en_US-en453916352" opened 7 "en"
org.kde.lokalize: db "GNU453916352" opened 6 "nl"
org.kde.lokalize: db "standaard453916352" opened 5 "nl_NL"
org.kde.lokalize: "/reserv/k/vertalingen/messages/tokodon/tokodon.po" has different number of entries
org.kde.lokalize: indexed "/home/k/vertalingen/svn/trunkkf5/nl/messages/tokodon/tokodon.po" for word completion in 36 msecs
org.kde.lokalize: db "kde4-nl453916352" opened 0 "nl"
KCrash: Application 'lokalize' crashing...
KCrash: Attempting to start /usr/libexec/drkonqi

[1]+  Gepauzeerd              valgrind lokalize --project vertalingen/KF5trunk.lokalize
Unable to find file for pid 4308 expected at "kcrash-metadata/4308.ini"
QSocketNotifier: Invalid socket 5 and type 'Read', disabling...
Unable to start Dr. Konqi
Re-raising signal for core dump handling.
==4308== 
==4308== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==4308==    at 0x6D64A7C: __pthread_kill_implementation (in /usr/lib64/libc.so.6)
==4308==    by 0x6D13225: raise (in /usr/lib64/libc.so.6)
==4308==    by 0x5AEAD39: KCrash::defaultCrashHandler(int) (in /usr/lib64/libKF5Crash.so.5.107.0)
==4308==    by 0x6D132EF: ??? (in /usr/lib64/libc.so.6)
==4308==    by 0x491043FFF: ???
==4308==    by 0x660D458: QMetaObject::cast(QObject const*) const (qmetaobject.cpp:389)
==4308==    by 0x6635E1C: qt_qFindChildren_helper(QObject const*, QString const&, QMetaObject const&, QList<void*>*, QFlags<Qt::FindChildOption>) (qobject.cpp:2034)
==4308==    by 0x5067365: ??? (in /usr/lib64/libKF5WidgetsAddons.so.5.107.0)
==4308==    by 0x5066FBC: ??? (in /usr/lib64/libKF5WidgetsAddons.so.5.107.0)
==4308==    by 0x5067429: ??? (in /usr/lib64/libKF5WidgetsAddons.so.5.107.0)
==4308==    by 0x5066FBC: ??? (in /usr/lib64/libKF5WidgetsAddons.so.5.107.0)
==4308==    by 0x5067429: ??? (in /usr/lib64/libKF5WidgetsAddons.so.5.107.0)
==4308== 
==4308== HEAP SUMMARY:
==4308==     in use at exit: 55,241,533 bytes in 809,531 blocks
==4308==   total heap usage: 25,255,525 allocs, 24,445,994 frees, 6,770,480,430 bytes allocated
==4308== 
==4308== LEAK SUMMARY:
==4308==    definitely lost: 4,864 bytes in 19 blocks
==4308==    indirectly lost: 1,053 bytes in 38 blocks
==4308==      possibly lost: 2,201,786 bytes in 1,761 blocks
==4308==    still reachable: 53,033,734 bytes in 807,710 blocks
==4308==                       of which reachable via heuristic:
==4308==                         newarray           : 6,288 bytes in 52 blocks
==4308==                         multipleinheritance: 332,656 bytes in 409 blocks
==4308==         suppressed: 96 bytes in 3 blocks
==4308== Rerun with --leak-check=full to see details of leaked memory
==4308== 
==4308== Use --track-origins=yes to see where uninitialised values come from
==4308== For lists of detected and suppressed errors, rerun with: -s
==4308== ERROR SUMMARY: 1002 errors from 1000 contexts (suppressed: 0 from 0)

[1]+  Segmentatiefout         (geheugendump gemaakt) valgrind lokalize --project vertalingen/KF5trunk.lokalize
k@eiktum:~>
Comment 5 Freek de Kruijf 2023-07-06 19:27:37 UTC
(In reply to Albert Astals Cid from comment #3)
> sorry i wrote it the other way around
> 
> valgrind lokalize
> 
> and attach the output of that

Did the following command:
valgrind --leak-check=full lokalize  --project vertalingen/KF5trunk.lokalize > output1.txt 2>&1 3>&1

See attached file output1.txt
Comment 6 Freek de Kruijf 2023-07-06 19:29:24 UTC
Created attachment 160106 [details]
Content of output1.txt
Comment 7 Albert Astals Cid 2023-07-06 21:26:53 UTC
ha, valgrind got tired of reporting before you made it crash, please add --error-limit=no to the command line, you can also remove --leak-check=full, leaks are not something we're particularly interested for now.
Comment 8 Freek de Kruijf 2023-07-07 10:28:00 UTC
(In reply to Albert Astals Cid from comment #7)
> ha, valgrind got tired of reporting before you made it crash, please add
> --error-limit=no to the command line, you can also remove --leak-check=full,
> leaks are not something we're particularly interested for now.

See attachment.
Comment 9 Freek de Kruijf 2023-07-07 10:29:11 UTC
Created attachment 160119 [details]
output of valgrind --error-limit=no lokalize  --project vertalingen/KF5trunk.lokalize > output.txt 2>&1 3>&1
Comment 10 Albert Astals Cid 2023-07-12 22:22:22 UTC
That does indeed contain some interesting information

==10340== Invalid read of size 8
==10340==    at 0x649CF2C: UnknownInlinedFun (qbasicatomic.h:118)
==10340==    by 0x649CF2C: UnknownInlinedFun (qrefcount.h:61)
==10340==    by 0x649CF2C: QString::operator=(QString const&) (qstring.cpp:2403)
==10340==    by 0x1C0CE1: MergeCatalog::copyFromBaseCatalog(DocPosition const&, int) (mergecatalog.cpp:53)
==10340==    by 0x663C7A1: UnknownInlinedFun (qobjectdefs_impl.h:398)
==10340==    by 0x663C7A1: void doActivate<false>(QObject*, int, void**) (qobject.cpp:3925)
==10340==    by 0x221507: UnknownInlinedFun (moc_catalog.cpp:714)
==10340==    by 0x221507: Catalog::targetInsert(DocPosition const&, QString const&) (catalog.cpp:838)
==10340==    by 0x217F12: LokalizeUnitCmd::redo() (cmd.cpp:41)
==10340==    by 0x217F9C: LokalizeTargetCmd::redo() (cmd.cpp:68)
==10340==    by 0x5881074: QUndoStack::push(QUndoCommand*) (qundostack.cpp:639)
==10340==    by 0x1A1018: TranslationUnitTextEdit::contentsChanged(int, int, int) (xlifftextedit.cpp:493)
==10340==    by 0x663C7A1: UnknownInlinedFun (qobjectdefs_impl.h:398)
==10340==    by 0x663C7A1: void doActivate<false>(QObject*, int, void**) (qobject.cpp:3925)
==10340==    by 0x5D8D052: QTextDocument::contentsChange(int, int, int) (in /usr/lib64/libQt5Gui.so.5.15.10)
==10340==    by 0x5DA483A: QTextDocumentPrivate::finishEdit() (in /usr/lib64/libQt5Gui.so.5.15.10)
==10340==    by 0x5DDBFF7: QTextCursor::insertText(QString const&, QTextCharFormat const&) (in /usr/lib64/libQt5Gui.so.5.15.10)
==10340==  Address 0x1ea10ce0 is 0 bytes after a block of size 32 alloc'd
==10340==    at 0x4843794: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==10340==    by 0x6425C21: QArrayData::allocate(unsigned long, unsigned long, unsigned long, QFlags<QArrayData::AllocationOption>) (qarraydata.cpp:218)
==10340==    by 0x16DED5: UnknownInlinedFun (qarraydata.h:225)
==10340==    by 0x16DED5: QVector<QString>::realloc(int, QFlags<QArrayData::AllocationOption>) (qvector.h:699)
==10340==    by 0x2296F0: UnknownInlinedFun (qvector.h:414)
==10340==    by 0x2296F0: UnknownInlinedFun (qcontainertools_impl.h:83)
==10340==    by 0x2296F0: UnknownInlinedFun (qvector.h:571)
==10340==    by 0x2296F0: QList<QString>::toVector() const (qlist.h:1132)
==10340==    by 0x22EE48: UnknownInlinedFun (catalogitem.cpp:118)
==10340==    by 0x22EE48: GettextCatalog::GettextImportPlugin::load(QIODevice*) (gettextimport.cpp:157)
==10340==    by 0x228126: UnknownInlinedFun (importplugin.cpp:85)
==10340==    by 0x228126: GettextCatalog::GettextStorage::load(QIODevice*) (gettextstorage.cpp:56)
==10340==    by 0x21F645: Catalog::loadFromUrl(QString const&, QString const&, int*, bool) (catalog.cpp:563)
==10340==    by 0x1C4F00: MergeCatalog::loadFromUrl(QString const&, QString const&) (mergecatalog.cpp:154)
==10340==    by 0x1CCE06: MergeView::mergeOpen(QString) (mergeview.cpp:214)
==10340==    by 0x19992E: UnknownInlinedFun (qobjectdefs_impl.h:152)
==10340==    by 0x19992E: UnknownInlinedFun (qobjectdefs_impl.h:185)
==10340==    by 0x19992E: QtPrivate::QSlotObject<void (MergeView::*)(QString), QtPrivate::List<QString const&>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (qobjectdefs_impl.h:418)
==10340==    by 0x66302AF: QObject::event(QEvent*) (qobject.cpp:1347)
==10340==    by 0x54E119D: QApplicationPrivate::notify_helper(QObject*, QEvent*) (qapplication.cpp:3640)
==10340== 
==10340== Invalid read of size 4
==10340==    at 0x649CEEC: UnknownInlinedFun (atomic_base.h:505)
==10340==    by 0x649CEEC: UnknownInlinedFun (qatomic_cxx11.h:239)
==10340==    by 0x649CEEC: UnknownInlinedFun (qbasicatomic.h:107)
==10340==    by 0x649CEEC: UnknownInlinedFun (qrefcount.h:66)
==10340==    by 0x649CEEC: QString::operator=(QString const&) (qstring.cpp:2404)
==10340==    by 0x1C0CE1: MergeCatalog::copyFromBaseCatalog(DocPosition const&, int) (mergecatalog.cpp:53)
==10340==    by 0x663C7A1: UnknownInlinedFun (qobjectdefs_impl.h:398)
==10340==    by 0x663C7A1: void doActivate<false>(QObject*, int, void**) (qobject.cpp:3925)
==10340==    by 0x221507: UnknownInlinedFun (moc_catalog.cpp:714)
==10340==    by 0x221507: Catalog::targetInsert(DocPosition const&, QString const&) (catalog.cpp:838)
==10340==    by 0x217F12: LokalizeUnitCmd::redo() (cmd.cpp:41)
==10340==    by 0x217F9C: LokalizeTargetCmd::redo() (cmd.cpp:68)
==10340==    by 0x5881074: QUndoStack::push(QUndoCommand*) (qundostack.cpp:639)
==10340==    by 0x1A1018: TranslationUnitTextEdit::contentsChanged(int, int, int) (xlifftextedit.cpp:493)
==10340==    by 0x663C7A1: UnknownInlinedFun (qobjectdefs_impl.h:398)
==10340==    by 0x663C7A1: void doActivate<false>(QObject*, int, void**) (qobject.cpp:3925)
==10340==    by 0x5D8D052: QTextDocument::contentsChange(int, int, int) (in /usr/lib64/libQt5Gui.so.5.15.10)
==10340==    by 0x5DA483A: QTextDocumentPrivate::finishEdit() (in /usr/lib64/libQt5Gui.so.5.15.10)
==10340==    by 0x5DDBFF7: QTextCursor::insertText(QString const&, QTextCharFormat const&) (in /usr/lib64/libQt5Gui.so.5.15.10)
==10340==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
Comment 11 Albert Astals Cid 2023-07-12 22:23:56 UTC
Johnny, Frederik, would you be able to see if you can reproduce this crash or fix it from the valgrind trace?
Comment 12 Frederik Schwarzer 2023-07-13 22:14:37 UTC
I cannot reproduce this with either master or v23.04.2 with the same versions of Qt and KF and kernel 6.3.11.

After a quick tired glance at the valgrind output, I am wondering:
- Why is xlifftextedit.cpp used when doing PO file stuff?
- Is "Address 0x0 is not stack'd, malloc'd or (recently) free'd" a null pointer deref? At address 0x0?

Will take a closer look the next few days if noone else steps up.
Comment 13 Jazeix Johnny 2023-07-14 09:30:27 UTC
(In reply to Freek de Kruijf from comment #9)
> Created attachment 160119 [details]
> output of valgrind --error-limit=no lokalize  --project
> vertalingen/KF5trunk.lokalize > output.txt 2>&1 3>&1

Can you please also give the output of: QT_LOGGING_RULES="org.kde.lokalize=true" lokalize?
Maybe there are info that could help here too
Comment 14 Freek de Kruijf 2023-07-14 12:00:46 UTC
(In reply to Jazeix Johnny from comment #13)
> (In reply to Freek de Kruijf from comment #9)
> > Created attachment 160119 [details]
> > output of valgrind --error-limit=no lokalize  --project
> > vertalingen/KF5trunk.lokalize > output.txt 2>&1 3>&1
> 
> Can you please also give the output of:
> QT_LOGGING_RULES="org.kde.lokalize=true" lokalize?
> Maybe there are info that could help here too

See attachment. The element with the plural I tried to fix is 373.
Should do a new scan on this file for the translation memory? Is this out of sync?
Comment 15 Freek de Kruijf 2023-07-14 12:02:52 UTC
Created attachment 160279 [details]
output of QT_LOGGING_RULES="org.kde.lokalize=true" lokalize --project vertalingen/KF5trunk.lokalize > output.txt 2>&1 3>&1
Comment 16 Albert Astals Cid 2023-07-15 09:29:51 UTC
(In reply to Frederik Schwarzer from comment #12)
> I cannot reproduce this with either master or v23.04.2 with the same
> versions of Qt and KF and kernel 6.3.11.
> 
> After a quick tired glance at the valgrind output, I am wondering:
> - Why is xlifftextedit.cpp used when doing PO file stuff?

the name of the file is "wrong", it's holding the TranslationUnitTextEdit class that is used for editing all the file formats as I understand

> - Is "Address 0x0 is not stack'd, malloc'd or (recently) free'd" a null
> pointer deref? At address 0x0?

Yes, that usually means a null pointer access.

> 
> Will take a closer look the next few days if noone else steps up.
Comment 17 Jazeix Johnny 2023-07-15 15:10:06 UTC
I can't reproduce it either :/. When saving on my side, I have "QFile::remove: Empty or null file name" (I can't find from which part of the code it comes too)

In the logs, what could be a hint (or a total coincidence) is: "org.kde.lokalize: ignoring "/reserv/freek/vertalingen/messages/tokodon/tokodon.po" this time because 372 < 253" and the element with the plural you tried to fix is 373 (so maybe accessing an index in a vector that does not exist)...
Comment 18 Freek de Kruijf 2023-07-18 13:26:55 UTC
File ..../trunkkf5/nl/messages/tokodon/tokodon.po is no longer in trunk KF5. Reappeared in trunk KF6 in which the problem did not occur anymore.
Comment 19 Frederik Schwarzer 2023-07-20 21:59:01 UTC
If you download the old file and open it in Lokalize, can you reproduce this with it??
Comment 20 Freek de Kruijf 2023-07-21 20:23:17 UTC
(In reply to Frederik Schwarzer from comment #19)
> If you download the old file and open it in Lokalize, can you reproduce this
> with it??

With "svn merge" I could retrieve the problematic file and could translate it without any problem.
Comment 21 Paul Floyd 2025-01-29 14:57:52 UTC
(In reply to Albert Astals Cid from comment #7)
> ha, valgrind got tired of reporting before you made it crash, please add
> --error-limit=no to the command line, you can also remove --leak-check=full,
> leaks are not something we're particularly interested for now.

Try setting the environment variable QT_ENABLE_REGEXP_JIT to 0. That should solve the problem, assuming that you are using QRegExp based on pcre2.