Bug 507065 - kdiff3 empty window on startup when used as git mergetool
Summary: kdiff3 empty window on startup when used as git mergetool
Status: RESOLVED DUPLICATE of bug 499772
Alias: None
Product: kdiff3
Classification: Applications
Component: application (other bugs)
Version First Reported In: 1.12.3
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: michael
URL:
Keywords:
Depends on: 499772
Blocks:
  Show dependency treegraph
 
Reported: 2025-07-15 10:44 UTC by Bruno Pitrus
Modified: 2025-08-05 16:33 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bruno Pitrus 2025-07-15 10:44:09 UTC
SUMMARY
kdiff3 empty window on startup when used as git mergetool about 95% of the time. Occasionally starts successfully.

STEPS TO REPRODUCE
1. Procure a large conflict
2. Set kdiff3 as git mergetool
3. Try to use it

OBSERVED RESULT
The three upper textareas are black and artifact when the kdiff3 window gets resized, the lower textarea is the background color. All menus and toolbars are greyed out. Kdiff3 can still be closed and asks if you want to save.

EXPECTED RESULT
kdiff3 can be used normally

SOFTWARE/OS VERSIONS
kdiff3 version: 
KDE Plasma Version: 6.4.2
KDE Frameworks Version: 6.16.0
Qt Version: 6.9.1
openSUSE Tumbleweed 20250711

ADDITIONAL INFORMATION
Thread 5 (Thread 0x7fb4467976c0 (LWP 22096) "QDBusConnection"):
#0  __syscall_cancel_arch () at ../sysdeps/unix/sysv/linux/x86_64/syscall_cancel.S:56
#1  0x00007fb4498969e8 in __internal_syscall_cancel (a1=<optimized out>, a2=<optimized out>, a3=<optimized out>, a4=<optimized out>, a5=a5@entry=8, a6=a6@entry=0, nr=271) at cancellation.c:49
#2  0x00007fb449896a41 in __syscall_cancel (a1=<optimized out>, a2=<optimized out>, a3=<optimized out>, a4=<optimized out>, a5=a5@entry=8, a6=a6@entry=0, nr=271) at cancellation.c:75
#3  0x00007fb449911522 in __GI_ppoll (fds=fds@entry=0x56423d6efe20, nfds=nfds@entry=3, timeout=<optimized out>, timeout@entry=0x0, sigmask=sigmask@entry=0x0) at ../sysdeps/unix/sysv/linux/ppoll.c:42
#4  0x00007fb44951addf in ppoll (__fds=0x56423d6efe20, __nfds=3, __timeout=0x0, __ss=0x0) at /usr/include/bits/poll2.h:101
#5  g_main_context_poll_unlocked (priority=<optimized out>, context=0x7fb440000c80, timeout_usec=<optimized out>, fds=0x56423d6efe20, n_fds=3) at ../glib/gmain.c:4632
#6  g_main_context_iterate_unlocked (context=context@entry=0x7fb440000c80, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4309
#7  0x00007fb44951b52c in g_main_context_iteration (context=0x7fb440000c80, may_block=1) at ../glib/gmain.c:4379
#8  0x00007fb44a41de83 in QEventDispatcherGlib::processEvents (this=0x7fb440000b70, flags=...) at /usr/src/debug/qtbase-everywhere-src-6.9.1/src/corelib/kernel/qeventdispatcher_glib.cpp:399
#9  0x00007fb44a1c3afb in QEventLoop::exec (this=0x7fb446796a00, flags=...) at /usr/src/debug/qtbase-everywhere-src-6.9.1/src/corelib/global/qflags.h:77
#10 0x00007fb44a2b771c in QThread::exec (this=this@entry=0x7fb449ffeb20 <QGlobalStatic<QtGlobalStatic::Holder<(anonymous namespace)::Q_QGS__q_manager> >::instance()::holder>) at /usr/src/debug/qtbase-everywhere-src-6.9.1/src/corelib/global/qflags.h:77
#11 0x00007fb449f7457e in QDBusConnectionManager::run (this=0x7fb449ffeb20 <QGlobalStatic<QtGlobalStatic::Holder<(anonymous namespace)::Q_QGS__q_manager> >::instance()::holder>) at /usr/src/debug/qtbase-everywhere-src-6.9.1/src/dbus/qdbusconnectionmanager.cpp:144
#12 0x00007fb44a332eae in operator() (__closure=<optimized out>) at /usr/src/debug/qtbase-everywhere-src-6.9.1/src/corelib/thread/qthread_unix.cpp:434
#13 (anonymous namespace)::terminate_on_exception<QThreadPrivate::start(void*)::<lambda()> > (t=...) at /usr/src/debug/qtbase-everywhere-src-6.9.1/src/corelib/thread/qthread_unix.cpp:366
#14 QThreadPrivate::start (arg=0x7fb449ffeb20 <QGlobalStatic<QtGlobalStatic::Holder<(anonymous namespace)::Q_QGS__q_manager> >::instance()::holder>) at /usr/src/debug/qtbase-everywhere-src-6.9.1/src/corelib/thread/qthread_unix.cpp:394
#15 0x00007fb44989a7be in start_thread (arg=<optimized out>) at pthread_create.c:448
#16 0x00007fb44991edcc in __GI___clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

