Bug 108495 - [patch][crash] Xorg is crashing on startup in xinerama configuration
Summary: [patch][crash] Xorg is crashing on startup in xinerama configuration
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium major
Assignee: Chris Wilson
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-19 11:37 UTC by Mariusz Białończyk
Modified: 2018-10-22 07:53 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
xorg.log (49.77 KB, text/x-log)
2018-10-19 11:37 UTC, Mariusz Białończyk
no flags Details
xorg.conf (3.35 KB, text/plain)
2018-10-19 11:38 UTC, Mariusz Białończyk
no flags Details
my patch (321 bytes, patch)
2018-10-19 11:38 UTC, Mariusz Białończyk
no flags Details | Splinter Review
Only generate coldprobe for RR (2.71 KB, patch)
2018-10-19 12:46 UTC, Chris Wilson
no flags Details | Splinter Review

Description Mariusz Białończyk 2018-10-19 11:37:07 UTC
Hello
Xorg is crashing with the following backtrace:

[ 17793.950] (EE) Backtrace:
[ 17793.951] (EE) 0: /usr/lib/xorg/Xorg (OsLookupColor+0x139) [0x555656ef5de9]
[ 17793.952] (EE) 1: /lib/x86_64-linux-gnu/libpthread.so.0 (funlockfile+0x50) [0x7f5fbc02d92f]
[ 17793.952] (EE) 2: /lib/x86_64-linux-gnu/libc.so.6 (gsignal+0x10b) [0x7f5fbbe91f3b]
[ 17793.953] (EE) 3: /lib/x86_64-linux-gnu/libc.so.6 (abort+0x151) [0x7f5fbbe932f1]
[ 17793.954] (EE) 4: /lib/x86_64-linux-gnu/libc.so.6 (uselocale+0x33a) [0x7f5fbbe8ac7a]
[ 17793.955] (EE) 5: /lib/x86_64-linux-gnu/libc.so.6 (__assert_fail+0x42) [0x7f5fbbe8ab02]
[ 17793.955] (EE) 6: /usr/lib/xorg/Xorg (RRClientKnowsRates+0x83) [0x555656e55533]
[ 17793.955] (EE) 7: /usr/lib/xorg/Xorg (RRGetInfo+0x47f) [0x555656e55c5f]
[ 17793.956] (EE) 8: /usr/lib/xorg/modules/drivers/intel_drv.so (_init+0x58a82) [0x7f5fba736472]
[ 17793.956] (EE) 9: /usr/lib/xorg/Xorg (TimerSet+0x180) [0x555656eef660]
[ 17793.956] (EE) 10: /usr/lib/xorg/Xorg (TimerSet+0x1f8) [0x555656eef728]
[ 17793.956] (EE) 11: /usr/lib/xorg/Xorg (WaitForSomething+0x277) [0x555656eef807]
[ 17793.956] (EE) 12: /usr/lib/xorg/Xorg (SendErrorToClient+0x10c) [0x555656d9772c]
[ 17793.956] (EE) 13: /usr/lib/xorg/Xorg (InitFonts+0x3b6) [0x555656d9b906]
[ 17793.956] (EE) 14: /lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main+0xe7) [0x7f5fbbe7eb17]
[ 17793.956] (EE) 15: /usr/lib/xorg/Xorg (_start+0x2a) [0x555656d8567a]

Dual-card configuration (intel + nvidia).
This crash happens on xinerama when both cards are in use.
If only intel or only nvidia are used - no such problem.

I've tested it on modesetting and intel driver.
I've also tested on nouveau and proprietary nvidia driver.
In all above circumstances I have a crash when both cards are enabled.

I've prepared a patch which just disables a RandR calls in one place and it helped! At least I have a working Xorg in awesome wm and did not notice any side effects for several hours of testing.

Please review
Comment 1 Mariusz Białończyk 2018-10-19 11:37:37 UTC
Created attachment 142091 [details]
xorg.log
Comment 2 Mariusz Białończyk 2018-10-19 11:38:04 UTC
Created attachment 142092 [details]
xorg.conf
Comment 3 Mariusz Białończyk 2018-10-19 11:38:28 UTC
Created attachment 142093 [details] [review]
my patch
Comment 4 Chris Wilson 2018-10-19 12:36:28 UTC
Try

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 96e7b1bc..76e1e75b 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -7743,7 +7743,10 @@ bool sna_mode_pre_init(ScrnInfoPtr scrn, struct sna *sna)
                }
        }
        sort_config_outputs(sna);
-       TimerSet(NULL, 0, COLDPLUG_DELAY_MS, sna_mode_coldplug, sna);
+
+       /* Simulate a hotplug event on wakeup to force a RR probe */
+       if (rrGetScrPriv(screen))
+               TimerSet(NULL, 0, COLDPLUG_DELAY_MS, sna_mode_coldplug, sna);
 
        sna_setup_provider(scrn);
        return scrn->modes != NULL;
Comment 5 Chris Wilson 2018-10-19 12:37:06 UTC
Would help if I didn't move the code before pasting.
Comment 6 Chris Wilson 2018-10-19 12:46:36 UTC
Created attachment 142094 [details] [review]
Only generate coldprobe for RR
Comment 7 Mariusz Białończyk 2018-10-22 04:33:01 UTC
Chris,
I am confirming that with your patch applied, it is working properly :)

Thank you!
Comment 8 Chris Wilson 2018-10-22 07:53:30 UTC
commit f146dc06ce32df9c2f9b46691e968c7e1bcaeb52 (HEAD -> master, upstream/master)
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Oct 19 13:44:43 2018 +0100

    sna: Only generate a coldprobe RR probe when RandR is enabled
    
    If Xinerama is enabled, RandR is disabled and calling into RR functions
    merely explode, so don't.
    
    Reported-by: Mariusz Białończyk <manio@skyboo.net>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108495
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>


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.