Bug 13541

Summary: *_dri.so unloaded prematurely by nested open/close display calls
Product: Mesa Reporter: George Nassas <gnassas>
Component: GLXAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: git   
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: the fix

Description George Nassas 2007-12-05 17:43:46 UTC
When dri_glx.c:OpenDisplay is called for a driver that is already loaded the function returns a pointer to the library without incrementing its reference count. This can come from nested calls in one thread or from multiple threads within a process. Unfortunately the first close works its way down to the dlclose in driDestroyDisplay and the library is unloaded which invalidates other references to its contents.

The attached patch amends the function to bump the reference count for driver libraries before returning a pointer to them.
Comment 1 George Nassas 2007-12-05 17:45:26 UTC
Created attachment 12970 [details] [review]
the fix
Comment 2 Michel Dänzer 2007-12-06 01:21:47 UTC
Pushed to Git, thanks.
Comment 3 Adam Jackson 2009-08-24 12:28:33 UTC
Mass version move, cvs -> git

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.