Thread 4 (Thread 0x7fb445f966c0 (LWP 22097) "QXcbEventQueue"):
#0  __syscall_cancel_arch () at ../sysdeps/unix/sysv/linux/x86_64/syscall_cancel.S:56
#1  0x00007fb4498969e8 in __internal_syscall_cancel (a1=a1@entry=140412244810056, a2=a2@entry=1, a3=a3@entry=-1, a4=a4@entry=0, a5=a5@entry=0, a6=a6@entry=0, nr=7) at cancellation.c:49
#2  0x00007fb449896a41 in __syscall_cancel (a1=a1@entry=140412244810056, a2=a2@entry=1, a3=a3@entry=-1, a4=a4@entry=0, a5=a5@entry=0, a6=a6@entry=0, nr=7) at cancellation.c:75
#3  0x00007fb449910f9a in __GI___poll (fds=fds@entry=0x7fb445f95948, nfds=nfds@entry=1, timeout=timeout@entry=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#4  0x00007fb447ec9a62 in poll (__fds=0x7fb445f95948, __nfds=1, __timeout=-1) at /usr/include/bits/poll2.h:44
#5  _xcb_conn_wait (c=c@entry=0x56423d6f33e0, vector=vector@entry=0x0, count=count@entry=0x0, cond=<optimized out>) at /usr/src/debug/libxcb-1.17.0/src/xcb_conn.c:510
#6  0x00007fb447ecb4bc in _xcb_conn_wait (c=0x56423d6f33e0, cond=0x56423d6f3420, vector=0x0, count=0x0) at /usr/src/debug/libxcb-1.17.0/src/xcb_conn.c:476
#7  xcb_wait_for_event (c=0x56423d6f33e0) at /usr/src/debug/libxcb-1.17.0/src/xcb_in.c:703
#8  0x00007fb446b95378 in QXcbEventQueue::run (this=0x56423d6e79e0) at /usr/src/debug/qtbase-everywhere-src-6.9.1/src/plugins/platforms/xcb/qxcbeventqueue.cpp:192
#9  0x00007fb44a332eae in operator() (__closure=<optimized out>) at /usr/src/debug/qtbase-everywhere-src-6.9.1/src/corelib/thread/qthread_unix.cpp:434
#10 (anonymous namespace)::terminate_on_exception<QThreadPrivate::start(void*)::<lambda()> > (t=...) at /usr/src/debug/qtbase-everywhere-src-6.9.1/src/corelib/thread/qthread_unix.cpp:366
#11 QThreadPrivate::start (arg=0x56423d6e79e0) at /usr/src/debug/qtbase-everywhere-src-6.9.1/src/corelib/thread/qthread_unix.cpp:394
#12 0x00007fb44989a7be in start_thread (arg=<optimized out>) at pthread_create.c:448
#13 0x00007fb44991edcc in __GI___clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

