Bug 385273 - Dragging QListWidgetItems with icons crashes under Plasma, not other envs
Summary: Dragging QListWidgetItems with icons crashes under Plasma, not other envs
Status: RESOLVED UPSTREAM
Alias: None
Product: plasma-integration
Classification: Plasma
Component: general (show other bugs)
Version: 5.10.4
Platform: Mageia RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Martin Flöser
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-01 19:10 UTC by JanKusanagi
Modified: 2017-10-02 04:20 UTC (History)
1 user (show)

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


Attachments
Backtrace, Qt 5.9.1, KF 5.38, Plasma 5.10.4 (7.80 KB, text/plain)
2017-10-01 19:10 UTC, JanKusanagi
Details

Note You need to log in before you can comment on or make changes to this bug.
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.