#767356 X.Org segfaults when starting on an Intel+Radeon laptop at glamor_set_screen_pixmap from within radeon_drv

Package:
xserver-xorg-core
Source:
xorg-server
Description:
Xorg X server - core server
Submitter:
Date:
2014-12-24 09:33:04 UTC
Severity:
important
#767356#5
Date:
2014-10-30 12:45:11 UTC
From:
To:
I have got hp zbook 14 with has Intel IGP + Radeon GPU.  In pursue of enabling
access to the display ports on the docking station installed 3.17 kernel and
fresh intel driver.  With

xrandr --setprovideroffloadsink radeon Intel
xrandr --setprovideroutputsource radeon Intel

made those display ports visible but they showed just gray, and when I switched
one of them back to onboard display port, the other one on docking station
started to show some garbled image (just colored stripes/dots).  Then when I
turned it off (in gnome3 display settings), the entire X crashed.

I have by now rebooted few times but every time Xorg just segfaults upon boot,
so some stale settings bring it into the mysery and I can't even use it
(besides logging in like now via ssh).  Any recipe for help/remedy would be welcomed

It seems to differ from the similar case
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=761445

Oct 30 08:32:38 hopa gdm-Xorg-:5[1495]: (EE)
Oct 30 08:32:38 hopa gdm-Xorg-:5[1495]: (EE) Backtrace:
Oct 30 08:32:38 hopa gdm-Xorg-:5[1495]: (EE) 0: /usr/bin/Xorg (xorg_backtrace+0x56) [0x7f24f4c08ab6]
Oct 30 08:32:38 hopa gdm-Xorg-:5[1495]: (EE) 1: /usr/bin/Xorg (0x7f24f4a53000+0x1b9c99) [0x7f24f4c0cc99]
Oct 30 08:32:38 hopa gdm-Xorg-:5[1495]: (EE) 2: /lib/x86_64-linux-gnu/libc.so.6 (0x7f24f2748000+0x350f0) [0x7f24f277d0f0]
Oct 30 08:32:38 hopa gdm-Xorg-:5[1495]: (EE) 3: /usr/lib/xorg/modules/libglamoregl.so (glamor_set_screen_pixmap+0x60) [0x7f24ecfc23b0]
Oct 30 08:32:38 hopa gdm-Xorg-:5[1495]: (EE) 4: /usr/lib/xorg/modules/libglamoregl.so (glamor_egl_create_textured_screen+0xa0) [0x7f24ecfbf060]
Oct 30 08:32:38 hopa gdm-Xorg-:5[1495]: (EE) 5: /usr/lib/xorg/modules/libglamoregl.so (glamor_egl_create_textured_screen_ext+0x3d) [0x7f24ecfbf13d]
Oct 30 08:32:38 hopa gdm-Xorg-:5[1495]: (EE) 6: /usr/lib/xorg/modules/drivers/radeon_drv.so (0x7f24ee42f000+0x4c48c) [0x7f24ee47b48c]
Oct 30 08:32:38 hopa gdm-Xorg-:5[1495]: (EE) 7: /usr/lib/xorg/modules/drivers/radeon_drv.so (0x7f24ee42f000+0x44e0a) [0x7f24ee473e0a]
Oct 30 08:32:38 hopa gdm-Xorg-:5[1495]: (EE) 8: /usr/bin/Xorg (0x7f24f4a53000+0xcbbfe) [0x7f24f4b1ebfe]
Oct 30 08:32:38 hopa gdm-Xorg-:5[1495]: (EE) 9: /usr/bin/Xorg (0x7f24f4a53000+0x5aed4) [0x7f24f4aaded4]
Oct 30 08:32:38 hopa gdm-Xorg-:5[1495]: (EE) 10: /lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main+0xf5) [0x7f24f2769b45]
Oct 30 08:32:38 hopa gdm-Xorg-:5[1495]: (EE) 11: /usr/bin/Xorg (0x7f24f4a53000+0x4550e) [0x7f24f4a9850e]
Oct 30 08:32:38 hopa gdm-Xorg-:5[1495]: (EE)
Oct 30 08:32:38 hopa gdm-Xorg-:5[1495]: (EE) Segmentation fault at address 0x1c
Oct 30 08:32:38 hopa gdm-Xorg-:5[1495]: (EE)
Oct 30 08:32:38 hopa gdm-Xorg-:5[1495]: Fatal server error:
Oct 30 08:32:38 hopa gdm-Xorg-:5[1495]: (EE) Caught signal 11 (Segmentation fault). Server aborting
Oct 30 08:32:38 hopa gdm-Xorg-:5[1495]: (EE)
Oct 30 08:32:38 hopa gdm-Xorg-:5[1495]: (EE)
Oct 30 08:32:38 hopa gdm-Xorg-:5[1495]: Please consult the The X.Org Foundation support
Oct 30 08:32:38 hopa gdm-Xorg-:5[1495]: at http://wiki.x.org
Oct 30 08:32:38 hopa gdm-Xorg-:5[1495]: for help.
Oct 30 08:32:38 hopa gdm-Xorg-:5[1495]: (EE) Please also check the log file at "/dev/null" for additional information.
Oct 30 08:32:38 hopa gdm-Xorg-:5[1495]: (EE)
Oct 30 08:32:38 hopa gdm-Xorg-:5[1495]: (II) AIGLX: Suspending AIGLX clients for VT switch
Oct 30 08:32:38 hopa gdm-Xorg-:5[1495]: Xorg: intel_device.c:752: intel_put_master: Assertion `dev->master_count' failed.

#767356#10
Date:
2014-10-30 13:01:15 UTC
From:
To:
FWIW dirty workaround was to diver radeon_drv.so , restart gdm3 so it
fails to find it, remove diversion, restart gdm3 and it managed to start
fine (well -- now I got a stuck mouse's cursor pointer copy in the
middle of the screen for some reason, but that is the least  of my
problems atm)

#767356#15
Date:
2014-10-31 12:34:39 UTC
From:
To:
This reads quite like my problem Bug# 766861.
Is this the same thing? Feel free to mark mine a duplicate if this is
plausible.

Also, maybe I am stupid today, but please can you explain the workaround
more in detail? Did you rename the driver so it was not found?

TIA
/ralph

#767356#20
Date:
2014-12-12 08:48:48 UTC
From:
To:
Dear Maintainer,

Xorg segfaults with a backtrace at startup on my AMD desktop with
integrated (Radeon KAVERI) graphics. This looks like the same problem
as Yaroslav Halchenko's report in bug #767356. I've attached a more
detailed backtrace. I had this problem in 1.16.1.901 in testing,
upgraded to 1.16.2.901 from unstable, no apparent change.

There is discussion of what looks like the same bug at:
https://www.libreoffice.org/bugzilla/show_bug.cgi?id=84186

The crash happens in glamor_set_screen_pixmap() because pixmap_priv->base.fbo is
NULL, but (as the comments in the libreoffice bug mention) the real problem
is presumably earlier when it can't create the FBO. Here's a gdb session with
some extra debugging env vars turned on:

Reading symbols from /usr/bin/Xorg...Reading symbols from /usr/lib/debug//usr/bin/Xorg...done.
done.
(gdb) set env GLAMOR_DEBUG=1
(gdb) set env EGL_LOG_LEVEL=debug
(gdb) run -keeptty
Starting program: /usr/bin/Xorg -keeptty
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

X.Org X Server 1.16.1.901 (1.16.2 RC 1)
Release Date: 2014-11-02
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.2.0-4-amd64 x86_64 Debian
Current Operating System: Linux underwood 3.16.0-4-amd64 #1 SMP Debian 3.16.7-2 (2014-11-06) x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-3.16.0-4-amd64 root=UUID=5fdbbdbd-c492-4d83-9452-7b8441374d18 ro quiet
Build Date: 03 November 2014  09:44:08PM
xorg-server 2:1.16.1.901-1 (http://www.debian.org/support)
Current version of pixman: 0.32.6
	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
	 (++) from command line, (!!) notice, (II) informational,
	 (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Thu Dec 11 15:44:53 2014
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(II) [KMS] Kernel modesetting enabled.
[New Thread 0x7fffed1ef700 (LWP 4694)]
libEGL debug: Native platform type: drm (autodetected)
libEGL debug: EGL search path is /usr/lib/x86_64-linux-gnu/egl
libEGL debug: added /usr/lib/x86_64-linux-gnu/egl/egl_gallium.so to module array
libEGL debug: added egl_dri2 to module array
libEGL debug: dlopen(/usr/lib/x86_64-linux-gnu/egl/egl_gallium.so)
libEGL info: use DRM for display 0x5555559dd4a0
libEGL debug: EGL user error 0x3001 (EGL_NOT_INITIALIZED) in eglInitialize(no usable display)

libEGL debug: the best driver is DRI2
         glamor_pixmap_ensure_fb:	glamor: Failed to create fbo, incomplete attachment
         glamor_pixmap_ensure_fb:	glamor: Failed to create fbo, incomplete attachment
XXX fail to create fbo.

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff13883b0 in glamor_set_screen_pixmap (screen_pixmap=screen_pixmap@entry=0x5555561f88d0, back_pixmap=0x0) at ../../glamor/glamor.c:122
122		   ../../glamor/glamor.c: No such file or directory.
(gdb) bt
#0  0x00007ffff13883b0 in glamor_set_screen_pixmap (screen_pixmap=screen_pixmap@entry=0x5555561f88d0, back_pixmap=0x0) at ../../glamor/glamor.c:122
#1  0x00007ffff1385060 in glamor_egl_create_textured_screen (screen=screen@entry=0x5555559d77f0, handle=handle@entry=49, stride=stride@entry=10240)
    at ../../../../glamor/glamor_egl.c:239
#2  0x00007ffff138513d in glamor_egl_create_textured_screen_ext (screen=screen@entry=0x5555559d77f0, handle=49, stride=10240, back_pixmap=back_pixmap@entry=0x0)
    at ../../../../glamor/glamor_egl.c:254
#3  0x00007ffff204048c in radeon_glamor_create_screen_resources (screen=screen@entry=0x5555559d77f0) at ../../src/radeon_glamor.c:67
#4  0x00007ffff2038e0a in RADEONCreateScreenResources_KMS (pScreen=0x5555559d77f0) at ../../src/radeon_kms.c:258
#5  0x000055555561fc4e in xf86CrtcCreateScreenResources (screen=0x5555559d77f0) at ../../../../hw/xfree86/modes/xf86Crtc.c:709
#6  0x00005555555aef36 in dix_main (argc=2, argv=0x7fffffffe658, envp=<optimized out>) at ../../dix/main.c:223
#7  0x00007ffff5d16b45 in __libc_start_main (main=0x5555555994e0 <main>, argc=2, argv=0x7fffffffe658, init=<optimized out>, fini=<optimized out>,
    rtld_fini=<optimized out>, stack_end=0x7fffffffe648) at libc-start.c:287
#8  0x000055555559950e in _start ()
(gdb) inf loc
pixmap_priv = 0x55555622f6f0
(gdb) p *pixmap_priv
$1 = {{type = GLAMOR_TEXTURE_DRM, base = {type = GLAMOR_TEXTURE_DRM, gl_fbo = GLAMOR_FBO_UNATTACHED, map_access = GLAMOR_ACCESS_RO, is_picture = 0 '\000',
      gl_tex = 0 '\000', fbo = 0x0, pixmap = 0x5555561f88d0, box = {x1 = 0, y1 = 0, x2 = 2560, y2 = 1440}, drm_stride = 0, glamor_priv = 0x555555a1cc40,
      picture = 0x0, image = 0x55555622de30}, large = {{type = GLAMOR_TEXTURE_DRM, base = {type = GLAMOR_TEXTURE_DRM, gl_fbo = GLAMOR_FBO_UNATTACHED,
          map_access = GLAMOR_ACCESS_RO, is_picture = 0 '\000', gl_tex = 0 '\000', fbo = 0x0, pixmap = 0x5555561f88d0, box = {x1 = 0, y1 = 0, x2 = 2560,
            y2 = 1440}, drm_stride = 0, glamor_priv = 0x555555a1cc40, picture = 0x0, image = 0x55555622de30}}, box = {x1 = 0, y1 = 0, x2 = 0, y2 = 0},
      block_w = 0, block_h = 0, block_wcnt = 0, block_hcnt = 0, nbox = 0, box_array = 0x0, fbo_array = 0x0}, atlas = {{type = GLAMOR_TEXTURE_DRM, base = {
          type = GLAMOR_TEXTURE_DRM, gl_fbo = GLAMOR_FBO_UNATTACHED, map_access = GLAMOR_ACCESS_RO, is_picture = 0 '\000', gl_tex = 0 '\000', fbo = 0x0,
          pixmap = 0x5555561f88d0, box = {x1 = 0, y1 = 0, x2 = 2560, y2 = 1440}, drm_stride = 0, glamor_priv = 0x555555a1cc40, picture = 0x0,
          image = 0x55555622de30}}, box = {x1 = 0, y1 = 0, x2 = 0, y2 = 0}}}}

#767356#25
Date:
2014-12-16 09:15:05 UTC
From:
To:
Let's continue there. I just added a suggestion for getting more
information.

#767356#30
Date:
2014-12-24 07:56:05 UTC
From:
To:
As you found out there, upgrading libgbm1 to 10.3.y helped.

Do you have libegl1-mesa-drivers installed? If yes, can you try if the
problem also occurs without it?

#767356#35
Date:
2014-12-24 09:28:36 UTC
From:
To:
It doesn't seem to make a difference.

After downgrading libgbm1 back to 10.2.8-1, the problem occurs with or
without libegl1-mesa-drivers_10.3.2 (and its dependency
libopenvg1-mesa_10.3.2).

After upgrading libgbm1 back to 10.3.2-1, X11 works with or without
libegl1-mesa-drivers.