Bug 477778 - Crash when starting multiple drags
Summary: Crash when starting multiple drags
Status: RESOLVED BACKTRACE
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (other bugs)
Version First Reported In: 5.27.9
Platform: Manjaro Linux
: NOR crash
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-30 16:16 UTC by Pilzschaf
Modified: 2024-05-14 21:44 UTC (History)
1 user (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 Pilzschaf 2023-11-30 16:16:15 UTC
SUMMARY
I had a bug in my application which lead it to create multiple drags eg. it called wl_data_device.start_drag twice. It used two independent wl_data_source objects. The application continued as normal but kwin crashed on me after some time. I could get it to crash reliably when opening thunderbird after doing the drag. 

STEPS TO REPRODUCE
1. Initiate multiple simultaneous drags with wl_data_device.start_drag
2. Finish drags by dropping them somewhere
3. Close application
4. Use system normally. Usually when opening applications (for example thunderbird) it crashed

OBSERVED RESULT
Crash

EXPECTED RESULT
I am not sure whether multiple simultaneous drags are officially supported by wayland. Nonetheless I expect KWin to handle that case somewhat gracefully.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
KDE Plasma Version:  5.27.9
KDE Frameworks Version: 5.112.0
Qt Version: 5.15.11

ADDITIONAL INFORMATION
I appended a crash dump to this report. 
Problem seems to be the following line. 
if (drag->handleClientMessage(event)) {
Probably m_oldDrags contains an invalid element which has not been cleaned up correctly
Comment 1 Pilzschaf 2023-11-30 16:18:18 UTC
Unfortunately the crash dump seems to be too large to add as an attachment