Bug 464260

Summary: Dragging folder into main window diff view crashes
Product: [Applications] kdiff3 Reporter: nyanpasu64 <nyanpasu64>
Component: applicationAssignee: michael <reeves.87>
Status: RESOLVED FIXED    
Severity: crash    
Priority: NOR    
Version First Reported In: 1.10.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 1.10.1
Sentry Crash Report:

Description nyanpasu64 2023-01-13 23:59:39 UTC
SUMMARY
After kdiff3 1.10.0's "side file tree" rewrite, dragging a folder into a diff pane crashes KDiff3 completely.

STEPS TO REPRODUCE
1. Open KDiff3 from the app launcher (without any files).
2. Drag any folder from Dolphin into one of the two empty text areas in KDiff3. 

OBSERVED RESULT
KDiff3 crashes.

EXPECTED RESULT
KDiff3 loads the folder into one of the diff panes, and enters a directory diff mode either immediately or upon dragging a second folder. If one side is a file and one side is a folder, do nothing I suppose?

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.26.5
KDE Frameworks Version: 5.101.0
Qt Version: 5.15.8
Kernel Version: 6.1.4-zen2-1-zen (64-bit)
Graphics Platform: X11
Processors: 12 × AMD Ryzen 5 5600X 6-Core Processor
Memory: 15.5 GiB of RAM
Graphics Processor: AMD Radeon RX 570 Series
Manufacturer: Gigabyte Technology Co., Ltd.
Product Name: B550M DS3H