Thread 3 (Thread 0x7fb43cc6e6c0 (LWP 22098) "kdiff3:disk$0"):
#0  __syscall_cancel_arch () at ../sysdeps/unix/sysv/linux/x86_64/syscall_cancel.S:56
#1  0x00007fb4498969e8 in __internal_syscall_cancel (a1=<optimized out>, a2=<optimized out>, a3=<optimized out>, a4=<optimized out>, a5=a5@entry=0, a6=a6@entry=4294967295, nr=202) at cancellation.c:49
#2  0x00007fb4498971bc in __futex_abstimed_wait_common64 (private=0, futex_word=0x56423d8ce2d0, expected=<optimized out>, op=<optimized out>, abstime=0x0, cancel=true) at futex-internal.c:57
#3  __futex_abstimed_wait_common (futex_word=futex_word@entry=0x56423d8ce2d0, expected=<optimized out>, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0, cancel=cancel@entry=true) at futex-internal.c:87
#4  0x00007fb44989723f in __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x56423d8ce2d0, expected=<optimized out>, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at futex-internal.c:139
#5  0x00007fb449899d08 in __pthread_cond_wait_common (cond=0x56423d8ce2b0, mutex=0x56423d8ce280, clockid=0, abstime=0x0) at pthread_cond_wait.c:426
#6  ___pthread_cond_wait (cond=0x56423d8ce2b0, mutex=0x56423d8ce280) at pthread_cond_wait.c:458
#7  0x00007fb43d601139 in cnd_wait (cond=<optimized out>, mtx=<optimized out>) at ../src/c11/impl/threads_posix.c:111
#8  0x00007fb43d5bc13c in util_queue_thread_func (input=input@entry=0x56423d8d1700) at ../src/util/u_queue.c:275
#9  0x00007fb43d601077 in impl_thrd_routine (p=<optimized out>) at ../src/c11/impl/threads_posix.c:43
#10 0x00007fb44989a7be in start_thread (arg=<optimized out>) at pthread_create.c:448
#11 0x00007fb44991edcc in __GI___clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

Thread 2 (Thread 0x7fb42fbff6c0 (LWP 22099) "kdiff3:sh0"):
#0  __syscall_cancel_arch () at ../sysdeps/unix/sysv/linux/x86_64/syscall_cancel.S:56
#1  0x00007fb4498969e8 in __internal_syscall_cancel (a1=<optimized out>, a2=<optimized out>, a3=<optimized out>, a4=<optimized out>, a5=a5@entry=0, a6=a6@entry=4294967295, nr=202) at cancellation.c:49
#2  0x00007fb4498971bc in __futex_abstimed_wait_common64 (private=0, futex_word=0x56423d8d4fc0, expected=<optimized out>, op=<optimized out>, abstime=0x0, cancel=true) at futex-internal.c:57
#3  __futex_abstimed_wait_common (futex_word=futex_word@entry=0x56423d8d4fc0, expected=<optimized out>, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0, cancel=cancel@entry=true) at futex-internal.c:87
#4  0x00007fb44989723f in __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x56423d8d4fc0, expected=<optimized out>, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at futex-internal.c:139
#5  0x00007fb449899d08 in __pthread_cond_wait_common (cond=0x56423d8d4fa0, mutex=0x56423d8d4f70, clockid=0, abstime=0x0) at pthread_cond_wait.c:426
#6  ___pthread_cond_wait (cond=0x56423d8d4fa0, mutex=0x56423d8d4f70) at pthread_cond_wait.c:458
#7  0x00007fb43d601139 in cnd_wait (cond=<optimized out>, mtx=<optimized out>) at ../src/c11/impl/threads_posix.c:111
#8  0x00007fb43d5bc13c in util_queue_thread_func (input=input@entry=0x56423d8d0c70) at ../src/util/u_queue.c:275
#9  0x00007fb43d601077 in impl_thrd_routine (p=<optimized out>) at ../src/c11/impl/threads_posix.c:43
#10 0x00007fb44989a7be in start_thread (arg=<optimized out>) at pthread_create.c:448
#11 0x00007fb44991edcc in __GI___clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

