Bug 366575 - kscreen_backend_launcher segfault when debugging is enabled
Summary: kscreen_backend_launcher segfault when debugging is enabled
Status: RESOLVED FIXED
Alias: None
Product: KScreen
Classification: Plasma
Component: libkscreen (show other bugs)
Version: 5.7.3
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Sebastian Kügler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-10 07:50 UTC by Georg
Modified: 2016-08-16 14:47 UTC (History)
0 users

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 Georg 2016-08-10 07:50:08 UTC
I tried to debug a kscreen issue and when enabling debugging via ~/.config/QtProject/qtlogging.ini, kscreen_backend_launcher crashed due to a null pointer dereference.

Reproducible: Always

Steps to Reproduce:
1. set the following content in ~/.config/QtProject/qtlogging.ini
[rules]
*.debug=false
kscreen.xrandr.debug=true
2. run a kscreen command to enable a secondary screen
In my case, this was: kscreen-doctor output.320.enable
3. segmentation fault

Actual Results:  
The problem lies in the following line:
https://github.com/KDE/libkscreen/blob/v5.7.3/backends/xrandr/xrandrconfig.cpp#L521

kscreenOutput->currentMode() is null, thus kscreenOutput->currentMode()->size() causes the segmentation fault.
Comment 1 Sebastian Kügler 2016-08-10 11:04:21 UTC
Proposed fix: https://phabricator.kde.org/D2330
Comment 2 Sebastian Kügler 2016-08-10 11:56:17 UTC
Patch is in master now. I'll see if I can backport it to 5.7.4, but it should get a few days of testing, first.

Thanks for the report!