Bug 428698 - LabPlot crashes when trying to drag a folder from one project to another project
Summary: LabPlot crashes when trying to drag a folder from one project to another project
Status: RESOLVED FIXED
Alias: None
Product: LabPlot2
Classification: Applications
Component: general (show other bugs)
Version: 2.8.0
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: Alexander Semke
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2020-11-04 19:20 UTC by Colin Gauvin
Modified: 2020-11-07 09:59 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Colin Gauvin 2020-11-04 19:20:37 UTC
Application: labplot2 (2.8.0)

Qt Version: 5.15.1
Frameworks Version: 5.75.0
Operating System: Linux 5.9.1-1-default x86_64
Windowing system: X11
Distribution: "openSUSE Tumbleweed"

-- Information about the crash:
- What I was doing when the application crashed:

Had two windows of labplot open, each with a different project. Attempted to drag a folder from one project to another project in the other window. Crashes every time.

The crash can be reproduced every time.

-- Backtrace:
Application: LabPlot (labplot2), signal: Segmentation fault

[New LWP 6308]
[New LWP 6309]
[New LWP 6310]
[New LWP 6311]
[New LWP 6312]
[New LWP 6313]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
0x00007f7092ff7e7f in poll () from /lib64/libc.so.6
[Current thread is 1 (Thread 0x7f708f328bc0 (LWP 6307))]

Thread 7 (Thread 0x7f707f7fe640 (LWP 6313)):
#0  0x00007f7092eef082 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007f708587aedb in ?? () from /usr/lib64/dri/i965_dri.so
#2  0x00007f708587a727 in ?? () from /usr/lib64/dri/i965_dri.so
#3  0x00007f7092ee8eb1 in start_thread () from /lib64/libpthread.so.0
#4  0x00007f7093002ccf in clone () from /lib64/libc.so.6

Thread 6 (Thread 0x7f707ffff640 (LWP 6312)):
#0  0x00007f7092eef082 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007f708587aedb in ?? () from /usr/lib64/dri/i965_dri.so
#2  0x00007f708587a727 in ?? () from /usr/lib64/dri/i965_dri.so
#3  0x00007f7092ee8eb1 in start_thread () from /lib64/libpthread.so.0
#4  0x00007f7093002ccf in clone () from /lib64/libc.so.6

Thread 5 (Thread 0x7f7084996640 (LWP 6311)):
#0  0x00007f7092eef082 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007f708587aedb in ?? () from /usr/lib64/dri/i965_dri.so
#2  0x00007f708587a727 in ?? () from /usr/lib64/dri/i965_dri.so
#3  0x00007f7092ee8eb1 in start_thread () from /lib64/libpthread.so.0
#4  0x00007f7093002ccf in clone () from /lib64/libc.so.6

Thread 4 (Thread 0x7f7085197640 (LWP 6310)):
#0  0x00007f7092eef082 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007f708587aedb in ?? () from /usr/lib64/dri/i965_dri.so
#2  0x00007f708587a727 in ?? () from /usr/lib64/dri/i965_dri.so
#3  0x00007f7092ee8eb1 in start_thread () from /lib64/libpthread.so.0
#4  0x00007f7093002ccf in clone () from /lib64/libc.so.6

Thread 3 (Thread 0x7f7087aa8640 (LWP 6309)):
#0  0x00007f7092ff7e7f in poll () from /lib64/libc.so.6
#1  0x00007f7091a2efbe in ?? () from /usr/lib64/libglib-2.0.so.0
#2  0x00007f7091a2f0df in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007f7093f2d5cb in QEventDispatcherGlib::processEvents (this=0x7f7080000b60, flags=...) at kernel/qeventdispatcher_glib.cpp:425
#4  0x00007f7093ed4a1b in QEventLoop::exec (this=this@entry=0x7f7087aa78f0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:141
#5  0x00007f7093cf57ce in QThread::exec (this=<optimized out>) at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#6  0x00007f7092b83a27 in ?? () from /usr/lib64/libQt5DBus.so.5
#7  0x00007f7093cf6911 in QThreadPrivate::start (arg=0x7f7092bf0d80) at thread/qthread_unix.cpp:329
#8  0x00007f7092ee8eb1 in start_thread () from /lib64/libpthread.so.0
#9  0x00007f7093002ccf in clone () from /lib64/libc.so.6

