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@lists.freedesktop.org
          Reporter: dumbb...@freebsd.org
        QA Contact: mesa-dev@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.
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to