Bug 13541 - *_dri.so unloaded prematurely by nested open/close display calls
Summary: *_dri.so unloaded prematurely by nested open/close display calls
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: GLX (show other bugs)
Version: git
Hardware: All Linux (All)
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-05 17:43 UTC by George Nassas
Modified: 2009-08-24 12:28 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
the fix (1.63 KB, patch)
2007-12-05 17:45 UTC, George Nassas
Details | Splinter Review

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.