ADDITIONAL INFORMATION
(gdb) bt
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007fcf436a16b3 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
#2  0x00007fcf43651958 in __GI_raise (sig=6) at ../sysdeps/posix/raise.c:26
#3  0x00007fcf45544868 in KCrash::defaultCrashHandler (sig=6) at /usr/src/debug/kcrash/kcrash-5.101.0/src/kcrash.cpp:633
#4  <signal handler called>
#5  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#6  0x00007fcf436a16b3 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
#7  0x00007fcf43651958 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#8  0x00007fcf4363b53d in __GI_abort () at abort.c:79
#9  0x00007fcf4363b45c in __assert_fail_base (fmt=0x7fcf437b5a50 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x559ccd4cd1c2 "!m_fileAccess.isDir()", file=0x559ccd4cd628 "/build/kdiff3/src/kdiff3-1.10.0/src/SourceData.cpp", line=356, function=<optimized out>) at assert.c:92
#10 0x00007fcf4364a486 in __GI___assert_fail (assertion=0x559ccd4cd1c2 "!m_fileAccess.isDir()", file=0x559ccd4cd628 "/build/kdiff3/src/kdiff3-1.10.0/src/SourceData.cpp", line=356, function=0x559ccd4cd6f0 "void SourceData::readAndPreprocess(QTextCodec*, bool)") at assert.c:101
#11 0x0000559ccd489879 in ?? ()
#12 0x0000559ccd40dced in ?? ()
#13 0x00007fcf43ebda91 in QtPrivate::QSlotObjectBase::call (a=<optimized out>, r=<optimized out>, this=<optimized out>, this=<optimized out>, r=<optimized out>, a=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#14 doActivate<false> (sender=0x559ccf0a2390, signal_index=17, argv=0x7fff5bd6ce10) at kernel/qobject.cpp:3923
#15 0x0000559ccd4223fd in ?? ()
#16 0x00007fcf44baf6a8 in QWidget::event (this=0x559ccf0a2390, event=0x7fff5bd6d210) at kernel/qwidget.cpp:8872
#17 0x00007fcf44b78b5c in QApplicationPrivate::notify_helper (this=this@entry=0x559cce62bf80, receiver=receiver@entry=0x559ccf0a2390, e=e@entry=0x7fff5bd6d210) at kernel/qapplication.cpp:3640
#18 0x00007fcf44b7f056 in QApplication::notify (this=<optimized out>, receiver=<optimized out>, e=0x7fff5bd6d210) at kernel/qapplication.cpp:3386
#19 0x00007fcf43e8cf98 in QCoreApplication::notifyInternal2 (receiver=0x559ccf0a2390, event=0x7fff5bd6d210) at kernel/qcoreapplication.cpp:1064
#20 0x00007fcf44bcfbe4 in QWidgetWindow::handleDropEvent (event=0x7fff5bd6d3b0, this=0x559ccefae4d0) at kernel/qwidgetwindow.cpp:985
#21 QWidgetWindow::event (this=0x559ccefae4d0, event=0x7fff5bd6d3b0) at kernel/qwidgetwindow.cpp:342
#22 0x00007fcf44b78b5c in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x559ccefae4d0, e=0x7fff5bd6d3b0) at kernel/qapplication.cpp:3640
#23 0x00007fcf43e8cf98 in QCoreApplication::notifyInternal2 (receiver=0x559ccefae4d0, event=0x7fff5bd6d3b0) at kernel/qcoreapplication.cpp:1064
#24 0x00007fcf44349daf in QGuiApplicationPrivate::processDrop (w=0x559ccefae4d0, dropData=<optimized out>, p=..., supportedActions=..., buttons=..., modifiers=...) at kernel/qguiapplication.cpp:3333
#25 0x00007fcf443280c6 in QWindowSystemInterface::handleDrop (window=0x559ccefae4d0, dropData=0x7fcf300056c0, p=..., supportedActions=supportedActions@entry=..., buttons=buttons@entry=..., modifiers=...) at kernel/qwindowsysteminterface.cpp:938
#26 0x00007fcf3ed95dda in QXcbDrag::handleDrop(QPlatformWindow*, xcb_client_message_event_t const*, QFlags<Qt::MouseButton>, QFlags<Qt::KeyboardModifier>) [clone .constprop.0] (this=0x559cce6f3980, event=<optimized out>, b=..., mods=...) at /usr/src/debug/qt5-base/qtbase/src/plugins/platforms/xcb/qxcbdrag.cpp:1063
#27 0x00007fcf3ed061aa in QXcbConnection::handleXcbEvent (this=this@entry=0x559cce63fd10, event=event@entry=0x7fcf30007ff0) at /usr/src/debug/qt5-base/qtbase/src/plugins/platforms/xcb/qxcbconnection.cpp:640
#28 0x00007fcf3ed0a4c0 in QXcbConnection::processXcbEvents (this=0x559cce63fd10, flags=...) at /usr/src/debug/qt5-base/qtbase/src/plugins/platforms/xcb/qxcbconnection.cpp:1065
#29 0x00007fcf3ed2e7e8 in xcbSourceDispatch (source=<optimized out>) at /usr/src/debug/qt5-base/qtbase/src/plugins/platforms/xcb/qxcbeventdispatcher.cpp:103
#30 0x00007fcf4291687b in g_main_dispatch (context=0x7fcf38005010) at ../glib/glib/gmain.c:3454
#31 g_main_context_dispatch (context=0x7fcf38005010) at ../glib/glib/gmain.c:4172
#32 0x00007fcf4296dc89 in g_main_context_iterate.constprop.0 (context=0x7fcf38005010, block=1, dispatch=1, self=<optimized out>) at ../glib/glib/gmain.c:4248
#33 0x00007fcf42915132 in g_main_context_iteration (context=0x7fcf38005010, may_block=1) at ../glib/glib/gmain.c:4313
#34 0x00007fcf43ed7c8c in QEventDispatcherGlib::processEvents (this=0x559cce703ee0, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#35 0x00007fcf43e8574c in QEventLoop::exec (this=0x7fff5bd6d920, flags=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#36 0x00007fcf43e90269 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#37 0x0000559ccd3d0667 in ?? ()
#38 0x00007fcf4363c290 in __libc_start_call_main (main=main@entry=0x559ccd3cf480, argc=argc@entry=1, argv=argv@entry=0x7fff5bd6dc28) at ../sysdeps/nptl/libc_start_call_main.h:58
#39 0x00007fcf4363c34a in __libc_start_main_impl (main=0x559ccd3cf480, argc=1, argv=0x7fff5bd6dc28, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff5bd6dc18) at ../csu/libc-start.c:381
#40 0x0000559ccd3d4ce5 in ?? ()
Comment 1 michael 2023-02-12 19:53:06 UTC
Git commit 93154ce18c199de3160ca12ea7949c3d846d0c77 by Michael Reeves.
Committed on 12/02/2023 at 19:52.
Pushed by mreeves into branch '1.10'.

Don't allow dropping folders in text area
FIXED-IN:1.10.1

M  +1    -1    src/Utils.cpp
M  +4    -2    src/difftextwindow.cpp

https://invent.kde.org/sdk/kdiff3/commit/93154ce18c199de3160ca12ea7949c3d846d0c77
Comment 2 michael 2023-02-12 19:53:39 UTC
Git commit 9c5aaab6d20b062a6449aaba23db9187aececcac by Michael Reeves.
Committed on 12/02/2023 at 19:51.
Pushed by mreeves into branch 'master'.

Don't allow dropping folders in text area
FIXED-IN:1.10.1

M  +1    -1    src/Utils.cpp
M  +4    -2    src/difftextwindow.cpp

https://invent.kde.org/sdk/kdiff3/commit/9c5aaab6d20b062a6449aaba23db9187aececcac