Bug 92505 - intel(0): [DRI2] DRI2SwapComplete: bad drawable
Summary: intel(0): [DRI2] DRI2SwapComplete: bad drawable
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Chris Wilson
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-16 20:10 UTC by Kenny MacDermid
Modified: 2016-02-16 20:55 UTC (History)
8 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Xorg.0.log (25.73 KB, text/plain)
2015-11-01 17:06 UTC, FadeMind
no flags Details
Copy of Xorg.0.log.old seen by dan.krejsa@gmail.com after Xorg crash. (26.00 KB, text/plain)
2016-01-26 23:12 UTC, Dan Krejsa
no flags Details
Force AttendClient after DRI2DrawableGone (1.99 KB, patch)
2016-02-04 16:47 UTC, Chris Wilson
no flags Details | Splinter Review

Description Kenny MacDermid 2015-10-16 20:10:48 UTC
Hello, I'm getting Xorg crashes. New software changes are that I'm running zoom.us and Chrome with the acceleration options enabled in chrome://flags.

The log shows:

 [  3990.387] (EE) intel(0): [DRI2] DRI2SwapComplete: bad drawable
[  3990.387] (EE) intel(0): [DRI2] DRI2SwapComplete: bad drawable
[  8581.133] (EE)
[  8581.134] (EE) Backtrace:
[  8581.182] (EE) 0: /usr/lib/xorg-server/Xorg (OsLookupColor+0x139) [0x596d09]
[  8581.200] (EE) 1: /usr/lib/libc.so.6 (__restore_rt+0x0) [0x7f4e9910167f]
[  8581.237] (EE) 2: /usr/lib/xorg/modules/drivers/intel_drv.so (_init+0x144c0) [0x7f4e93cadee0]
[  8581.250] (EE) 3: /usr/lib/xorg/modules/drivers/intel_drv.so (_init+0x1589f) [0x7f4e93cb06bf]
[  8581.264] (EE) 4: /usr/lib/xorg/modules/drivers/intel_drv.so (_init+0x49879) [0x7f4e93d182b9]
[  8581.277] (EE) 5: /usr/lib/xorg/modules/drivers/intel_drv.so (_init+0x49ae2) [0x7f4e93d18932]
[  8581.277] (EE) 6: /usr/lib/xorg-server/Xorg (DamageRegionAppend+0x3783) [0x5214e3]
[  8581.278] (EE) 7: /usr/lib/xorg-server/Xorg (SendGraphicsExpose+0xeb3) [0x4366a3]
[  8581.278] (EE) 8: /usr/lib/xorg-server/Xorg (SendErrorToClient+0x2ff) [0x438e4f]
[  8581.278] (EE) 9: /usr/lib/xorg-server/Xorg (remove_fs_handlers+0x41b) [0x43cf4b]
[  8581.292] (EE) 10: /usr/lib/libc.so.6 (__libc_start_main+0xf0) [0x7f4e990ee610]
[  8581.292] (EE) 11: /usr/lib/xorg-server/Xorg (_start+0x29) [0x427319]
[  8581.326] (EE) 12: ? (?+0x29) [0x29]
[  8581.326] (EE)
[  8581.326] (EE) Segmentation fault at address 0x0
[  8581.326] (EE)
Fatal server error:
[  8581.326] (EE) Caught signal 11 (Segmentation fault). Server aborting
[  8581.326] (EE)
[  8581.326] (EE)

Please let me know if you need any more information. I'm on Arch Linux running xorg-server 1.17.2-4 on kernel 4.2.3-1-ARCH.
Comment 1 FadeMind 2015-11-01 17:06:52 UTC
Created attachment 119325 [details]
Xorg.0.log

Xorg log with DRI2SwapComplete: bad drawable error
Comment 2 FadeMind 2015-11-01 17:09:44 UTC
I have this issue on archlinux. 
Package version:
xorg-server 1.17.4-2
xf86-video-intel 1:2.99.917+478+gdf72bc5-2

Device: 

00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)

driver: i915
Comment 3 Chris Wilson 2015-11-01 17:16:24 UTC
Note that DRI2SwapComplete is a nuisance, nothing more. It is a harmless unavoidable error message from the Xserver.
Comment 4 Kenny MacDermid 2015-11-01 18:41:02 UTC
The stacktrace I posted /seems/ to have been caused by zoom.us, as I've re-enabled the chrome flags and haven't had it reoccur.
Comment 5 pczhang 2015-12-31 19:28:51 UTC
I have this crash when I switch from full-screen to windowed-mode in kodi.
Comment 6 Dan Krejsa 2016-01-26 23:10:18 UTC
I see a very similar Xorg crash on arch linux.  It typically occurs (occasionally) when I leave my laptop idle for a while; I don't know if power management or the screensaver is involved somehow.

