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

    <tr>
        <th>Summary</th>
        <td>
            Double-free of exported global string on program exit
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang:modules,
            crash
      </td>
    </tr>

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

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

<pre>
    The following code is a reduction of a c++20 module application that crashes.
The easiest way to reproduce the crash is by using ASAN. 
When the application terminates, it gives a double-free error.

data.cppm
```
module;
#include <string> 
export module data;
export std::string global;
```
main.cpp
```
import data;
int main() { global = "A long string that does not fit in the SSO buffer"; }
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsUsuOnDAQ_BpzaS0yNjMMBw7zyByTw0ZKrsZuwJGxiR_7-PvIwGaz0UoIhN1dVd1VIgQ9WsSOHC6EseuUhP2tf6aWMEYOt0KkODnfzc4rYSMWvVOv3fcJYXDGuGdtR5BOIegAAjyqJKN2FtwAAiRhF8IujMLsVDIIYlmMlmKtiJOIIL0IE4aS0Buh5wyLImgMEZ7FK0QHHhfvVJIIccKtPFP1r5BC5j4_nr-WsLX_mNCuZR9o0M_aioiBsCvoCKN-wqxVudQbfBg8IqD3zu8itrcSUZRyWeb98Ej3Z_3dxiH8st8yrq00SSEQfg3RazsS_mWXhS-L8_FtBRn4b-N-FaIi_Ez4eWuF0bhemHf4_8iFtlnap5d6XhE_sGgbITcRdiKsBdJcdgYg_AaEsTMYZ0fY2VdjlMMA1kUYdAS9rfXx8Rv0aRjQ52zwC5Dm9qmIQnVctbwVBXbVsWF1WzWUFlMnm3qgJ2yFPNWnGrGpaYWUNceaMqn4qdAdo4xVjFcVpxVvy5oqrFhfCUkPVCpKaoqz0KY05mkunR8LHULC7tA2x0NhRI8m7FGWRmQbdrNC1syu-TyHaE-37zLOQ5_GQGpqdIjhHTnqaLC7_ZMTN8BmGaq3Fe5LcxYW70YvZsAXHYvkTTfFuIRsLLsTdh91nFJfSjcTds8c--dh8e4XykjYfR0lEHZfp_kTAAD__2CvIBY">