Bug 11010

Summary: [r300] lock Xserver by moving window
Product: Mesa Reporter: Jacek Poplawski <jacekpoplawski>
Component: Drivers/DRI/r300Assignee: Default DRI bug account <dri-devel>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: xorg.conf
Xorg.log
very simple testcase

Description Jacek Poplawski 2007-05-20 20:42:55 UTC
I am able to lock Xserver on r300 and current Mesa in few easy steps:

1) start my application
2) move window application with mouse
3) quit the application

Application renders one frame - few textured rectangles, then waits for key.
If I disable rendering or if I won't move window with mouse - application closes correctly.

I was able to use gdb from second machine.
First, Xserver (I needed to use ctrl+c):

#0  0xb7f91410 in __kernel_vsyscall ()
#1  0xb7e30179 in ioctl () from /lib/libc.so.6
#2  0xb7befa55 in drmGetLock () from /usr/lib/libdrm.so.2
#3  0xb7f8287f in DRILock () from /usr/lib/xorg/modules/extensions//libdri.so
#4  0xb7f828fa in DRIDoWakeupHandler ()
   from /usr/lib/xorg/modules/extensions//libdri.so
#5  0xb7f8186e in DRIWakeupHandler ()
   from /usr/lib/xorg/modules/extensions//libdri.so
#6  0x0808a535 in WakeupHandler ()
#7  0x0819a114 in WaitForSomething ()
#8  0x08086621 in Dispatch ()
#9  0x0806e579 in main ()

Then top of my application backtrace:

#0  0xb7790ead in radeonGetLock (radeon=0x807a670, flags=0) at radeon_lock.c:62
#1  0xb77993ad in r300FlushCmdBuf (r300=0x807a670,
    caller=0xb78f54e6 "r300FreeGartAllocations") at r300_cmdbuf.c:117
#2  0xb779653f in r300DestroyContext (driContextPriv=0x80734e0)
    at r300_context.c:402
#3  0xb778eb9d in radeonDestroyContext (driContextPriv=0x0)
    at radeon_screen.c:933
#4  0xb778b2d7 in driDestroyContext (dpy=0x80518a8, scrn=0,
    contextPrivate=0x80734e0) at ../common/dri_util.c:751
#5  0xb7d30493 in DestroyContext () from /usr/lib/libGL.so.1
#6  0xb7dad312 in X11_GL_Shutdown () from /usr/lib/libSDL-1.2.so.0
#7  0xb7db1aa7 in X11_DestroyWindow () from /usr/lib/libSDL-1.2.so.0
#8  0xb7db1cc3 in X11_VideoQuit () from /usr/lib/libSDL-1.2.so.0
#9  0xb7da067e in SDL_VideoQuit () from /usr/lib/libSDL-1.2.so.0
#10 0xb7d74465 in SDL_QuitSubSystem () from /usr/lib/libSDL-1.2.so.0
#11 0xb7d744de in SDL_Quit () from /usr/lib/libSDL-1.2.so.0

From glxinfo:
OpenGL vendor string: DRI R300 Project
OpenGL renderer string: Mesa DRI R300 20060815 AGP 4x x86/MMX+/3DNow!+/SSE2 TCL
OpenGL version string: 1.3 Mesa 6.5.3

From .drirc:
<driconf>
    <device screen="0" driver="r300">
        <application name="Default">
            <option name="force_s3tc_enable" value="false" />
            <option name="texture_coord_units" value="8" />
            <option name="fthrottle_mode" value="2" />
            <option name="no_rast" value="false" />
            <option name="tcl_mode" value="3" />
            <option name="texture_depth" value="0" />
            <option name="disable_s3tc" value="false" />
            <option name="def_max_anisotropy" value="1.0" />
            <option name="command_buffer_size" value="8" />
            <option name="round_mode" value="0" />
            <option name="dither_mode" value="0" />
            <option name="disable_lowimpact_fallback" value="true" />
            <option name="texture_image_units" value="8" />
            <option name="no_neg_lod_bias" value="false" />
            <option name="color_reduction" value="1" />
            <option name="vblank_mode" value="1" />
        </application>
    </device>
</driconf>
Comment 1 Jacek Poplawski 2007-05-20 20:45:35 UTC
Created attachment 10048 [details]
xorg.conf
Comment 2 Jacek Poplawski 2007-05-20 20:47:27 UTC
Created attachment 10049 [details]
Xorg.log
Comment 3 Jacek Poplawski 2007-05-20 21:00:45 UTC
Created attachment 10050 [details]
very simple testcase

I was able to write a simple testcase. I render only one textured quad, don't initialize texture at all.
Compile with: g++ `sdl-config --cflags --libs` testcase.cc -lGL
Run, move window, hit escape.
Comment 4 Jacek Poplawski 2007-05-20 21:13:31 UTC
I tried to repeat lock in glxinfo, Blender, Neverball and xmoto, but failed.
However, I was able to achieve that in foobillard.

Then I installed older version of driver from my distribution, and looks like problem disappeared.
Probably bug exist only in Mesa 6.5.3.

Now I have:

OpenGL vendor string: Tungsten Graphics, Inc.
OpenGL renderer string: Mesa DRI R300 20060815 AGP 4x x86/MMX+/3DNow!+/SSE2 TCL
OpenGL version string: 1.3 Mesa 6.5.2
Comment 5 Michel Dänzer 2007-05-20 23:44:06 UTC
(In reply to comment #4)
> Probably bug exist only in Mesa 6.5.3.

Can you try isolating it further with git-bisect?

Looks like the r300 driver tries to get the DRM lock when it already has it. Killing the app should resume normal operation, doesn't it?
Comment 6 Maciej Cencora 2009-05-02 14:02:29 UTC
Closing due to lack of feedback.

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.