[     5.465] (II) intel(0): Modeline "2560x1440"x0.0  241.50  2560 2608 2640 2720  1440 1443 1448 1481 -hsync -vsync (88.8 kHz eP)
[  2039.797] (EE) intel(0): [DRI2] DRI2SwapComplete: bad drawable
[ 12012.309] (EE) intel(0): [DRI2] DRI2SwapComplete: bad drawable
[ 12012.326] (EE) 
[ 12012.326] (EE) Backtrace:
[ 12012.328] (EE) 0: /usr/lib/xorg-server/Xorg (OsLookupColor+0x139) [0x598499]
[ 12012.330] (EE) 1: /usr/lib/libc.so.6 (__restore_rt+0x0) [0x7fc5d3a4567f]
[ 12012.332] (EE) 2: /usr/lib/xorg/modules/drivers/intel_drv.so (_init+0xf413f) [0x7fc5ce7aaaaf]
[ 12012.332] (EE) 3: /usr/lib/xorg/modules/drivers/intel_drv.so (_init+0xf6727) [0x7fc5ce7af637]
[ 12012.333] (EE) 4: /usr/lib/xorg/modules/drivers/intel_drv.so (_init+0x64e60) [0x7fc5ce68c380]
[ 12012.333] (EE) 5: /usr/lib/xorg/modules/drivers/intel_drv.so (_init+0x68b30) [0x7fc5ce693e20]
[ 12012.333] (EE) 6: /usr/lib/xorg-server/Xorg (WakeupHandler+0xaa) [0x43adca]
[ 12012.333] (EE) 7: /usr/lib/xorg-server/Xorg (WaitForSomething+0x1ef) [0x590caf]
[ 12012.333] (EE) 8: /usr/lib/xorg-server/Xorg (SendErrorToClient+0x10e) [0x43609e]
[ 12012.333] (EE) 9: /usr/lib/xorg-server/Xorg (remove_fs_handlers+0x453) [0x43a293]
[ 12012.334] (EE) 10: /usr/lib/libc.so.6 (__libc_start_main+0xf0) [0x7fc5d3a32610]
[ 12012.334] (EE) 11: /usr/lib/xorg-server/Xorg (_start+0x29) [0x4245c9]
[ 12012.334] (EE) 12: ? (?+0x29) [0x29]
[ 12012.334] (EE) 
[ 12012.334] (EE) Segmentation fault at address 0x0
[ 12012.334] (EE) 
Fatal server error:
[ 12012.334] (EE) Caught signal 11 (Segmentation fault). Server aborting
[ 12012.334] (EE) 
[ 12012.334] (EE) 
Please consult the The X.Org Foundation support 
	 at http://wiki.x.org
 for help. 
[ 12012.334] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[ 12012.334] (EE) 
[ 12012.334] (II) AIGLX: Suspending AIGLX clients for VT switch
[ 12012.469] (EE) Server terminated with error (1). Closing log file.
Comment 7 Dan Krejsa 2016-01-26 23:12:02 UTC
Created attachment 121318 [details]
Copy of Xorg.0.log.old seen by dan.krejsa@gmail.com after Xorg crash.
Comment 8 Lim Siew Hoon 2016-01-27 00:35:57 UTC
The segmentation fault happen based on your log, it looks like trying to access NULL memory. But I'm not sure you are using which xf86-video-intel version. If you are using SNA.
And check is this below commit inside your code xf86-video-intel code or not.

commit c4565979572b61cf7fc0b931333c032c88b259f1
Author: Chris Wilson 
Date:   Wed Dec 2 10:06:46 2015 +0000

    sna/dri2: Emit the outstanding signal when eliding a swap

    When we do the exchange for the next swap, we should emit any pending
    completion signal for the previous buffer 

It could be another corner case trigger by this code changed. Worth to give a try apply this patch see whether it help or not if  the issue is trigger by this commit "c4565979572b61cf7fc0b931333c032c88b259f1" and if you are using SNA. 

I did fix similar corner case segmentation fault issue happen in some video playback in full screen mode. The last flip complete signal may happen after the sna_dri2_destroy_window function has been called. This leads to calling frame_swap_complete with a NULL flip drawable. 

And I did send code fixed at here:
http://lists.freedesktop.org/archives/intel-gfx/2016-January/084443.html
Comment 9 Scott Kiesling 2016-01-29 12:46:28 UTC
I'm getting the exact same crash as Dan, in the same circumstances, in Arch. Errors are identical in my log. It seems to occur after xscreensaver has been running for a while.
xorg-server 1.18.0-4
xf86-video-intel 1:2.99.917+519+g8229390-1
Kernel 4.3.3-3-ARCH 

I don't have time to deal with patching right now, but it's worth knowing that this error is not isolated.
Comment 10 Chris Wilson 2016-01-29 12:49:30 UTC
commit 7817949314a21293c8bc34dec214b42932b19aaf
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Jan 27 10:54:46 2016 +0000

    sna/dri2: Avoiding marking a pending-signal on a dead Drawable
    
    If the Drawable is gone, we cannot send it a frame-complete signal, and
    in particular we cannot continue the pending flip-chain.
    
    References: https://bugs.freedesktop.org/show_bug.cgi?id=93844
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Comment 11 Dan Krejsa 2016-02-03 20:16:59 UTC
For what it's worth, my software versions are the same as Scott Kiesling's:

