Bug 34474

Summary: Server crashes with segmentaion fault in DRI2WaitSwap.
Product: xorg Reporter: Kusanagi Kouichi <slash>
Component: Server/Ext/DRIAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: blocker    
Priority: high CC: kirill, Simon80
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard: 2011BRB_Reviewed
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 44202    
Attachments:
Description Flags
testcase
none
Check the return value of DRI2GetDrawable.
none
xorg.conf
none
Xorg.0.log
none
glxinfo with LIBGL_ALWAYS_INDIRECT=1
none
backtrace none

Description Kusanagi Kouichi 2011-02-19 00:42:54 UTC
Created attachment 43544 [details]
testcase

Server crashes if attached testcase is run twice with LIBGL_ALWAYS_INDIRECT=1.
Backtrace is as follows:
0: X (xorg_backtrace+0x28) [0x460cd8]
1: X (0x400000+0x5d849) [0x45d849]
2: /lib/libpthread.so.0 (0x7fb43c216000+0xef60) [0x7fb43c224f60]
3: /usr/lib/xorg/modules/extensions/libdri2.so (DRI2WaitSwap+0x10) [0x7fb438987e10]
4: /usr/lib/xorg/modules/extensions/libglx.so (0x7fb4391a8000+0x40fb8) [0x7fb4391e8fb8]
5: /usr/lib/xorg/modules/extensions/libglx.so (0x7fb4391a8000+0x362ab) [0x7fb4391de2ab]
6: /usr/lib/xorg/modules/extensions/libglx.so (0x7fb4391a8000+0x3a4d6) [0x7fb4391e24d6]
7: /usr/lib/xorg/modules/extensions/libglx.so (0x7fb4391a8000+0x36882) [0x7fb4391de882]
8: X (0x400000+0x4b9e9) [0x44b9e9]
9: X (0x400000+0x24e5b) [0x424e5b]
10: /lib/libc.so.6 (__libc_start_main+0xfd) [0x7fb43af79c4d]
11: X (0x400000+0x249e9) [0x4249e9]
Segmentation fault at address 0x34
Comment 1 Kusanagi Kouichi 2011-02-19 00:44:31 UTC
Created attachment 43545 [details] [review]
Check the return value of DRI2GetDrawable.
Comment 2 Kusanagi Kouichi 2011-02-19 00:45:13 UTC
Created attachment 43546 [details]
xorg.conf
Comment 3 Kusanagi Kouichi 2011-02-19 00:45:36 UTC
Created attachment 43547 [details]
Xorg.0.log
Comment 4 Kusanagi Kouichi 2011-02-19 00:46:34 UTC
Created attachment 43548 [details]
glxinfo with LIBGL_ALWAYS_INDIRECT=1
Comment 5 Simon 2011-05-06 23:47:19 UTC
Created attachment 46413 [details]
backtrace
Comment 7 Jeremy Huddleston Sequoia 2011-10-11 01:25:47 UTC
Is this a regression?  What version did you first see this in?
Comment 8 Kirill A. Shutemov 2011-10-12 16:15:50 UTC
See the same proble on the last Debian sid. 

xserver-xorg-core 2:1.11.1-1
xserver-xorg-video-intel 2:2.16.0-1 
libgl1-mesa-dri 7.11-6

Program received signal SIGSEGV, Segmentation fault.
DRI2WaitSwap (client=0x5247df0, pDrawable=<optimized out>) at ../../../../hw/xfree86/dri2/dri2.c:783
	in ../../../../hw/xfree86/dri2/dri2.c
(gdb) #0  DRI2WaitSwap (client=0x5247df0, pDrawable=<optimized out>) at ../../../../hw/xfree86/dri2/dri2.c:783
        pPriv = 0x0
#1  0x00007f9d8003fc98 in __glXDRIcontextWait (baseContext=<optimized out>, cl=0x5247f28, error=0x7fff668e18bc) at ../../glx/glxdri2.c:290
No locals.
#2  0x00007f9d8003606c in __glXForceCurrent (cl=0x5247f28, tag=14680164, error=0x7fff668e18bc) at ../../glx/glxext.c:411
        cx = 0xa763af0
#3  0x00007f9d800398a6 in DoGetString (cl=0x5247f28, pc=0x533db70 "\232\201\003", need_swap=0 '\000') at ../../glx/single2.c:326
        client = <optimized out>
        cx = <optimized out>
        name = <optimized out>
        string = <optimized out>
        sw = <optimized out>
        error = 0
        buf = 0x0
        buf1 = 0x0
        length = 0
#4  0x00007f9d80035d69 in __glXDispatch (client=<optimized out>) at ../../glx/glxext.c:547
        rendering = <optimized out>
        stuff = 0x533db70
        opcode = <optimized out>
        proc = 0x7f9d80039aa0 <__glXDisp_GetString>
        cl = 0x5247f28
        retval = <optimized out>
#5  0x0000000000437ae9 in Dispatch () at ../../dix/dispatch.c:432
        clientReady = 0x30ebee0
        result = <optimized out>
        client = 0x5247df0
        nready = 0
        icheck = 0x7eadd0
        start_tick = 2780
#6  0x0000000000426eaa in main (argc=12, argv=<optimized out>, envp=<optimized out>) at ../../dix/main.c:287
        i = <optimized out>
        alwaysCheckForInput = {0, 1}
Comment 9 Adam Jackson 2018-06-13 17:03:56 UTC
Lots of DRI2 drawable lifetime fixes since then. Please reopen if you can still reproduce this with a current X server.

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.