<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [PATCH] ralloc: atexit(3) handlers used in dlopened libraries"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=91869">91869</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[PATCH] ralloc: atexit(3) handlers used in dlopened libraries
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Mesa
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>10.6
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>FreeBSD
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>mesa-dev@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>dumbbell@FreeBSD.org
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>mesa-dev@lists.freedesktop.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=118072" name="attach_118072" title="Patch to use __attribute__((destructor)) in ralloc.c">attachment 118072</a> <a href="attachment.cgi?id=118072&action=edit" title="Patch to use __attribute__((destructor)) in ralloc.c">[details]</a></span>
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.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>