<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/135204>135204</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [libc][bug] c++abi tls dtors are not called on main thread exit
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          SchrodingerZhu
      </td>
    </tr>
</table>

<pre>
    ![Image](https://github.com/user-attachments/assets/6dafa5bf-353e-415d-8e24-d11760cb967b)

The above is the behavior of registered dtors on main thread exiting. As for `llvm-libc`, the dtors registered using `__cxa` hooks are never called.

Solution is being investigated at https://github.com/llvm/llvm-project/pull/133641
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUkr2O3CAUhZ_mukG2AIPtKVzMZGQp9aZKs-Ln2pBgswJsbd4-Gu9ESRFFSgUF5_LxcVTOftkQR5A3kPdK7cXFNL4Yl6L124Lpq9srHe2PETgDefu8qgVB3oEPrpS3DO0V-AR8Wnxxu25MXIFPe8ZUq1KUcStuJQOfVM54bjqrZiX1XLeyxVowaesBuagtY31Hjb50vQZ-AXoFev3ikCgdDyQ-k-KQaHTq8DGROJOEi88FE1piS0yZxI2sym-kuITKEnz3xW9LQ66ZzDER6GgIx1oHrw10FPinc-RH9o9he_bb8jj9-mreFXSUuBi_Z6ISkg0PTMSoENA2H4wvMezFx-2BqPER9duBufhFFbREFfIPUw-g51K_pfgNTQE-ve0hAJ9Y23aCVXZs7aW9qApH1gvRUiapqNzIBi7kIHot9YVSQdFY3SvO5lbiMHNT-ZFTLqlglHWMibZhsmcz9tZwpvvBIAiKq_KhedzfxLRUPucdR9ZKTkUVlMaQf3UjjSel3pcMggafS_6dK76Es0WnXHkHedP7AvJODPAb8JvSnpSQn7ZPlbE8Rf7t46o9hfG_xZ34-VR3vuAY-c8AAAD__4Eu7dk">