Bug 79909 - [GM45, bisected, SNA] X won't start
Summary: [GM45, bisected, SNA] X won't start
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Chris Wilson
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-11 08:22 UTC by Pavel Ondračka
Modified: 2014-06-11 14:44 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Pavel Ondračka 2014-06-11 08:22:32 UTC
With 2.99.912 my Xserver doesn't start.

first bad commit:
commit 40fe1f2c09a98ac75b05db3663d29ee1a64ed280
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri May 30 18:30:47 2014 +0100

    sna: Do not allow imported buffers to be cached
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Sadly I'm not able to obtain any useful Xorg log, as switching to other console doesn't work and I don't have other computer at hand. Is there some way to obtain a Xorg log without another machine?

Also during the bisection I've encountered heavy corruption at commits 	3dac734bb0fb0ae1febfef9a9289cf830a87be1c and 961139f5878572ebea268a0bbf47caf05af9093f but still marked them good because X started, so I don't exactly know when the corruption was introduced and it may be unrelated.

GPU: GM45
kernel: 3.11.10-100.fc18.x86_64
Xserver: 1.13.3
libdrm: 2.4.46-1.fc18
Comment 1 Chris Wilson 2014-06-11 11:13:45 UTC
If I know which bug you are talking about, it is not actually a bug in the DDX or even X. But the kernel hangs when X tries to VT switch. If you do have ssh, you could grab the log (so I presume you don't!) and could even attach gdb to verify where the hang occurs.

This prevents the kernel bug from causing X to hang:

index 2bd78e2..a7bdc4b 100644
--- a/drivers/tty/vt/vt_ioctl.c
+++ b/drivers/tty/vt/vt_ioctl.c
@@ -684,7 +684,8 @@ int vt_ioctl(struct tty_struct *tty,
                        console_unlock();
                        if (ret)
                                break;
-                       set_console(arg);
+                       if (set_console(arg))
+                               ret = -EIO;
                }
                break;
Comment 2 Pavel Ondračka 2014-06-11 14:06:15 UTC
I didn't compile the kernel, as that is too much complicated for me, however I was able to obtain a backtrace:

X: sna_display.c:312: assert_scanout: Assertion `bo->scanout' failed.

Program received signal SIGABRT, Aborted.
0x00000030dd035c55 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:63
63	  return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
(gdb) bt full
#0  0x00000030dd035c55 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:63
        resultvar = 0
        pid = 17475
        selftid = 17475
#1  0x00000030dd037408 in __GI_abort () at abort.c:90
        save_stage = 2
        act = {__sigaction_handler = {sa_handler = 0x7fff1addd1c2, sa_sigaction = 0x7fff1addd1c2}, sa_mask = {__val = {209867729701, 47316723631117, 312, 
              4222451713, 140733644124720, 0, 37960792, 4, 140733644124080, 0, 0, 0, 209867729507, 21474836480, 47316712296448, 209867739752}}, 
          sa_flags = -931103893, sa_restorer = 0x2b08c8811895 <__PRETTY_FUNCTION__.25161>}
        sigs = {__val = {32, 0 <repeats 15 times>}}
#2  0x00000030dd02e972 in __assert_fail_base (fmt=0x30dd179268 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
    assertion=assertion@entry=0x2b08c8807b6b "bo->scanout", file=file@entry=0x2b08c881040d "sna_display.c", line=line@entry=312, 
    function=function@entry=0x2b08c8811895 <__PRETTY_FUNCTION__.25161> "assert_scanout") at assert.c:92
        str = 0x248abf0 ""
        total = 4096
#3  0x00000030dd02ea22 in __GI___assert_fail (assertion=assertion@entry=0x2b08c8807b6b "bo->scanout", file=file@entry=0x2b08c881040d "sna_display.c", 
    line=line@entry=312, function=function@entry=0x2b08c8811895 <__PRETTY_FUNCTION__.25161> "assert_scanout") at assert.c:101
No locals.
#4  0x00002b08c8739dc5 in assert_scanout (kgem=0x2b08c945c000, height=768, width=1366, bo=0x248a960) at sna_display.c:312
        info = {fb_id = 0, width = 1082654720, height = 0, pitch = 1072693248, bpp = 0, depth = 0, handle = 3376791552}
#5  get_fb (sna=sna@entry=0x2b08c945c000, bo=bo@entry=0x248a960, width=1366, height=768) at sna_display.c:340
        scrn = 0x2434740
        arg = {fb_id = 0, width = 1082654720, height = 0, pitch = 1072693248, bpp = 0, depth = 0, handle = 3376791552}
        __PRETTY_FUNCTION__ = "get_fb"
        __FUNCTION__ = "get_fb"
#6  0x00002b08c873b6f5 in sna_crtc_attach (crtc=0x2436cd0) at sna_display.c:1720
        scrn = 0x2434740
        sna_crtc = 0x2436bd0
        sna = 0x2b08c945c000
        bo = <optimized out>
#7  sna_crtc_set_mode_major (crtc=0x2436cd0, mode=<optimized out>, rotation=<optimized out>, x=<optimized out>, y=<optimized out>) at sna_display.c:1961
        scrn = <optimized out>
        sna = 0x2b08c945c000
        sna_crtc = 0x2436bd0
        saved_bo = 0x0
        bo = 0x248a960
        saved_kmode = {clock = 0, hdisplay = 0, hsync_start = 0, hsync_end = 0, htotal = 0, hskew = 0, vdisplay = 0, vsync_start = 0, vsync_end = 0, 
          vtotal = 0, vscan = 0, vrefresh = 0, flags = 0, type = 0, name = '\000' <repeats 31 times>}
        saved_offset = 0
        saved_transform = false
        outputs = "LVDS1\000 \000\000\000\000\000\000\000\000'\000\000\000\000\000\000\000)\020\264\335\032\377\177\000\000\000\000\000\000\000\000\000\000@", '\000' <repeats 39 times>, "\002\000\000\000\060\000\000\000[\000\000\000n\000\000\000w\000\000\000|\000\000\000 \264\335\032\377\177\000\000\f\000\000\000\063\000\000\000[\000\000\000n\000\000\000w\000\000\000|\000\000\000@\264\335\032\377\177\000\000\000\000\000\000\000\000\000I@\027;\335\060\000\000\000\t", '\000' <repeats 15 times>, "\001\000\000\000\000\000\000\000\340jC\002\000\000\000\000\320lC\002\000\000\000\000\363\364\a\335\060\000\000\000\001\000\000\000\000\000\000\000@\245C\002\000\000\000\000\t\000\000\000\000\000\000\000\"^\b\335\060\000\000\000\225˨\002\000\000\000\000\060\253H\002\000\000\000"
        __PRETTY_FUNCTION__ = "sna_crtc_set_mode_major"
#8  0x00000000004c23dd in xf86CrtcSetModeTransform (crtc=crtc@entry=0x2436cd0, mode=mode@entry=0x2436db8, rotation=1, transform=0x0, x=<optimized out>, y=0)
    at xf86Crtc.c:297
        scrn = 0x2434740
        xf86_config = 0x2436ae0
        i = <optimized out>
        ret = 0
        didLock = 0
        adjusted_mode = 0x248ab30
        saved_mode = {prev = 0x0, next = 0x0, name = 0x0, status = MODE_OK, type = 0, Clock = 0, HDisplay = 0, HSyncStart = 0, HSyncEnd = 0, HTotal = 0, 
          HSkew = 0, VDisplay = 0, VSyncStart = 0, VSyncEnd = 0, VTotal = 0, VScan = 0, Flags = 0, ClockIndex = 0, SynthClock = 0, CrtcHDisplay = 0, 
          CrtcHBlankStart = 0, CrtcHSyncStart = 0, CrtcHSyncEnd = 0, CrtcHBlankEnd = 0, CrtcHTotal = 0, CrtcHSkew = 0, CrtcVDisplay = 0, 
          CrtcVBlankStart = 0, CrtcVSyncStart = 0, CrtcVSyncEnd = 0, CrtcVBlankEnd = 0, CrtcVTotal = 0, CrtcHAdjusted = 0, CrtcVAdjusted = 0, PrivSize = 0, 
          Private = 0x0, PrivFlags = 0, HSync = 0, VRefresh = 0}
        saved_x = 0
        saved_y = 0
        saved_rotation = 1
        saved_transform = {transform = {matrix = {{37972704, 0, 0}, {0, -1439505067, 0}, {-932473450, 11016, -1}}}, f_transform = {m = {{
                2.3377566984530678e-310, 1.8930959203217541e-316, 2.3377566984530678e-310}, {2.1122650218269978e-317, 1.0368671015601774e-312, 
                2.337757398997245e-310}, {2.3377566984613681e-310, 1.3833838083554903e-322, 2.3377566991388804e-310}}}, f_inverse = {m = {{
                1.8930959203217541e-316, 2.3377566987112171e-310, 1.8930959203217541e-316}, {2.337757398997245e-310, 6.9531658776641103e-310, 
                2.3377567190794686e-310}, {1.893068252645587e-316, 1.8930809007261206e-316, 0}}}, filter = 0x2b08c8a3b660, params = 0x0, nparams = 8501232, 
          width = 0, height = 8503744}
        saved_transform_present = 0
#9  0x00000000004c2c15 in xf86SetDesiredModes (scrn=scrn@entry=0x2434740) at xf86Crtc.c:2720
        output = <optimized out>
        o = <optimized out>
        transform = <optimized out>
        config = 0x2436ae0
        crtc = 0x2436cd0
        c = 0
#10 0x00002b08c87424cc in sna_set_desired_mode (sna=sna@entry=0x2b08c945c000) at sna_driver.c:199
        scrn = 0x2434740
#11 0x00002b08c8743f00 in sna_create_screen_resources (screen=<optimized out>) at sna_driver.c:279
        sna = 0x2b08c945c000
        new_front = 0x248a860
        hint = <optimized out>
        __PRETTY_FUNCTION__ = "sna_create_screen_resources"

#12 0x00000000004bfc4e in xf86CrtcCreateScreenResources (screen=0x243cf50) at xf86Crtc.c:707
        scrn = <optimized out>
        config = <optimized out>
#13 0x0000000000428196 in main (argc=1, argv=0x7fff1addb8f8, envp=<optimized out>) at main.c:225
        pScreen = 0x243cf50
        i = 0
        alwaysCheckForInput = {0, 1}

Is this the problem you were talking about?
Comment 3 Chris Wilson 2014-06-11 14:44:06 UTC
I should have realised the impact of your old kernel.

commit c9003c6d9602dba682e577ea7ce39990ea378db3
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Jun 11 15:29:59 2014 +0100

    sna: Fix scanout creation routine for old kernels <= 3.11
    
    With an old kernel, we would fail to actually mark the display as part
    of the scanout domain, but proceed to assign it a fb id. This caused our
    asserts to report our bookkeeping error.
    
    Reported-by: Pavel Ondračka <pavel.ondracka@email.cz>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79909
    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.