Bug 490234

Summary: Crash in TM::targetAdapted when selecting translation memory suggestion
Product: [Applications] lokalize Reporter: Jure Repinc <jlp>
Component: translation memoryAssignee: Simon Depiets <sdepiets>
Status: RESOLVED FIXED    
Severity: crash CC: aacid, shafff, vkrause
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: All threads backtrace

Description Jure Repinc 2024-07-13 16:29:02 UTC
SUMMARY
This is for version from master which has been ported to Qt6. When your are translating you have an option to select and entry from "Translation Memory" suggestions view panel, using Ctrl+1 fir first suggestion, Ctrl+2 for second and so on. This selection from TM is used to fill out a translated string. When you select it Lokalize crashes

STEPS TO REPRODUCE
1. Have something in translation memory that can be chosen for new translation
2. When translation a file press Ctrl+1 to fill out translation with the suggestion from TM

OBSERVED RESULT
Lokalize crashes in TM::targetAdapted with the following backtrace (all threads BT is be attached)

EXPECTED RESULT
Suggestion from translation memory should be filled out in translated string without crashing.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20240711
KDE Plasma Version: 6.1.80
KDE Frameworks Version: 6.5.0
Qt Version: 6.7.2
Kernel Version: 6.9.7-1-default (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 7600 6-Core Processor
Memory: 31.1 GiB of RAM
Graphics Processor: AMD Radeon RX 7900 GRE
Comment 1 Jure Repinc 2024-07-13 16:31:19 UTC
Thread 1 (Thread 0x7ffff15e7b00 (LWP 455035) "lokalize"):
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007ffff4e94a63 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
#2  0x00007ffff4e41176 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007ffff4e28917 in __GI_abort () at abort.c:79
#4  0x00007ffff56e073d in qAbort () at /usr/src/debug/qtbase-everywhere-src-6.7.2/src/corelib/global/qglobal.cpp:161
#5  0x00007ffff5730bfe in qt_message_fatal<QString&> (message=..., context=<optimized out>) at /usr/src/debug/qtbase-everywhere-src-6.7.2/src/corelib/global/qlogging.cpp:2025
#6  qt_message(QtMsgType, const QMessageLogContext &, const char *, typedef __va_list_tag __va_list_tag *) (msgType=msgType@entry=QtFatalMsg, context=<optimized out>, msg=<optimized out>, ap=ap@entry=0x7fffffffae80) at /usr/src/debug/qtbase-everywhere-src-6.7.2/src/corelib/global/qlogging.cpp:374
#7  0x00007ffff56e1df3 in QMessageLogger::fatal (this=<optimized out>, msg=<optimized out>) at /usr/src/debug/qtbase-everywhere-src-6.7.2/src/corelib/global/qlogging.cpp:889
#8  0x00007ffff56e0e14 in qt_assert_x (where=<optimized out>, what=<optimized out>, file=<optimized out>, line=<optimized out>) at /usr/src/debug/qtbase-everywhere-src-6.7.2/src/corelib/global/qassert.cpp:77
#9  0x0000000000454d91 in QList<int>::at (this=0x7fffffffb258, i=186) at /usr/include/qt6/QtCore/qlist.h:434
#10 0x00000000005730b1 in TM::targetAdapted (entry=..., ref=...) at /home/jlp/Programiranje/lokalize/src/tm/tmview.cpp:931
#11 0x0000000000573a66 in TM::TMView::slotUseSuggestion (this=0x3907c60, i=0) at /home/jlp/Programiranje/lokalize/src/tm/tmview.cpp:1012
#12 0x000000000056cf90 in operator() (__closure=0x4d0f730) at /home/jlp/Programiranje/lokalize/src/tm/tmview.cpp:154
#13 0x0000000000574bcb in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, TM::TMView::initLater()::<lambda()> >::call(struct {...} &, void **) (f=..., arg=0x7fffffffc0f0) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:137
#14 0x0000000000574b19 in QtPrivate::FunctorCallable<TM::TMView::initLater()::<lambda()> >::call<QtPrivate::List<>, void>(struct {...} &, void *, void **) (f=..., arg=0x7fffffffc0f0) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:345
#15 0x0000000000574a3b in QtPrivate::QCallableObject<TM::TMView::initLater()::<lambda()>, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=1, this_=0x4d0f720, r=0x3907c60, a=0x7fffffffc0f0, ret=0x0) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:555
#16 0x00007ffff57e7f90 in QtPrivate::QSlotObjectBase::call (a=0x7fffffffc0f0, r=0x3907c60, this=0x4d0f720) at /usr/src/debug/qtbase-everywhere-src-6.7.2/src/corelib/kernel/qobjectdefs_impl.h:469
#17 doActivate<false> (sender=0x39096f0, signal_index=7, argv=0x7fffffffc0f0) at /usr/src/debug/qtbase-everywhere-src-6.7.2/src/corelib/kernel/qobject.cpp:4086
#18 0x00007ffff65374f2 in QAction::triggered (this=this@entry=0x39096f0, _t1=<optimized out>) at /usr/src/debug/qtbase-everywhere-src-6.7.2/build/src/gui/Gui_autogen/include/moc_qaction.cpp:480
#19 0x00007ffff653a0e4 in QAction::activate (this=0x39096f0, event=<optimized out>) at /usr/src/debug/qtbase-everywhere-src-6.7.2/src/gui/kernel/qaction.cpp:1102
#20 0x00007ffff653a4f0 in QAction::event (e=0x7fffffffc330, this=0x39096f0) at /usr/src/debug/qtbase-everywhere-src-6.7.2/src/gui/kernel/qaction.cpp:1044
#21 QAction::event (this=0x39096f0, e=0x7fffffffc330) at /usr/src/debug/qtbase-everywhere-src-6.7.2/src/gui/kernel/qaction.cpp:1027
#22 0x00007ffff6bc2f6e in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x39096f0, e=0x7fffffffc330) at /usr/src/debug/qtbase-everywhere-src-6.7.2/src/widgets/kernel/qapplication.cpp:3287
#23 0x00007ffff578ec30 in QCoreApplication::notifyInternal2 (receiver=0x39096f0, event=0x7fffffffc330) at /usr/src/debug/qtbase-everywhere-src-6.7.2/src/corelib/kernel/qcoreapplication.cpp:1142
#24 0x00007ffff578ec69 in QCoreApplication::sendEvent (receiver=<optimized out>, event=<optimized out>) at /usr/src/debug/qtbase-everywhere-src-6.7.2/src/corelib/kernel/qcoreapplication.cpp:1583
#25 0x00007ffff65487a4 in QShortcutMap::dispatchEvent (this=<optimized out>, e=0x7fffffffc420) at /usr/src/debug/qtbase-everywhere-src-6.7.2/src/gui/kernel/qshortcutmap.cpp:606
#26 0x00007ffff6548f07 in QShortcutMap::tryShortcut (this=0x754598, e=0x7fffffffc420) at /usr/src/debug/qtbase-everywhere-src-6.7.2/src/gui/kernel/qshortcutmap.cpp:310
#27 0x00007ffff6244bde in QWindowSystemInterface::handleShortcutEvent (window=<optimized out>, timestamp=<optimized out>, keyCode=49, modifiers=..., nativeScanCode=10, nativeVirtualKey=49, nativeModifiers=20, text=..., autorepeat=false, count=1) at /usr/src/debug/qtbase-everywhere-src-6.7.2/src/gui/kernel/qwindowsysteminterface.cpp:449
#28 0x00007ffff61e9722 in QGuiApplicationPrivate::processKeyEvent (e=0x597c850) at /usr/src/debug/qtbase-everywhere-src-6.7.2/src/gui/kernel/qguiapplication.cpp:2434
#29 0x00007ffff624983c in QWindowSystemInterface::sendWindowSystemEvents (flags=flags@entry=...) at /usr/src/debug/qtbase-everywhere-src-6.7.2/src/gui/kernel/qwindowsysteminterface.cpp:1114
#30 0x00007ffff151405a in xcbSourceDispatch (source=<optimized out>) at /usr/src/debug/qtbase-everywhere-src-6.7.2/src/plugins/platforms/xcb/qxcbeventdispatcher.cpp:57
#31 0x00007ffff4512760 in g_main_dispatch (context=0x7fffec000f00) at ../glib/gmain.c:3344
#32 g_main_context_dispatch_unlocked (context=context@entry=0x7fffec000f00) at ../glib/gmain.c:4152
#33 0x00007ffff45143a8 in g_main_context_iterate_unlocked (context=context@entry=0x7fffec000f00, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4217
#34 0x00007ffff4514a5c in g_main_context_iteration (context=0x7fffec000f00, may_block=1) at ../glib/gmain.c:4282
#35 0x00007ffff59c1adc in QEventDispatcherGlib::processEvents (this=0x811c10, flags=...) at /usr/src/debug/qtbase-everywhere-src-6.7.2/src/corelib/kernel/qeventdispatcher_glib.cpp:394
#36 0x00007ffff57993db in QEventLoop::exec (this=0x7fffffffc7c0, flags=...) at /usr/src/debug/qtbase-everywhere-src-6.7.2/src/corelib/global/qflags.h:34
#37 0x00007ffff5792bb6 in QCoreApplication::exec () at /usr/src/debug/qtbase-everywhere-src-6.7.2/src/corelib/global/qflags.h:74
#38 0x00000000004430b8 in main (argc=1, argv=0x7fffffffd8b8) at /home/jlp/Programiranje/lokalize/src/main.cpp:133
Comment 2 Jure Repinc 2024-07-13 16:33:04 UTC
Created attachment 171638 [details]
All threads backtrace
Comment 3 Bug Janitor Service 2024-07-13 17:34:43 UTC
A possibly relevant merge request was started @ https://invent.kde.org/sdk/lokalize/-/merge_requests/130
Comment 4 Volker Krause 2024-07-14 06:47:46 UTC
Git commit cda2ac1d00056ddc617566ec732673b93c3258d4 by Volker Krause.
Committed on 14/07/2024 at 06:44.
Pushed by vkrause into branch 'master'.

Fix porting regression in translation memory

M  +1    -0    src/tm/tmview.cpp

https://invent.kde.org/sdk/lokalize/-/commit/cda2ac1d00056ddc617566ec732673b93c3258d4