[Mesa-dev] [PATCH] glx: load dri driver with RTLD_LOCAL so dlclose never fails to unload

Ian Romanick idr at freedesktop.org
Fri Feb 28 10:42:48 PST 2014


On 02/27/2014 11:52 PM, Eric Anholt wrote:
> j.glisse at gmail.com writes:
>
>> From: Jerome Glisse <jglisse at redhat.com>
>>
>> There is no reason anymore to load with RTLD_GLOBAL and for some driver
>> this even result in dlclose failing to unload leading to catastrophic
>> failure with swrast fallback.
>
> I don't remember the last time drivers relied on GL symbols being
> present -- we've been using _mesa_ prefixed stuff in meta for many
> years, for example.  I think this should be plenty safe.

It has been almost a decade... we started encountering apps that did 
things like

PFNGLGETBUFFERPOINTERVPROC glGetBufferPointerv;

in their code.  When we tried to call glGetBufferPointerv internally, we 
jumped to the function pointer in the application's data segment... and 
exploded.  That's when we added all the CALL_GetBufferPointerv type 
macros to directly call through the dispatch pointer instead.

> Reviewed-by: Eric Anholt <eric at anholt.net>

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

Should this be marked for 10.1 or even earlier stable?

> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev



More information about the mesa-dev mailing list