Bug 312236 - Crash when there is no EDID
Summary: Crash when there is no EDID
Status: RESOLVED FIXED
Alias: None
Product: KScreen
Classification: Plasma
Component: common (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Alex Fiestas
URL:
Keywords:
: 312619 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-12-26 20:26 UTC by Loïc Yhuel
Modified: 2013-01-11 15:16 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Fix for VMware (941 bytes, patch)
2012-12-26 20:40 UTC, Loïc Yhuel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Loïc Yhuel 2012-12-26 20:26:12 UTC
kded4 crashes when there is no EDID, since Serializer::currentId() doesn't check if output->edid() is not null.
For example VMware Workstation guests do not get an EDID.

Reproducible: Always
Comment 1 Loïc Yhuel 2012-12-26 20:31:32 UTC
I saw the crash once without VMware once : when connecting a VGA monitor, but I'm not able to reproduce it (perhaps for some reason the EDID wasn't available immediately).

#5  KScreen::Edid::hash (this=0x0) at /home/sah0169/ext_src/kde/libkscreen/src/edid.cpp:132
#6  0x00007f2751c5cad3 in Serializer::currentId () at /home/sah0169/ext_src/kde/kscreen/kded/serializer.cpp:46
#7  0x00007f2751c5cb9e in Serializer::configExists () at /home/sah0169/ext_src/kde/kscreen/kded/serializer.cpp:58
#8  0x00007f2751c5b4ec in KScreenDaemon::applyConfig (this=<optimized out>) at /home/sah0169/ext_src/kde/kscreen/kded/daemon.cpp:76
#9  0x00000032ce98cebf in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /lib64/libQtCore.so.4
#10 0x00007f274c1334e8 in XRandROutput::updateKScreenOutput (this=0x1cd4a60, output=0x1eec660) at /home/sah0169/ext_src/kde/libkscreen/backends/xrandr/xrandroutput.cpp:269
#11 0x00007f274c12f179 in XRandRConfig::updateKScreenConfig (this=0x1e9c2a0, config=0x1eeaa00) at /home/sah0169/ext_src/kde/libkscreen/backends/xrandr/xrandrconfig.cpp:103
#12 0x0000003121c0756c in KScreen::ConfigMonitor::updateConfigs (this=<optimized out>) at /home/sah0169/ext_src/kde/libkscreen/src/configmonitor.cpp:77
#13 0x0000003121c075b9 in KScreen::ConfigMonitor::notifyUpdate (this=<optimized out>) at /home/sah0169/ext_src/kde/libkscreen/src/configmonitor.cpp:67
#14 0x00007f274c12e599 in XRandR::handleX11Event (message=<optimized out>) at /home/sah0169/ext_src/kde/libkscreen/backends/xrandr/xrandr.cpp:1024
Comment 2 Loïc Yhuel 2012-12-26 20:40:38 UTC
Created attachment 76028 [details]
Fix for VMware

When there is no EDID, use the output name instead in Serializer::currentId(), so it can still allow two different configurations : output connected or not.

I'm not sure how the second case when plugging the external monitor happened. With this patch it won't take the existing configuration recorded with EDID, but it's at least better than crashing.
Comment 3 H.H. 2012-12-29 10:47:01 UTC
I also have this crash, when trying to the edid, but I am not running kde as a virtual machine guest.

this is my configuration:

hwinfo --gfx
09: PCI 02.0: 0300 VGA compatible controller (VGA)              
  [Created at pci.319]
  Unique ID: _Znp.lPQO3e3I18E
  SysFS ID: /devices/pci0000:00/0000:00:02.0
  SysFS BusID: 0000:00:02.0
  Hardware Class: graphics card
  Model: "Intel Mobile 4 Series Chipset Integrated Graphics Controller"
  Vendor: pci 0x8086 "Intel Corporation"
  Device: pci 0x2a42 "Mobile 4 Series Chipset Integrated Graphics Controller"
  SubVendor: pci 0x1179 "Toshiba America Info Systems"
  SubDevice: pci 0x000d 
  Revision: 0x07
  Driver: "i915"
  Driver Modules: "drm"
  Memory Range: 0xff400000-0xff7fffff (rw,non-prefetchable)
  Memory Range: 0xe0000000-0xefffffff (ro,non-prefetchable)
  I/O Ports: 0xcff8-0xcfff (rw)
  IRQ: 43 (17721 events)
  I/O Ports: 0x3c0-0x3df (rw)
  Module Alias: "pci:v00008086d00002A42sv00001179sd0000000Dbc03sc00i00"
  Driver Info #0:
    Driver Status: i915 is active
    Driver Activation Cmd: "modprobe i915"
  Config Status: cfg=no, avail=yes, need=no, active=unknown

