Bug 85330

Summary: xorg-server segfault when radeon driver are activated
Product: xorg Reporter: martin.96.59
Component: Driver/intelAssignee: Chris Wilson <chris>
Status: RESOLVED FIXED QA Contact: Intel GFX Bugs mailing list <intel-gfx-bugs>
Severity: normal    
Priority: medium CC: companheiro.vermelho
Version: 7.5 (2009.10)   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Xorg log
none
GDB Backtrace
none
GDB Backtrace 2 just after launching emacs
none
Xorg log with xf86-video-intel-git
none
Backtrace with debugflags
none
Tree of my directory I use to compile xf86-video-intel
none
Xorg.0.log from the git compilation when the "glitch" bug appears ! none

Description martin.96.59 2014-10-22 14:33:16 UTC
Created attachment 108236 [details]
Xorg log

I'm on Archlinux on a HP 840 G1, when I launch emacs in graphic mode (or conky) with Xorg 1.16, the X server segfault and I return to tty.
Firefox, Thunderbird etc.. works however.
If I switch to xorg 1.15 (with [xorg115] repo), the bug doesn't appear.
If I uninstall xf86-video-ati, the bug doesn't appear too.

I don't know if the problem is xorg-server or ati-radeon, so I put the bug in radeon driver section.

Here is my lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 0b)
03:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Mars [Radeon HD 8730M] (rev ff)

Here are my versions :
local/xorg-server 1.16.1-1 (xorg)
    Xorg X server
local/xorg-server-common 1.16.1-1
    Xorg server common files
local/xf86-video-ati 1:7.5.0-1 (xorg-drivers xorg)
    X.org ati video driver
local/xf86-video-intel 2.99.916-3 (xorg-drivers xorg)
    X.org Intel i810/i830/i915/945G/G965+ video drivers
Comment 1 Chris Wilson 2014-10-22 15:15:28 UTC
You'll have to attach gdb in order to grab a sane backtrace (if at all possible).
Comment 2 martin.96.59 2014-10-22 15:59:24 UTC
(In reply to Chris Wilson from comment #1)
> You'll have to attach gdb in order to grab a sane backtrace (if at all
> possible).

Do I have to recompile Xorg ? (as seen on https://wiki.archlinux.org/index.php/Debug_-_Getting_Traces) because it will just give me no debugging symbols found. 
I'll send the backtrace in a few minutes.
Comment 3 martin.96.59 2014-10-22 16:10:00 UTC
Created attachment 108245 [details]
GDB Backtrace

I don't really know if it s how to do a backtrace, because I didn't recompile Xorg.
Comment 4 martin.96.59 2014-10-22 16:21:20 UTC
Created attachment 108246 [details]
GDB Backtrace 2 just after launching emacs

I made a backtrace just after launching emacs and before X closed.
Comment 5 martin.96.59 2014-10-22 16:46:39 UTC
Here is the backtrace from emacs from the coredump :

#0  0x00007fde533e70c9 in raise () from /usr/lib/libpthread.so.0
#1  0x00000000004e9ad6 in ?? ()
#2  0x00000000005030b3 in ?? ()
#3  0x00000000004bd3bb in ?? ()
#4  0x00000000004bd43d in ?? ()
#5  0x00007fde5663e99e in _XIOError () from /usr/lib/libX11.so.6
#6  0x00007fde5663caa2 in _XReply () from /usr/lib/libX11.so.6
#7  0x00007fde56632290 in ?? () from /usr/lib/libX11.so.6
#8  0x00007fde56632452 in XQueryColors () from /usr/lib/libX11.so.6
#9  0x00000000005bf93f in ?? ()
#10 0x00000000005bfdec in ?? ()
#11 0x00000000004b7ec4 in ?? ()
#12 0x00000000004316b8 in ?? ()
#13 0x00000000004317dd in ?? ()
#14 0x0000000000453f2e in ?? ()
#15 0x0000000000458b94 in ?? ()
#16 0x000000000041c938 in ?? ()
#17 0x000000000041d74b in ?? ()
#18 0x000000000041ed7b in ?? ()
#19 0x00000000004210cd in ?? ()
#20 0x000000000045164f in ?? ()
#21 0x00000000004f4531 in ?? ()
#22 0x00000000004f5caf in ?? ()
---Type <return> to continue, or q <return> to quit---
#23 0x00000000004f7a20 in ?? ()
#24 0x000000000055a157 in ?? ()
#25 0x00000000004e9f4e in ?? ()
#26 0x000000000055a03b in ?? ()
#27 0x00000000004ee577 in ?? ()
#28 0x00000000004ee890 in ?? ()
#29 0x0000000000418119 in ?? ()
#30 0x00007fde53054040 in __libc_start_main () from /usr/lib/libc.so.6
#31 0x0000000000418bc8 in ?? ()
Comment 6 Chris Wilson 2014-10-22 17:11:38 UTC
You need debugging symbols for xf86-video-intel at least, having for Xorg as well would be helpful.
Comment 7 martin.96.59 2014-10-22 19:06:07 UTC
Thanks for your help ! I'm gonna try to recompilate xf86-video-intel and xorg-server with debug flags with https://wiki.archlinux.org/index.php/Debug_-_Getting_Traces  (it's well the right thing to do ?)

