Bug 508370 - KDiff3 crashes in word wrap code while refreshing
Summary: KDiff3 crashes in word wrap code while refreshing
Status: REPORTED
Alias: None
Product: kdiff3
Classification: Applications
Component: application (other bugs)
Version First Reported In: 1.12.3
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: michael
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-08-17 06:34 UTC by nyanpasu64
Modified: 2025-08-17 07:33 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nyanpasu64 2025-08-17 06:34:16 UTC
When diffing two large (>1MB) text files, I scrolled down to a line diff (Ctrl+Down), edited one file in Obsidian, saved, and reloaded in KDiff3. This appears to have broke an internal invariant in the word wrap, causing a vector indexing(?) crash.

The crash does not seem to be reproducible.

Application: kdiff3 (1.12.3 (64 bit))

ApplicationNotResponding [ANR]: false
Qt Version: 6.9.1
Frameworks Version: 6.17.0
Operating System: Linux 6.15.9-201.fc42.x86_64 x86_64
Windowing System: Wayland
Distribution: "Fedora Linux 42 (KDE Plasma Desktop Edition)"
DrKonqi: 6.4.4 [CoredumpBackend]

-- Backtrace:
Thread 1 (Thread 0x7f420d6e2dc0 (LWP 31031)):
[KCrash Handler]
#5  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#6  0x00007f4212482163 in __pthread_kill_internal (threadid=<optimized out>, signo=6) at pthread_kill.c:89
#7  0x00007f4212428a7e in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#8  0x00007f42124106d0 in __GI_abort () at abort.c:77
#9  0x00007f421260b084 in std::__glibcxx_assert_fail(char const*, int, char const*, char const*) () from /lib64/libstdc++.so.6
#10 0x000055aa39a7c461 in std::vector<Diff3WrapLine, std::allocator<Diff3WrapLine> >::operator[](unsigned long) [clone .part.0] [clone .lto_priv.0] (__n=<optimized out>, this=<optimized out>) at /usr/include/c++/15/bits/stl_vector.h:1263
#11 0x000055aa39a7b079 in std::vector<Diff3WrapLine, std::allocator<Diff3WrapLine> >::operator[] (this=<optimized out>, __n=<optimized out>) at /usr/src/debug/kdiff3-1.12.3-1.fc42.x86_64/src/difftextwindow.cpp:1430
#12 DiffTextWindow::convertD3LCoordsToLineCoords (this=0x55aa6fa517d0, d3LIdx=<optimized out>, d3LPos=50, line=..., pos=@0x7ffc9fc32d30: 0) at /usr/src/debug/kdiff3-1.12.3-1.fc42.x86_64/src/difftextwindow.cpp:1557
#13 DiffTextWindow::convertD3LCoordsToLineCoords (this=this@entry=0x55aa6fa517d0, d3LIdx=<optimized out>, d3LPos=50, line=..., pos=@0x7ffc9fc32d30: 0) at /usr/src/debug/kdiff3-1.12.3-1.fc42.x86_64/src/difftextwindow.cpp:1551
#14 0x000055aa39aef1c9 in DiffTextWindow::recalcWordWrapHelper (this=this@entry=0x55aa6fa517d0, wrapLineVectorSize=wrapLineVectorSize@entry=38720, visibleTextWidth=<optimized out>, visibleTextWidth@entry=-1, cacheListIdx=cacheListIdx@entry=0) at /usr/src/debug/kdiff3-1.12.3-1.fc42.x86_64/src/difftextwindow.cpp:1932
#15 0x000055aa39aefbdf in DiffTextWindow::recalcWordWrap (this=0x55aa6fa517d0, bWordWrap=<optimized out>, wrapLineVectorSize=38720, visibleTextWidth=-1) at /usr/src/debug/kdiff3-1.12.3-1.fc42.x86_64/src/difftextwindow.cpp:1754
#16 0x000055aa39ad7bed in KDiff3App::slotFinishRecalcWordWrap (this=0x55aa6f497680, visibleTextWidthForPrinting=-1) at /usr/src/debug/kdiff3-1.12.3-1.fc42.x86_64/src/pdiff.cpp:1352
#17 0x00007f4212b5662c in QObject::event(QEvent*) () from /lib64/libQt6Core.so.6
#18 0x00007f4213e3d97f in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQt6Widgets.so.6
#19 0x00007f4212af9f38 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt6Core.so.6
#20 0x00007f4212afdd26 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /lib64/libQt6Core.so.6
#21 0x00007f4212e1016f in postEventSourceDispatch(_GSource*, int (*)(void*), void*) () from /lib64/libQt6Core.so.6
#22 0x00007f42102eb863 in g_main_context_dispatch_unlocked.lto_priv () from /lib64/libglib-2.0.so.0
#23 0x00007f42102f47a8 in g_main_context_iterate_unlocked.isra () from /lib64/libglib-2.0.so.0
#24 0x00007f42102f4953 in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#25 0x00007f4212e0f9ad in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt6Core.so.6
#26 0x00007f4212b07b03 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt6Core.so.6
#27 0x00007f4212b03419 in QCoreApplication::exec() () from /lib64/libQt6Core.so.6
#28 0x000055aa39a8be57 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/kdiff3-1.12.3-1.fc42.x86_64/src/main.cpp:195

(I tried reporting with DrKonqi, but it failed to create a report in the "general" component because it's called "application" instead. I think this needs fixing.)