[Mesa-dev] [Bug 91869] [PATCH] ralloc: atexit(3) handlers used in dlopened libraries

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Sep 3 11:24:00 PDT 2015


https://bugs.freedesktop.org/show_bug.cgi?id=91869

            Bug ID: 91869
           Summary: [PATCH] ralloc: atexit(3) handlers used in dlopened
                    libraries
           Product: Mesa
           Version: 10.6
          Hardware: Other
                OS: FreeBSD
            Status: NEW
          Severity: normal
          Priority: medium
         Component: Other
          Assignee: mesa-dev at lists.freedesktop.org
          Reporter: dumbbell at FreeBSD.org
        QA Contact: mesa-dev at lists.freedesktop.org

Created attachment 118072
  --> https://bugs.freedesktop.org/attachment.cgi?id=118072&action=edit
Patch to use __attribute__((destructor)) in ralloc.c

Hi!

On Linux, atexit(3) handlers are called when the program exits but also when a
library is unloaded. The latter behavior is a Glibc extension.

On systems where this extension is not supported, this causes an application to
crash when, for instance, a library using ralloc is dlclosed: at program exit,
the registered function is no longer in memory. For example, this happens with
OpenCL applications using an ICD loader on FreeBSD.

__attribute__((destructor)) fixes the problem because such handlers are called
when a library is unloaded and when the program exits.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150903/2be04ff6/attachment.html>


More information about the mesa-dev mailing list