Hi,

I am having hard time fixing a DRI related bug: radeon driver gets MakeCurrent 
calls with drawable->driverPrivate being null, which ends up dereferencing 
null pointer.

Software I'm using:
dri2proto - current master
Xserver - 1b1b20d6e3e696e4437a9ef56128cde70a485f66
mesa - current radeon-rewrite branch

The testing app is Painkiller game run under Wine, but I can reproduce it also 
with mesa/progs/xdemos/glxcontexts.

I have added some printfs to better visualize the problem. Here's the output:

driCreateNewContext: context 0x7c475fc0, drawable (nil)
radeonCreateBuffer: new buffer 0x7c3b4fe8
driCreateNewDrawable: drawable 0x7c3b4f78, driverPriv 0x7c3b4fe8, context 
0x7c476184
dri_get_drawable: drawable 0x7c3b4f78, driverPrivate 0x7c3b4fe8, context 
0x7c475fc0, refcount 1
__driUtilUpdateDrawableInfo: context 0x7c475fc0, drawable 0x7c3b4f78, 
drierPriv 0x7c3b4fe8
radeonMakeCurrent: dricontext 0x7c475fc0, drawable 0x7c3b4f78, driverPriv 
0x7c3b4fe8
dri_put_drawable: drawable 0x7c3b4f78, driverPrivate 0x7c3b4fe8, context 
0x7c475fc0, refcount 2
driDestroyContext: context 0x7c475fc0, drawable 0x7c3b4f78

driCreateNewContext: context 0x7c3b5500, drawable (nil)
radeonCreateBuffer: new buffer 0x7c2b3d40
driCreateNewDrawable: drawable 0x7c2b3cd0, driverPriv 0x7c2b3d40, context 
0x7c476184
dri_get_drawable: drawable 0x7c2b3cd0, driverPrivate 0x7c2b3d40, context 
0x7c3b5500, refcount 1
__driUtilUpdateDrawableInfo: context 0x7c3b5500, drawable 0x7c2b3cd0, 
drierPriv 0x7c2b3d40
radeonMakeCurrent: dricontext 0x7c3b5500, drawable 0x7c2b3cd0, driverPriv 
0x7c2b3d40
dri_put_drawable: drawable 0x7c2b3cd0, driverPrivate 0x7c2b3d40, context 
0x7c3b5500, refcount 2
driDestroyContext: context 0x7c3b5500, drawable 0x7c2b3cd0

driCreateNewContext: context 0x7c476840, drawable (nil)
radeonCreateBuffer: new buffer 0x7c2b2828
driCreateNewDrawable: drawable 0x7c2b27b8, driverPriv 0x7c2b2828, context 
0x7c476184
dri_get_drawable: drawable 0x7c2b27b8, driverPrivate 0x7c2b2828, context 
0x7c476840, refcount 1
__driUtilUpdateDrawableInfo: context 0x7c476840, drawable 0x7c2b27b8, 
drierPriv 0x7c2b2828
radeonMakeCurrent: dricontext 0x7c476840, drawable 0x7c2b27b8, driverPriv 
0x7c2b2828
dri_put_drawable: drawable 0x7c2b27b8, driverPrivate 0x7c2b2828, context 
0x7c476840, refcount 2
driDestroyContext: context 0x7c476840, drawable 0x7c2b27b8

driDestroyDrawable: drawable 0x7c2b3cd0, driverPrivate (nil), context 
0x7c3b5500, refcount 1
dri_put_drawable: drawable 0x7c2b3cd0, driverPrivate (nil), context 
0x7c3b5500, refcount 1

driCreateNewContext: context 0x7c3b6030, drawable (nil)
dri_get_drawable: drawable 0x7c2b27b8, driverPrivate (nil), context 
0x7c3b6030, refcount 1
radeonMakeCurrent: dricontext 0x7c3b6030, drawable 0x7c2b27b8, driverPriv 
(nil)

segfault...

As you can see 4 contexts are created. Why there's no driDestroyDrawable call 
for drawable created for 1st and 3rd context? Why after creating 4th context 
there's a call to get drawable created for 3rd context (which is already 
destroyed)? Is this legal behavior?

Any suggestions what may be happening there? I think the bug is in radeon 
driver because it doesn't happen with software rendering.

Regards,
Maciej Cencora

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to