Thread 1 (Thread 0x7fb446c69b00 (LWP 22095) "kdiff3"):
#0  __syscall_cancel_arch () at ../sysdeps/unix/sysv/linux/x86_64/syscall_cancel.S:56
#1  0x00007fb4498969e8 in __internal_syscall_cancel (a1=<optimized out>, a2=<optimized out>, a3=<optimized out>, a4=<optimized out>, a5=a5@entry=8, a6=a6@entry=0, nr=271) at cancellation.c:49
#2  0x00007fb449896a41 in __syscall_cancel (a1=<optimized out>, a2=<optimized out>, a3=<optimized out>, a4=<optimized out>, a5=a5@entry=8, a6=a6@entry=0, nr=271) at cancellation.c:75
#3  0x00007fb449911522 in __GI_ppoll (fds=fds@entry=0x56423d8a0330, nfds=nfds@entry=2, timeout=<optimized out>, timeout@entry=0x7ffc58344350, sigmask=sigmask@entry=0x0) at ../sysdeps/unix/sysv/linux/ppoll.c:42
#4  0x00007fb44951addf in ppoll (__fds=0x56423d8a0330, __nfds=2, __timeout=0x7ffc58344350, __ss=0x0) at /usr/include/bits/poll2.h:101
#5  g_main_context_poll_unlocked (priority=<optimized out>, context=0x7fb440000f00, timeout_usec=<optimized out>, fds=0x56423d8a0330, n_fds=2) at ../glib/gmain.c:4632
#6  g_main_context_iterate_unlocked (context=context@entry=0x7fb440000f00, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4309
#7  0x00007fb44951b52c in g_main_context_iteration (context=0x7fb440000f00, may_block=1) at ../glib/gmain.c:4379
#8  0x00007fb44a41de83 in QEventDispatcherGlib::processEvents (this=0x56423d7984a0, flags=...) at /usr/src/debug/qtbase-everywhere-src-6.9.1/src/corelib/kernel/qeventdispatcher_glib.cpp:399
#9  0x00007fb44a1c3afb in QEventLoop::exec (this=0x7ffc583444b0, flags=...) at /usr/src/debug/qtbase-everywhere-src-6.9.1/src/corelib/global/qflags.h:77
#10 0x00007fb44a1bc40c in QCoreApplication::exec () at /usr/src/debug/qtbase-everywhere-src-6.9.1/src/corelib/global/qflags.h:77
#11 0x00007fb44aa17120 in QGuiApplication::exec () at /usr/src/debug/qtbase-everywhere-src-6.9.1/src/gui/kernel/qguiapplication.cpp:1986
#12 0x00007fb44b3dcb79 in QApplication::exec () at /usr/src/debug/qtbase-everywhere-src-6.9.1/src/widgets/kernel/qapplication.cpp:2570
#13 0x00005642356f22ab in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/kdiff3-1.12.3/src/main.cpp:195
#14 0x00007fb44982b37b in __libc_start_call_main (main=main@entry=0x5642356f1160 <main(qint32, char**)>, argc=argc@entry=13, argv=argv@entry=0x7ffc58344948) at ../sysdeps/nptl/libc_start_call_main.h:58
#15 0x00007fb44982b44b in __libc_start_main_impl (main=0x5642356f1160 <main(qint32, char**)>, argc=13, argv=0x7ffc58344948, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffc58344938) at ../csu/libc-start.c:360
#16 0x00005642356f5a85 in _start () at ../sysdeps/x86_64/start.S:115
Comment 1 Bruno Pitrus 2025-07-17 11:45:14 UTC
I have bisected and the commit which introduces this bug is https://github.com/KDE/kdiff3/commit/1ae607daa4c2153bbf88295fae153aa08f3bd5b 

Author: Michael Reeves <reeves.87@gmail.com>
Date:   Fri May 9 11:54:11 2025 -0400

    Short curcuit DiffTextWindow::getMaxTextWidth for early init calls

 src/difftextwindow.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Comment 2 Bruno Pitrus 2025-07-18 10:39:34 UTC
Update: I have seen same symptoms on a different test case.

This time they start appearing with commit
https://github.com/KDE/kdiff3/commit/9481fd0f36aebca42791c2704eaf42a893dd37e7

From: Michael Reeves <reeves.87@gmail.com>
Date: Tue, 19 Nov 2024 09:18:21 -0500
Subject: [PATCH] Remove foot gun and reimpliment word warp reset.

This attempts impletement the intent of the removed code without
using the error prone ProgressProxy::cancel mechinism.
---
 src/pdiff.cpp    | 9 +++++++++
 src/progress.cpp | 2 ++
 src/progress.h   | 6 +++---
 3 files changed, 14 insertions(+), 3 deletions(-)
Comment 3 jonaskarlsson 2025-07-23 13:23:34 UTC
Is this a duplicate of 499772?
Comment 4 Loïc Yhuel 2025-08-01 12:35:28 UTC
(In reply to jonaskarlsson from comment #3)
> Is this a duplicate of 499772?

Yes, it seems to be the same random issue.

Note that since the two commits cited here seem to be around word wrap, and I had a diff which seems to reproduced the issue (10/10 failures), I tried enabling Diffview->Word Wrap Diff Window, and suddenly it was fine.
But then I disabled the option, and it worked too, so this is probably still related to timings.
Comment 5 Petr Menšík 2025-08-05 16:33:53 UTC

*** This bug has been marked as a duplicate of bug 499772 ***