10: PCI 02.1: 0380 Display controller
  [Created at pci.319]
  Unique ID: ruGf.Gsn0zTMyIl3
  SysFS ID: /devices/pci0000:00/0000:00:02.1
  SysFS BusID: 0000:00:02.1
  Hardware Class: graphics card
  Model: "Intel Mobile 4 Series Chipset Integrated Graphics Controller"
  Vendor: pci 0x8086 "Intel Corporation"
  Device: pci 0x2a43 "Mobile 4 Series Chipset Integrated Graphics Controller"
  SubVendor: pci 0x1179 "Toshiba America Info Systems"
  SubDevice: pci 0x000d 
  Revision: 0x07
  Memory Range: 0xc0000000-0xc00fffff (rw,non-prefetchable,disabled)                                                                        
  Module Alias: "pci:v00008086d00002A43sv00001179sd0000000Dbc03sc80i00"                                                                     
  Config Status: cfg=no, avail=yes, need=no, active=unknown                                                                                 
                                                                                                                                            
Primary display adapter: #9
Comment 4 Loïc Yhuel 2012-12-29 21:54:22 UTC
(In reply to comment #3)
> I also have this crash, when trying to the edid, but I am not running kde as
> a virtual machine guest.
> 
Does your monitor have an EDID ? You can check with "xrandr --verbose".
If it does, there is perhaps a problem with the plug event.
If it doesn't, then it's the same as the virtual machine.
Comment 5 H.H. 2012-12-29 23:17:48 UTC
I tested only with the internal laptop screen, no other screen attached (there are additional dvi and vga outputs). This is my output:

xrandr --verbose
Screen 0: minimum 320 x 200, current 1280 x 1024, maximum 8192 x 8192
LVDS1 connected (normal left inverted right x axis y axis)
        Identifier: 0x41
        Timestamp:  32049
        Subpixel:   horizontal rgb
        Clones:    
        CRTCs:      1 0
        Transform:  1.000000 0.000000 0.000000
                    0.000000 1.000000 0.000000
                    0.000000 0.000000 1.000000
                   filter: 
        BACKLIGHT: 0 (0x00000000)       range:  (0,7)
        Backlight: 0 (0x00000000)       range:  (0,7)
        scaling mode:   Full aspect
                supported: None         Full         Center       Full aspect 
  1280x800 (0x44)   68.8MHz -HSync -VSync +preferred
        h: width  1280 start 1328 end 1360 total 1420 skew    0 clock   48.5KHz
        v: height  800 start  801 end  802 total  806           clock   60.2Hz
  1024x768 (0x45)   65.0MHz -HSync -VSync
        h: width  1024 start 1048 end 1184 total 1344 skew    0 clock   48.4KHz
        v: height  768 start  771 end  777 total  806           clock   60.0Hz
  800x600 (0x46)   40.0MHz +HSync +VSync
        h: width   800 start  840 end  968 total 1056 skew    0 clock   37.9KHz
        v: height  600 start  601 end  605 total  628           clock   60.3Hz
  800x600 (0x47)   36.0MHz +HSync +VSync
        h: width   800 start  824 end  896 total 1024 skew    0 clock   35.2KHz
        v: height  600 start  601 end  603 total  625           clock   56.2Hz
  640x480 (0x48)   25.2MHz -HSync -VSync
        h: width   640 start  656 end  752 total  800 skew    0 clock   31.5KHz
        v: height  480 start  490 end  492 total  525           clock   59.9Hz
VGA1 disconnected (normal left inverted right x axis y axis)
        Identifier: 0x42
        Timestamp:  32049
        Subpixel:   unknown
        Clones:    
        CRTCs:      1 0
        Transform:  1.000000 0.000000 0.000000
                    0.000000 1.000000 0.000000
                    0.000000 0.000000 1.000000
                   filter:
Comment 6 Loïc Yhuel 2012-12-30 00:09:35 UTC
(In reply to comment #5)
> I tested only with the internal laptop screen, no other screen attached

So it seems your LVDS panel doesn't have an EDID (so the video modes probably come from the BIOS).
I think my proposed patch will solve your problem : you don't need to identify the panel exactly in the configuration, unlike external monitors, as you cannot change it.
Comment 7 H.H. 2012-12-30 14:45:12 UTC
serializer.cpp line 103 also needs to be patched, then it does not crash at least.

It still does not work 100% reliable. It would be nice to have a list of own configurations/monitor setups to select from in the configuration window.
Comment 8 Daniel Vrátil 2012-12-30 15:25:43 UTC
Thanks for the patch, we are currently considering a slightly different approach. Hopefully we will be able to ship it soonish.
Comment 9 H.H. 2012-12-30 15:33:57 UTC
Another thing to think of:

kwin allows to remember positions for windows/programs. if I have configured two monitor beside each other, and work mainly on the right one (my external screen), this could be something like x=2800,y=50, even if my internal screen is switched off. So would it be usefull to cooperate with kwin to save those positions relative to the screens and monitor-setup?
Comment 10 Daniel Vrátil 2012-12-30 16:11:52 UTC
(In reply to comment #9)
> Another thing to think of:
> 
> kwin allows to remember positions for windows/programs. if I have configured
> two monitor beside each other, and work mainly on the right one (my external
> screen), this could be something like x=2800,y=50, even if my internal
> screen is switched off. So would it be usefull to cooperate with kwin to
> save those positions relative to the screens and monitor-setup?

Please create a new feature request in KScreen/common
Comment 11 Brad Hubbard 2013-01-02 00:22:39 UTC
I have seen this on bare metal with two displays, both with EDIDs, whilst switching users (brad->test, new session) so maybe this bug is inappropriately titled or maybe we need a new one? This was with libkscreen/kscreen compiled from git in the last couple of days.

Screen 0: minimum 320 x 200, current 3360 x 1080, maximum 8192 x 8192
LVDS1 connected 1920x1080+0+0 (0x49) normal (normal left inverted right x axis y axis) 344mm x 193mm
        Identifier: 0x41
        Timestamp:  167958573
        Subpixel:   horizontal rgb
        Gamma:      1.0:1.0:1.0
        Brightness: 1.0
        Clones:    
        CRTC:       1
        CRTCs:      1 0
        Transform:  1.000000 0.000000 0.000000
                    0.000000 1.000000 0.000000
                    0.000000 0.000000 1.000000
                   filter: 
        EDID:
                00ffffffffffff0030aeb24000000000
                0113010380221378ea2135ad5037aa24
                11505400000001010101010101010101
                0101010101014c368082703832403c30
                aa0058c1100000183f2d808270383240
                3c30aa0058c1100000180000000f00d1
                0932d109281b190006af5634000000fe
                004231353648573031205634200a00d6

HDMI1 connected 1440x900+1920+78 (0x52) normal (normal left inverted right x axis y axis) 408mm x 255mm
        Identifier: 0x43
        Timestamp:  167958573
        Subpixel:   unknown
        Gamma:      1.0:1.0:1.0
        Brightness: 1.0
        Clones:    
        CRTC:       0
        CRTCs:      1 0
        Transform:  1.000000 0.000000 0.000000
                    0.000000 1.000000 0.000000
                    0.000000 0.000000 1.000000
                   filter: 
        EDID:
                00ffffffffffff0010ac04f053413230
                1411010380291a78eec125a3564b9927
                115054bfef809500714f8180950f0101
                0101010101019a29a0d0518422305098
                360098ff1000001c000000fd00384b1e
                530e000a202020202020000000ff0059
                59373730373548303241530a000000fc
                0044454c4c20534531393857465000d4

$ find ~/.kde/share/apps/kscreen/ -type f -print -exec cat {} \;
/home/brad/.kde/share/apps/kscreen/0c3c523dac191d47d524e3ded96c9780
[ { "enabled" : true, "hash" : "3ec2e55eb2526859dc5e2a71769d1263", "mode" : { "refresh" : 60.0043, "size" : { "height" : 1080, "width" : 1920 } }, "pos" : { "x" : 0, "y" : 0 }, "primary" : false, "rotation" : 1 } ]/home/brad/.kde/share/apps/kscreen/2363c42efec10f9de1abf5cb1a02661d
[ { "enabled" : true, "hash" : "3ec2e55eb2526859dc5e2a71769d1263", "mode" : { "refresh" : 60.0043, "size" : { "height" : 1080, "width" : 1920 } }, "pos" : { "x" : 0, "y" : 0 }, "primary" : false, "rotation" : 1 }, { "enabled" : true, "hash" : "36885b8c1ffb81885bcf2e612edb69d9", "mode" : { "refresh" : 59.8874, "size" : { "height" : 900, "width" : 1440 } }, "pos" : { "x" : 1920, "y" : 78 }, "primary" : true, "rotation" : 1 } ]

$ sudo find ~test/.kde/share/apps/kscreen/ -type f -print -exec cat {} \;
/home/test/.kde/share/apps/kscreen/2363c42efec10f9de1abf5cb1a02661d
[ { "enabled" : true, "hash" : "3ec2e55eb2526859dc5e2a71769d1263", "mode" : { "refresh" : 60.0043, "size" : { "height" : 1080, "width" : 1920 } }, "pos" : { "x" : 0, "y" : 0 }, "primary" : true, "rotation" : 1 }, { "enabled" : true, "hash" : "36885b8c1ffb81885bcf2e612edb69d9", "mode" : { "refresh" : 59.8874, "size" : { "height" : 900, "width" : 1440 } }, "pos" : { "x" : 1920, "y" : 0 }, "primary" : false, "rotation" : 1 } ]

(gdb) bt
#0  KScreen::Edid::hash (this=<optimized out>) at /home/brad/working/src/libkscreen/src/edid.cpp:132
#1  0x00007f0f7bc28c26 in Serializer::currentId () at /home/brad/working/src/kscreen/kded/serializer.cpp:46
#2  0x00007f0f7bc28dbd in Serializer::configExists () at /home/brad/working/src/kscreen/kded/serializer.cpp:58
#3  0x00007f0f7bc27559 in KScreenDaemon::applyConfig (this=this@entry=0x8dc120) at /home/brad/working/src/kscreen/kded/daemon.cpp:76
#4  0x00007f0f7bc27cc9 in KScreenDaemon::init (this=0x8dc120) at /home/brad/working/src/kscreen/kded/daemon.cpp:68
#5  0x0000003ee0f8cdbf in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /lib64/libQtCore.so.4
#6  0x0000003ee0f8cdbf in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /lib64/libQtCore.so.4
#7  0x00007f0f7bc2ebd4 in Device::isLidClosedFetched (this=0x8e9710, watcher=0x75b1d0) at /home/brad/working/src/kscreen/kded/device.cpp:146
#8  0x0000003ee0f8cdbf in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /lib64/libQtCore.so.4
#9  0x0000003ee205c2bf in QDBusPendingCallWatcher::finished(QDBusPendingCallWatcher*) () from /lib64/libQtDBus.so.4
#10 0x0000003ee0f8c29e in QObject::event(QEvent*) () from /lib64/libQtCore.so.4
#11 0x0000003ee3bca5ac in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQtGui.so.4
#12 0x0000003ee3bcea2a in QApplication::notify(QObject*, QEvent*) () from /lib64/libQtGui.so.4
#13 0x0000003ea7a468a6 in KApplication::notify(QObject*, QEvent*) () from /lib64/libkdeui.so.5
#14 0x0000003ee0f7799e in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /lib64/libQtCore.so.4
#15 0x0000003ee0f7b451 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /lib64/libQtCore.so.4
#16 0x0000003ee0fa5e33 in ?? () from /lib64/libQtCore.so.4
#17 0x0000003ed7647825 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#18 0x0000003ed7647b58 in ?? () from /lib64/libglib-2.0.so.0
#19 0x0000003ed7647c14 in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#20 0x0000003ee0fa5fc6 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4
#21 0x0000003ee3c6a5ee in ?? () from /lib64/libQtGui.so.4
#22 0x0000003ee0f766ef in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4
#23 0x0000003ee0f76978 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4
#24 0x0000003ee0f7b768 in QCoreApplication::exec() () from /lib64/libQtCore.so.4
#25 0x0000003ea9e084c0 in kdemain () from /lib64/libkdeinit4_kded4.so
#26 0x0000003ed5a21735 in __libc_start_main () from /lib64/libc.so.6
#27 0x00000000004007a1 in _start ()

(gdb) f
#1  0x00007f0f7bc28c26 in Serializer::currentId () at /home/brad/working/src/kscreen/kded/serializer.cpp:46
46              hashList.insert(0, output->edid()->hash());

(gdb) p output->m_edid
$9 = {
  o = 0x0
}

I have the complete abrtd dump so ping me if you want it.
Comment 12 Brad Hubbard 2013-01-02 00:29:36 UTC
I probably should mention that this was the first time I'd logged on as that user since switching to kscreen and that whilst the session was initilising I had switched back to my original session. It was only upon switching back to the new session for user "test" that i noticed the crash.
Comment 13 Daniel Vrátil 2013-01-05 02:28:03 UTC
*** Bug 312619 has been marked as a duplicate of this bug. ***
Comment 14 Andreas Kuhl 2013-01-08 10:39:07 UTC
I added my backtrace to a duplicate of this bug. However, the crash appears while I obviously do have a EDID:

Screen 0: minimum 320 x 200, current 1600 x 900, maximum 8192 x 8192
LVDS1 connected 1600x900+0+0 (0x43) normal (normal left inverted right x axis y axis) 322mm x 181mm
        Identifier: 0x41
        Timestamp:  16191
        Subpixel:   horizontal rgb
        Gamma:      0.97:1.1:1.4
        Brightness: 0.97
        Clones:    
        CRTC:       0
        CRTCs:      0 1
        Transform:  1.000000 0.000000 0.000000
                    0.000000 1.000000 0.000000
                    0.000000 0.000000 1.000000
                   filter: 
        EDID:
                00ffffffffffff003064090e01010101                                                                                                                                      
                14140103802012780a2b8ca45549a627                                                                                                                                      
                09505300000001010101010101010101                                                                                                                                      
                0101010101011c2a407e618407304040                                                                                                                                      
                110042b5100000180000000f00040804                                                                                                                                      
                080000010173c2020500000000fe0054                                                                                                                                      
                4d444953504c41590a202020000000fe                                                                                                                                      
                004c54313435454531353030300a005f                                                                                                                                      
        BACKLIGHT: 10 (0x0000000a)      range:  (0,10)                                                                                                                                
        Backlight: 10 (0x0000000a)      range:  (0,10)
        scaling mode:   Full aspect
                supported: None         Full         Center       Full aspect 
  1600x900 (0x43)  107.8MHz -HSync -VSync *current +preferred
        h: width  1600 start 1664 end 1728 total 1982 skew    0 clock   54.4KHz
        v: height  900 start  901 end  902 total  907           clock   60.0Hz
  1024x768 (0x44)   65.0MHz -HSync -VSync
        h: width  1024 start 1048 end 1184 total 1344 skew    0 clock   48.4KHz
        v: height  768 start  771 end  777 total  806           clock   60.0Hz
  800x600 (0x45)   40.0MHz +HSync +VSync
        h: width   800 start  840 end  968 total 1056 skew    0 clock   37.9KHz
        v: height  600 start  601 end  605 total  628           clock   60.3Hz
  800x600 (0x46)   36.0MHz +HSync +VSync
        h: width   800 start  824 end  896 total 1024 skew    0 clock   35.2KHz
        v: height  600 start  601 end  603 total  625           clock   56.2Hz
  640x480 (0x47)   25.2MHz -HSync -VSync
        h: width   640 start  656 end  752 total  800 skew    0 clock   31.5KHz
        v: height  480 start  490 end  492 total  525           clock   59.9Hz
VGA1 disconnected (normal left inverted right x axis y axis)
        Identifier: 0x42
        Timestamp:  16191
        Subpixel:   unknown
        Clones:    
        CRTCs:      0 1
        Transform:  1.000000 0.000000 0.000000
                    0.000000 1.000000 0.000000
                    0.000000 0.000000 1.000000
                   filter:
Comment 15 Lamarque V. Souza 2013-01-09 21:18:55 UTC
Git commit b309874669283054825f24194bdafff1e776a0ce by Lamarque V. Souza.
Committed on 09/01/2013 at 22:07.
Pushed by lvsouza into branch 'master'.

Semantic change in XRandROutput::edid() and select the first preferred mode
found for a montior.

REVIEW: 107940
Related: bug 312951

M  +7    -1    backends/xrandr/xrandroutput.cpp

http://commits.kde.org/libkscreen/b309874669283054825f24194bdafff1e776a0ce
Comment 16 H.H. 2013-01-11 15:16:21 UTC
with the latest version I don't have any crashes anymore.