[dlkrejsa@shadow log]$ pacman -Q xorg-server
xorg-server 1.18.0-4
[dlkrejsa@shadow log]$ pacman -Q xf86-video-intel
xf86-video-intel 1:2.99.917+519+g8229390-1
[dlkrejsa@shadow log]$ uname -a
Linux shadow 4.3.3-3-ARCH #1 SMP PREEMPT Wed Jan 20 08:12:23 CET 2016 x86_64 GNU/Linux

I'm not sure I know enough to figure out how to try Chris's change. If I can find the time and can figure out how, I'll give it a try, otherwise I'll wait for it to work its way downstream...  Thanks!
Comment 12 Parker Reed 2016-02-04 16:40:50 UTC
Same issue here on Arch

xf86-video-intel 1:2.99.917+519+g8229390-1
xorg-server 1.18.0-4

Gives me 

[  2169.252] (EE) intel(0): [DRI2] DRI2SwapComplete: bad drawable
[  2169.252] (EE) intel(0): [DRI2] DRI2SwapComplete: bad drawable
[  2187.538] (EE) intel(0): [DRI2] DRI2SwapComplete: bad drawable
[  2187.538] (EE) intel(0): [DRI2] DRI2SwapComplete: bad drawable
[  2188.741] (EE) intel(0): [DRI2] DRI2SwapComplete: bad drawable
[  3920.843] (EE) intel(0): [DRI2] DRI2SwapComplete: bad drawable
[  3920.862] (EE) 
[  3920.862] (EE) Backtrace:
[  3920.863] (EE) 0: /usr/lib/xorg-server/Xorg (OsLookupColor+0x139) [0x598499]
[  3920.895] (EE) 1: /usr/lib/libc.so.6 (__restore_rt+0x0) [0x7f4a789ee67f]
[  3920.895] (EE) 2: /usr/lib/xorg/modules/drivers/intel_drv.so (_init+0xf413f) [0x7f4a73753aaf]
[  3920.895] (EE) 3: /usr/lib/xorg/modules/drivers/intel_drv.so (_init+0xf6727) [0x7f4a73758637]
[  3920.895] (EE) 4: /usr/lib/xorg/modules/drivers/intel_drv.so (_init+0x64e60) [0x7f4a73635380]
[  3920.896] (EE) 5: /usr/lib/xorg/modules/drivers/intel_drv.so (_init+0x68b30) [0x7f4a7363ce20]
[  3920.896] (EE) 6: /usr/lib/xorg-server/Xorg (WakeupHandler+0xaa) [0x43adca]
[  3920.913] (EE) 7: /usr/lib/xorg-server/Xorg (WaitForSomething+0x1ef) [0x590caf]
[  3920.914] (EE) 8: /usr/lib/xorg-server/Xorg (SendErrorToClient+0x10e) [0x43609e]
[  3920.914] (EE) 9: /usr/lib/xorg-server/Xorg (remove_fs_handlers+0x453) [0x43a293]
[  3920.914] (EE) 10: /usr/lib/libc.so.6 (__libc_start_main+0xf0) [0x7f4a789db610]
[  3920.914] (EE) 11: /usr/lib/xorg-server/Xorg (_start+0x29) [0x4245c9]
[  3920.914] (EE) 12: ? (?+0x29) [0x29]
[  3920.914] (EE) 
[  3920.914] (EE) Segmentation fault at address 0x0
[  3920.914] (EE) 
Fatal server error:
[  3920.914] (EE) Caught signal 11 (Segmentation fault). Server aborting

----------------

I went and tried xf86-video-intel from testing and run into something different

xf86-video-intel 1:2.99.917+544+g8b8c9a3-1
xorg-server 1.18.0-4

"Odd behavior. Only upgraded xf86-video-intel to testing and removed my UXA conf. Xorg starts, i3 loads, I load retroarch/mpv, upon exit of either program X "freezes" (The last thing on the screen right before I hit exit stays on screen), and I can't get control of X. When I switch to tty2 and back to tty1 (Not running anything extra) X is working again and I can repeat the same process. Nothing seems to show up in the log."


Hardware: Intel Core i3-4150 (Haswell) HD Graphics 4400
Comment 13 Chris Wilson 2016-02-04 16:47:06 UTC
Created attachment 121524 [details] [review]
Force AttendClient after DRI2DrawableGone

Try this to workaround an X/DRI2 bug.
Comment 14 Lindsay Roberts 2016-02-16 20:55:50 UTC
Original issue was fixed by updating to video-intel git master, but experienced a similar problem to Parker.

Tested with xf86-video-intel master (e41040fb55e84fc72612ae503944a99814a5c9d3) + the "Force AttendClient after DRI2DrawableGone" patch. No change.

xserver: 1.18.1-3
HW: Ivy Bridge
SNA: yes

In my case the display manager's (SDDM) output persists until VT switch, but X may be otherwise functional: cursor changes to reasonable things in reasonable places. After VT switch I've seen no further issues. Nothing of note in Xorg.log/dmesg.


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.