Bug 93415 - Xorg crashes under Zaphod mode when adding/removing display (bisected)
Summary: Xorg crashes under Zaphod mode when adding/removing display (bisected)
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/Radeon (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: xf86-video-ati maintainers
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-16 21:58 UTC by James Le Cuirot
Modified: 2016-05-10 09:52 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Xorg.0.log (44.97 KB, text/plain)
2015-12-16 21:58 UTC, James Le Cuirot
no flags Details
Handle Zaphod mode correctly in radeon_mode_hotplug (2.67 KB, patch)
2016-04-13 02:15 UTC, Michel Dänzer
no flags Details | Splinter Review

Description James Le Cuirot 2015-12-16 21:58:30 UTC
Created attachment 120553 [details]
Xorg.0.log

When I turn my HDMI-connected AV unit on or off, Xorg (1.17.4) suddenly crashes.

This has been observed on xf86-video-ati 7.6.1 and 78fbca0. It worked fine under 7.5.0 and I have bisected the problem to 2f11dcd, which added hotplugging for DP 1.2. I don't have any DisplayPort hardware here though, it's all DVI/HDMI.

This is only affecting Zaphod mode. I have tried with no xorg.conf to give me xrandr mode and I was unable to reproduce the problem there.

I have attached Xorg.0.log, which includes a backtrace. I have looked up the addresses in radeon_drv.so and they correspond to the area that was changed. I'm not sure exactly where the first entry is as I don't have a core dump but I may obtain one later.

[172723.305] (EE) 3: /usr/lib64/xorg/modules/drivers/radeon_drv.so (0x7fdbbdd19000+0x4d510) [0x7fdbbdd66510]
http://cgit.freedesktop.org/xorg/driver/xf86-video-ati/tree/src/drmmode_display.c?id=78fbca095ae9887a2d3de48bb07975e2d1126e68#n1567

[172723.305] (EE) 4: /usr/lib64/xorg/modules/drivers/radeon_drv.so (0x7fdbbdd19000+0x502c9) [0x7fdbbdd692c9]
http://cgit.freedesktop.org/xorg/driver/xf86-video-ati/tree/src/drmmode_display.c?id=78fbca095ae9887a2d3de48bb07975e2d1126e68#n2403

[172723.305] (EE) 5: /usr/lib64/xorg/modules/drivers/radeon_drv.so (0x7fdbbdd19000+0x50387) [0x7fdbbdd69387]
http://cgit.freedesktop.org/xorg/driver/xf86-video-ati/tree/src/drmmode_display.c?id=78fbca095ae9887a2d3de48bb07975e2d1126e68#n2426
Comment 1 Michel Dänzer 2015-12-17 02:19:25 UTC
Dave, any ideas offhand?

(In reply to James Le Cuirot from comment #0)
> [172723.305] (EE) 3: /usr/lib64/xorg/modules/drivers/radeon_drv.so
> (0x7fdbbdd19000+0x4d510) [0x7fdbbdd66510]
> http://cgit.freedesktop.org/xorg/driver/xf86-video-ati/tree/src/
> drmmode_display.c?id=78fbca095ae9887a2d3de48bb07975e2d1126e68#n1567

This line doesn't seem to match up with the rest of the backtrace. Please get a backtrace with gdb.
Comment 2 James Le Cuirot 2015-12-17 20:10:10 UTC
Here you go.

#0  0x00007fdde79f7510 in snprintf (__fmt=<optimized out>, __n=<optimized out>, __s=<optimized out>) at /usr/include/bits/stdio2.h:64
#1  drmmode_create_name (koutput=0x24aaa30, koutput=0x24aaa30, num_hdmi=0x0, num_dvi=0x0, path_blob=0x0, name=0x7ffff5023790 "\240!F\002", pScrn=0x1f5bd80) at drmmode_display.c:1475
#2  drmmode_output_init (pScrn=pScrn@entry=0x1f5bd80, drmmode=drmmode@entry=0x1f5cd30, num=0, num_dvi=num_dvi@entry=0x0, num_hdmi=num_hdmi@entry=0x0, dynamic=1, mode_res=0x1f671b0)
    at drmmode_display.c:1538
#3  0x00007fdde79fa2c9 in radeon_mode_hotplug (scrn=0x1f5bd80, drmmode=0x1f5cd30) at drmmode_display.c:2403
#4  0x00007fdde79fa387 in drmmode_handle_uevents (fd=<optimized out>, closure=0x1f5cd30) at drmmode_display.c:2426
#5  0x00000000004767fa in xf86Wakeup ()
#6  0x000000000043cc0b in WakeupHandler ()
#7  0x000000000058876d in WaitForSomething ()
#8  0x0000000000437dd1 in ?? ()
#9  0x000000000043c0bb in ?? ()
#10 0x00007fddec4dc620 in __libc_start_main () from /lib64/libc.so.6
#11 0x0000000000426639 in _start ()
Comment 3 James Le Cuirot 2016-02-21 23:05:04 UTC
Still a problem as of 7bc089ee9740a3ef91f16e36786d8ed64e165acd and Linux 4.5-rc5. I've had to hold back to xorg-server 1.17 because 7.50 won't build against 1.18.
Comment 4 Michal Schmidt 2016-04-08 09:16:27 UTC
radeon_mode_hotplug() calls drmmode_output_init() with num_dvi=NULL, num_hdmi=NULL. drmmode_create_name() dereferences them.
Comment 5 Michel Dänzer 2016-04-13 02:15:43 UTC
Created attachment 122886 [details] [review]
Handle Zaphod mode correctly in  radeon_mode_hotplug

Does this patch fix the problem?
Comment 6 James Le Cuirot 2016-04-17 11:02:26 UTC
(In reply to Michel Dänzer from comment #5)
> Created attachment 122886 [details] [review] [review]
> Handle Zaphod mode correctly in  radeon_mode_hotplug
> 
> Does this patch fix the problem?

That does appear to have fixed it, thanks very much.
Comment 7 Michel Dänzer 2016-05-10 09:52:11 UTC
commit c801f9f10a5d72d935faf21e72f7e7808fb4f05f
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Wed Apr 13 11:12:38 2016 +0900

    Handle Zaphod mode correctly in radeon_mode_hotplug


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.