<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/142987>142987</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Runtime abort in statically linked test
</td>
</tr>
<tr>
<th>Labels</th>
<td>
BOLT
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Rin18
</td>
</tr>
</table>
<pre>
I have a binary that results in a runtime crash after running bolt on it. The binary contains a simple test:
```
int main(int argc, char *argv[]) {
try {
throw 1;
} catch (int e) {
return 1;
}
return 0;
}
```
This was compiled with `g++ test.cpp -static -Lglibc.static/lib -o test.out`
Then bolting the binary with `llvm-bolt test.out -o test.out.bolt`. Running `test.out.bolt` results in `Aborted (core dumped)` with this stack trace:
```
#0 0x0000000000846da8 in __pthread_kill_implementation.constprop.0 ()
#1 0x000000000083b5dc in raise ()
#2 0x0000000000800278 in abort ()
#3 0x000000000080fab8 in uw_init_context_1 ()
#4 0x000000000080ff9c in _Unwind_RaiseException ()
#5 0x0000000000801cec in __cxa_throw ()
#6 0x000000000080002c in main ()
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxkVN2OszYQfRpzMwoyhvBzwUXSr5EqfVKl1fYaDcYBd41B9pDsvn1lSLpJ1ooU4znnzK-N3uveKlWz_ZHtf0W40DC5-k3bpIzaqfuq_4IBLwoQWm3RfQENSOCUXwx50BYQ3GJJjwqkQz8Ankm5cGa17aGdDMFkQVMM74O6i8jJEmrrAcHrcTYKSHli6YHxA8v57ccP2hKMqC0TZdii6yUTf4Ac0AETB3T9ZQuciQpYcWT8AOS-7tvbosFNV0hYej9kxS-QSHKAm7B64N-WU7Q4-8IKu5uBb4bt8DHm90F7uKIHOY2zNqqDq6YBWM57Jo5MHNdcYznPsPOEpCXsfvdGtzLePpk4Gd3CbtqA00J3YWXXgobC0ncx7_LGXMbdWvA771EjDhaW8xjebr1hOX81PjaW5fzQTo5UF6okJ6egW8ZZdUxUAbq6pZCsJ5QfQA6l-tlCJlIOwD_5_6vM8g7L4KJpZhqcwq750MY06ySMyoYqTDaWk_U0u2mOeYgguF3lkhe5tN13Msg51F49QcULlHNRrJ4xZPYETV-hZ2xX6HJttNXUhJlVn9QkT7TsB-1crcE0_9irtl3zFoL681OqOST1xN2_UBOpNmojP7HZpvYRn__IhouVEK7IA_Kh-lFXp12VVhipOimyKknztMqioc5kWXDZ5sm-Oie8KEssZJpWZVW1XVGkPNK14GLPc75P9kmaZHHbKlGkHM8pR6HKjmVcjahNHOYunlwfae8XVSeZqMoiMtgq49d3RYjj37_fmRDhhXH1NqdL71nGjfbkvxVIk1H12-1B2ZqkLWz3Ao35AqPth-rWqY4WZ-qBaPZh6sSJiVOvaVjaWE5juETmcv_bzW76V0li4rQG6Zk43eK81OK_AAAA__81R379">