Sicne you moved the bug to intel driver, I tried xf86-video-intel-git (from AUR) and I realized that the bug didn't appear anymore but if I try to use PRIME with
xrandr --setprovideroffloadsink radeon Intel (the radeon card was well shown in xrandr --listproviders) 
and with a 
DRI_PRIME=1 glxinfo | grep "OpenGL renderer"
it only shows
OpenGL renderer string: Mesa DRI Intel(R) Haswell Mobile  when it should show the Gallium 0.4.
Comment 8 Chris Wilson 2014-10-22 19:10:50 UTC
Hmm, could you attach the updated Xorg.0.log?
Comment 9 Chris Wilson 2014-10-22 19:11:25 UTC
(In reply to martin.96.59 from comment #7)
> Thanks for your help ! I'm gonna try to recompilate xf86-video-intel and
> xorg-server with debug flags with
> https://wiki.archlinux.org/index.php/Debug_-_Getting_Traces  (it's well the
> right thing to do ?)

Yes. That looks right (given what little I know about Arch).
Comment 10 martin.96.59 2014-10-22 21:48:04 UTC
Created attachment 108263 [details]
Xorg log with xf86-video-intel-git

~|⇒ xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x7d cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: \
4 outputs: 6 associated providers: 0 name:Intel
Provider 1: id: 0x53 cap: 0xf, Source Output, Sink Output, Source Offload, Sink\
 Offload crtcs: 2 outputs: 2 associated providers: 0 name:radeon
~|⇒ xrandr --listprovidersAA
~|⇒ xrandr --setprovideroffloadsink radeon Intel
~|⇒ DRI_PRIME=1 glxinfo | grep "OpenGL renderer"
OpenGL renderer string: Mesa DRI Intel(R) Haswell Mobile
Comment 11 martin.96.59 2014-10-22 21:50:08 UTC
Created attachment 108264 [details]
Backtrace with debugflags
Comment 12 Chris Wilson 2014-10-23 06:30:26 UTC
The last backtrace doesn't match the one in the Xorg.0.log. If I had to guess I would say it is an older version of -intel - because it is hitting

commit 07fe45b84bdf0d236a5bfdc433cc1a908e0c161b
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Sep 9 08:12:45 2014 +0100

    sna/glyphs: Prevent NULL vfunc deref with glyphs
    
    Requires running a PRIME setup with Intel loaded as the secondary GPU
    and attempting to execute an empty glyph string.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Does that make sense? (Oh, that patch is only available in git).

Could you try and get a 'bt full' for