Thread 2 (Thread 0x7f708d2d1640 (LWP 6308)):
#0  0x00007f7092ff7e7f in poll () from /lib64/libc.so.6
#1  0x00007f7090400862 in ?? () from /usr/lib64/libxcb.so.1
#2  0x00007f709040226c in xcb_wait_for_event () from /usr/lib64/libxcb.so.1
#3  0x00007f708d459270 in QXcbEventQueue::run (this=0x55b7e3e2fcc0) at qxcbeventqueue.cpp:228
#4  0x00007f7093cf6911 in QThreadPrivate::start (arg=0x55b7e3e2fcc0) at thread/qthread_unix.cpp:329
#5  0x00007f7092ee8eb1 in start_thread () from /lib64/libpthread.so.0
#6  0x00007f7093002ccf in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7f708f328bc0 (LWP 6307)):
[KCrash Handler]
#4  0x000055b7e219c61e in ProjectExplorer::eventFilter (this=0x55b7e46eb490, obj=0x55b7e4321080, event=0x7fff9a403780) at /usr/src/debug/labplot-kf5-2.8.0-2.1.x86_64/src/commonfrontend/ProjectExplorer.cpp:408
#5  0x00007f7093ed5dc3 in QCoreApplicationPrivate::sendThroughObjectEventFilters (event=<optimized out>, receiver=<optimized out>) at kernel/qcoreapplication.cpp:1189
#6  QCoreApplicationPrivate::sendThroughObjectEventFilters (receiver=receiver@entry=0x55b7e4321080, event=event@entry=0x7fff9a403780) at kernel/qcoreapplication.cpp:1178
#7  0x00007f7094a2b13e in QApplicationPrivate::notify_helper (this=this@entry=0x55b7e3e209f0, receiver=receiver@entry=0x55b7e4321080, e=e@entry=0x7fff9a403780) at kernel/qapplication.cpp:3624
#8  0x00007f7094a33f21 in QApplication::notify (this=<optimized out>, receiver=<optimized out>, e=0x7fff9a403780) at kernel/qapplication.cpp:3376
#9  0x00007f7093ed605a in QCoreApplication::notifyInternal2 (receiver=0x55b7e4321080, event=0x7fff9a403780) at ../../include/QtCore/5.15.1/QtCore/private/../../../../../src/corelib/thread/qthread_p.h:325
#10 0x00007f7094a852c0 in QWidgetWindow::handleDragMoveEvent (this=this@entry=0x55b7e4391fd0, event=event@entry=0x7fff9a403930) at /usr/include/c++/10/bits/atomic_base.h:420
#11 0x00007f7094a86729 in QWidgetWindow::event (this=0x55b7e4391fd0, event=0x7fff9a403930) at kernel/qwidgetwindow.cpp:336
#12 0x00007f7094a2b14f in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x55b7e4391fd0, e=0x7fff9a403930) at kernel/qapplication.cpp:3630
#13 0x00007f7093ed605a in QCoreApplication::notifyInternal2 (receiver=0x55b7e4391fd0, event=0x7fff9a403930) at ../../include/QtCore/5.15.1/QtCore/private/../../../../../src/corelib/thread/qthread_p.h:325
#14 0x00007f709431a235 in QGuiApplicationPrivate::processDrag (w=w@entry=0x55b7e4391fd0, dropData=dropData@entry=0x7f7088005c30, p=..., supportedActions=supportedActions@entry=..., buttons=buttons@entry=..., modifiers=...) at kernel/qguiapplication.cpp:3315
#15 0x00007f70942edca9 in QWindowSystemInterface::handleDrag (window=0x55b7e4391fd0, dropData=dropData@entry=0x7f7088005c30, p=..., supportedActions=supportedActions@entry=..., buttons=buttons@entry=..., modifiers=...) at kernel/qwindowsysteminterface.cpp:931
#16 0x00007f708d46aba1 in QXcbDrag::handle_xdnd_position (this=this@entry=0x55b7e3f28df0, w=w@entry=0x55b7e4205d90, e=e@entry=0x7f708800ed40, b=..., b@entry=..., mods=..., mods@entry=...) at qxcbdrag.cpp:822
#17 0x00007f708d46b118 in QXcbDrag::handlePosition (this=0x55b7e3f28df0, w=0x55b7e4205d90, event=0x7f708800ed40) at ../../../../include/QtCore/../../src/corelib/global/qflags.h:120
#18 0x00007f708d436788 in QXcbConnection::handleXcbEvent (this=this@entry=0x55b7e3e33ce0, event=event@entry=0x7f708800ed40) at qxcbconnection.cpp:597
#19 0x00007f708d437a86 in QXcbConnection::processXcbEvents (this=0x55b7e3e33ce0, flags=...) at qxcbconnection.cpp:1003
#20 0x00007f708d45a263 in xcbSourceDispatch (source=<optimized out>) at qxcbeventdispatcher.cpp:103
#21 0x00007f7091a2eca7 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#22 0x00007f7091a2f028 in ?? () from /usr/lib64/libglib-2.0.so.0
#23 0x00007f7091a2f0df in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#24 0x00007f7093f2d5af in QEventDispatcherGlib::processEvents (this=0x55b7e3faaf20, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#25 0x00007f7093ed4a1b in QEventLoop::exec (this=this@entry=0x7fff9a403e60, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:141
#26 0x00007f7093edcc90 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#27 0x000055b7e1f87822 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/labplot-kf5-2.8.0-2.1.x86_64/src/kdefrontend/LabPlot.cpp:229
[Inferior 1 (process 6307) detached]

