Bug 385273

Summary: Dragging QListWidgetItems with icons crashes under Plasma, not other envs
Product: [Plasma] plasma-integration Reporter: JanKusanagi <jan-bugs>
Component: generalAssignee: Martin Flöser <mgraesslin>
Status: RESOLVED UPSTREAM    
Severity: normal CC: jan-bugs
Priority: NOR    
Version First Reported In: 5.10.4   
Target Milestone: ---   
Platform: Mageia RPMs   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Backtrace, Qt 5.9.1, KF 5.38, Plasma 5.10.4

Description JanKusanagi 2017-10-01 19:10:52 UTC
Created attachment 108121 [details]
Backtrace, Qt 5.9.1, KF 5.38, Plasma 5.10.4

I noticed a crash in a program I develop, when dragging certain items (the ones that have an icon) from a QListWidget to another.

I made a very small proof of concept, here: https://gitlab.com/bugpocs/WidgetListCrash

The crash looks like this, triggered after dragging one of the items with icon from the left-side list to the right-side list:


./WidgetListCrash 
Trying to construct an instance of an invalid type, type id: 6553705
Trying to construct an instance of an invalid type, type id: 788558336
Trying to construct an instance of an invalid type, type id: 524358
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Aborted (core dumped)



Dragging the items with no icon works fine.

I've tested this under Mageia, Debian and Archlinux, some i386, some x86_64, some under Plasma, some under other environments.


I pondered reporting this to Qt directly, but the crash does NOT happen under Xfce or Mate, for instance, so I started to suspect KDEPlasmaPlatformTheme.so.
The crash also doesn't happen under Plasma, IF I run the program with XDG_CURRENT_DESKTOP=something-other-than-KDE. Besides Plasma, the crash also happens under LXQt, unless doing the above trick.

So basically, it seems like the crash is averted when Qt believes the environment is GTK-based.


I don't know if this is due to something Qt does "directly", based on some of the desktop-depending stuff done, or instance, here:
http://code.qt.io/cgit/qt/qtbase.git/tree/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
http://code.qt.io/cgit/qt/qtbase.git/tree/src/platformsupport/services/genericunix/qgenericunixservices.cpp

... but after talking about this on #kde-devel, I've decided to report it here, and hopefully the experts will know ;)

Thank you for your time!
Comment 1 JanKusanagi 2017-10-01 19:16:50 UTC
Just in case, I forgot to add that I can reproduce this consistently, every time.
Comment 2 Martin Flöser 2017-10-02 04:20:49 UTC
Please report the crash to Qt. The backtrace does not contain any code written by KDE.