[   175.807] (EE) intel(0): Failed to set backlight intel_backlight for output eDP1, disabling
[   175.807] (EE) 
[   175.807] (EE) Backtrace:
[   175.841] (EE) 0: /usr/bin/Xorg.bin (xorg_backtrace+0x56) [0x593a46]
[   175.841] (EE) 1: /usr/bin/Xorg.bin (0x400000+0x197b99) [0x597b99]
[   175.841] (EE) 2: /usr/lib/libc.so.6 (0x7f8415a89000+0x339f0) [0x7f8415abc9f0]
[   175.841] (EE) 3: /usr/bin/Xorg.bin (RRDeleteOutputProperty+0x9) [0x4fce49]
[   175.841] (EE) 4: /usr/lib/xorg/modules/drivers/intel_drv.so (0x7f8410a66000+0x6410e) [0x7f8410aca10e]
[   175.841] (EE) 5: /usr/lib/xorg/modules/drivers/intel_drv.so (0x7f8410a66000+0x6431d) [0x7f8410aca31d]
[   175.841] (EE) 6: /usr/lib/xorg/modules/drivers/intel_drv.so (0x7f8410a66000+0x64961) [0x7f8410aca961]
[   175.841] (EE) 7: /usr/lib/xorg/modules/drivers/intel_drv.so (0x7f8410a66000+0x6688c) [0x7f8410acc88c]
[   175.841] (EE) 8: /usr/lib/xorg/modules/drivers/intel_drv.so (0x7f8410a66000+0x6e59e) [0x7f8410ad459e]
[   175.841] (EE) 9: /usr/lib/xorg/modules/drivers/intel_drv.so (0x7f8410a66000+0x6e778) [0x7f8410ad4778]
[   175.841] (EE) 10: /usr/lib/xorg/modules/drivers/intel_drv.so (0x7f8410a66000+0x70bce) [0x7f8410ad6bce]
[   175.841] (EE) 11: /usr/bin/Xorg.bin (0x400000+0xadae7) [0x4adae7]
[   175.841] (EE) 12: /usr/bin/Xorg.bin (0x400000+0x1148c2) [0x5148c2]
[   175.841] (EE) 13: /usr/bin/Xorg.bin (0x400000+0xcbc08) [0x4cbc08]
[   175.841] (EE) 14: /usr/bin/Xorg.bin (0x400000+0x112f6c) [0x512f6c]
[   175.841] (EE) 15: /usr/bin/Xorg.bin (0x400000+0x3b977) [0x43b977]
[   175.842] (EE) 16: /usr/lib/libc.so.6 (__libc_start_main+0xf0) [0x7f8415aa9040]
[   175.842] (EE) 17: /usr/bin/Xorg.bin (0x400000+0x25d0e) [0x425d0e]
[   175.842] (EE) 
[   175.842] (EE) Segmentation fault at address 0x0
Comment 13 Chris Wilson 2014-10-23 07:09:01 UTC
(In reply to martin.96.59 from comment #10)
> Created attachment 108263 [details]
> Xorg log with xf86-video-intel-git
> 
> ~|⇒ xrandr --listproviders
> Providers: number : 2
> Provider 0: id: 0x7d cap: 0xb, Source Output, Sink Output, Sink Offload
> crtcs: \
> 4 outputs: 6 associated providers: 0 name:Intel
> Provider 1: id: 0x53 cap: 0xf, Source Output, Sink Output, Source Offload,
> Sink\
>  Offload crtcs: 2 outputs: 2 associated providers: 0 name:radeon
> ~|⇒ xrandr --listprovidersAA
> ~|⇒ xrandr --setprovideroffloadsink radeon Intel
> ~|⇒ DRI_PRIME=1 glxinfo | grep "OpenGL renderer"
> OpenGL renderer string: Mesa DRI Intel(R) Haswell Mobile

I see that -intel enables DRI2/DRI3, but -ati only enables DRI2. Maybe try

$ LIBGL_DRI3_DISABLE DRI_PRIME=1 glxinfo

(or compile -intel with --disable-dri3)
Comment 14 martin.96.59 2014-10-23 07:21:01 UTC
The last Backtrace was for the non-git intel driver, I will make a Backtrace as soon as I have another computer to do it.

PS : the non-git version of xf86-video-intel of Archlinux includes some patchs, I will attach a tree of my the directory I use to compile
Comment 15 martin.96.59 2014-10-23 07:21:56 UTC
Created attachment 108285 [details]
Tree of my directory I use to compile xf86-video-intel
Comment 16 martin.96.59 2014-10-27 19:05:36 UTC
Hi ! I'm sorry, I'm in programmation school and I had a lot of work these days ! 
I recompile the git version of xf86-video-intel with debug flags and now, I'm able to use the amd card !

~|⇒ xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x7d cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 4 outputs: 6 associated providers: 1 name:Intel
Provider 1: id: 0x53 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 2 associated providers: 1 name:radeon
~|⇒ xrandr --setprovideroffloadsink radeon Intel
~|⇒ DRI_PRIME=1 glxinfo | grep "OpenGL renderer"
OpenGL renderer string: Gallium 0.4 on AMD OLAND

But now, when I launch steam I have strange glitches, every minutes, the steam window is a lot of hard colors for 1 seconds.
And when I launch Borderlands 2, during the game it seems that every seconds, it shows me the current image, and every other second, it shows me a one second in the past image.
And when I try to launch Super Meat Boy, it tells me that the library GL_ARB_buffer_object is missing, so, it's a strange problem.

To sum up, I have
- A git version that make me straaaange bugs.
- A stable version that segfault when I use emacs, conky, sometimes with firefox when I deal with selection and scrolling.

What do you want ? I can give you the backtrace (with the debug flag, I can deal with it easier now) or the log if you want !

Thanks :)
Comment 17 Chris Wilson 2014-10-27 20:58:01 UTC
(In reply to martin.96.59 from comment #16) 
> To sum up, I have
> - A git version that make me straaaange bugs.
> - A stable version that segfault when I use emacs, conky, sometimes with
> firefox when I deal with selection and scrolling.
> 
> What do you want ? I can give you the backtrace (with the debug flag, I can
> deal with it easier now) or the log if you want !

I'm confident that I know what bug you are hitting in the current release (and which is fixed in git). So the question is do you see the same OpenGL/PRIME bugs in the stable version? If not, can you attach the Xorg.0.log from the git compilation?
Comment 18 martin.96.59 2014-10-27 21:24:52 UTC
Created attachment 108532 [details]
Xorg.0.log from the git compilation when the "glitch" bug appears !

The bug only appears from the git compilation.
Comment 19 martin.96.59 2014-10-27 21:31:34 UTC
Do you need a steam log of the moment there is the flitch bug ? You found the bug recently from the backtraces ? Thanks a lot for your help !!
Comment 20 martin.96.59 2014-11-03 23:18:53 UTC
Should I try the git version of the ati drivers too ? I tried the last version, but I still got the OpenGL bug :/
Comment 21 martin.96.59 2014-11-03 23:19:29 UTC
Or do you want me to open another bug report ? Thanks :)
Comment 22 Eduardo 2014-12-01 23:55:01 UTC
This same bug has been tormenting me for a while now. I have a different hardware ([Radeon HD 7730M]). Does another trace help?
Comment 23 Chris Wilson 2014-12-25 12:32:22 UTC
The segfault is fixed. Now it sounds like you just have the lack of sync issue between intel/radeon, bug 70055 (not quite, it's a slightly orthogonal problem but is related!)
Comment 24 Chris Wilson 2017-04-08 13:33:34 UTC
(In reply to Chris Wilson from comment #23)
> The segfault is fixed. Now it sounds like you just have the lack of sync
> issue between intel/radeon, bug 70055 (not quite, it's a slightly orthogonal
> problem but is related!)

PRIME sync is now supported from ~v4.9 (a radeon fix may need v4.10, not sure if that made it into v4.9). That should be all parts to this bug fixed...

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.