Possible duplicates by query: bug 428691, bug 428459, bug 428403, bug 427575, bug 427239.

Reported using DrKonqi
Comment 1 Alexander Semke 2020-11-05 20:34:14 UTC
Thanks for reporting it. We'll fix it 2.8.1 patch release that will come soon. Please note, moving/copying objects across the the different project window is a nice feature but this is not implemented/supported yet. So, the fix will avoid the crash but won't make this drag&drop across two different windows possible.
Comment 2 Alexander Semke 2020-11-07 09:59:01 UTC
Git commit 30c06bad1b3000069ff76a8ae7789662793d36de by Alexander Semke.
Committed on 07/11/2020 at 09:58.
Pushed by asemke into branch 'master'.

Don't crash when doing drag&drop between different main windows.

When starting the drag, we serialize the pointers of the
selected/dragged objects to the mime data. When deserializing this data
in the drop event in a different main window this results in invalid
pointers and leads to a crash. To avoid this, we also serialize and
deserialize the point of the pjoject object and add additional check for
it - if the project pointers in the dropped data differ from the current
project we don't accept the drop. The actual feature itself - drag&drop
between different main windows - is interesting and should be supported
in futur but will required a totally different serialization/deserialization
of the objects.
FIXED-IN: 2.8.1

M  +1    -2    src/backend/core/AbstractAspect.h
M  +2    -12   src/backend/core/Folder.cpp
M  +1    -1    src/backend/core/Folder.h
M  +16   -0    src/backend/core/Project.cpp
M  +2    -0    src/backend/core/Project.h
M  +1    -9    src/backend/worksheet/plots/cartesian/CartesianPlot.cpp
M  +1    -2    src/backend/worksheet/plots/cartesian/CartesianPlot.h
M  +27   -8    src/commonfrontend/ProjectExplorer.cpp
M  +6    -2    src/commonfrontend/worksheet/WorksheetView.cpp

https://invent.kde.org/education/labplot/commit/30c06bad1b3000069ff76a8ae7789662793d36de