<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/58993>58993</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Improve handling when symbolizer in sanitizers encounters an error
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
firewave
</td>
</tr>
</table>
<pre>
When the symbolizer for a sanitizer fails you get the following output:
```
==21350==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x615000645c81 at pc 0x7f1bc0bd635a bp 0x7fffd7025a50 sp 0x7fffd7025a48
WRITE of size 1 at 0x615000645c81 thread T0
LLVM ERROR: out of memory
Allocation failed
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: /usr/bin/llvm-symbolizer-14 --demangle --inlines --default-arch=x86_64
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamEi+0x31)[0x7f4fb0475a71]
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(_ZN4llvm3sys17RunSignalHandlersEv+0xee)[0x7f4fb04737be]
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(+0xea5fa6)[0x7f4fb0475fa6]
/lib/x86_64-linux-gnu/libc.so.6(+0x3daa0)[0x7f4faf01daa0]
/lib/x86_64-linux-gnu/libc.so.6(+0x8957c)[0x7f4faf06957c]
/lib/x86_64-linux-gnu/libc.so.6(raise+0x12)[0x7f4faf01da02]
/lib/x86_64-linux-gnu/libc.so.6(abort+0xcf)[0x7f4faf008469]
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(_ZN4llvm22report_bad_alloc_errorEPKcb+0x99)[0x7f4fb03aa809]
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(+0xe2f5e9)[0x7f4fb03ff5e9]
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(_ZN4llvm3sys2fs19readNativeFileToEOFEiRNS_15SmallVectorImplIcEEl+0x60)[0x7f4fb046b5b0]
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(+0xe140d1)[0x7f4fb03e40d1]
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(+0xe13fc0)[0x7f4fb03e3fc0]
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(+0xe1313f)[0x7f4fb03e313f]
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(_ZN4llvm12MemoryBuffer14getFileOrSTDINERKNS_5TwineEbb+0x123)[0x7f4fb03e2f53]
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(_ZN4llvm6object12createBinaryENS_9StringRefEPNS_11LLVMContextEb+0x49)[0x7f4fb1abbf89]
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(_ZN4llvm9symbolize14LLVMSymbolizer17getOrCreateObjectERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES9_+0x94)[0x7f4fb1da1514]
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(_ZN4llvm9symbolize14LLVMSymbolizer21getOrCreateObjectPairERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES9_+0x3c4)[0x7f4fb1da4004]
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(_ZN4llvm9symbolize14LLVMSymbolizer21getOrCreateModuleInfoERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x466)[0x7f4fb1da4886]
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(_ZN4llvm9symbolize14LLVMSymbolizer26symbolizeInlinedCodeCommonINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEENS_8ExpectedINS_14DIInliningInfoEEERKT_NS_6object16SectionedAddressE+0x3b)[0x7f4fb1da026b]
/usr/lib/x86_64-linux-gnu/libLLVM-14.so.1(_ZN4llvm9symbolize14LLVMSymbolizer20symbolizeInlinedCodeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEENS_6object16SectionedAddressE+0x9)[0x7f4fb1da0229]
/usr/bin/llvm-symbolizer-14[0x406402]
/usr/bin/llvm-symbolizer-14[0x405734]
/lib/x86_64-linux-gnu/libc.so.6(+0x2920a)[0x7f4faf00920a]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x7c)[0x7f4faf0092bc]
/usr/bin/llvm-symbolizer-14[0x40378a]
==21350==WARNING: Can't read from symbolizer at fd 11
```
If this occurs it would be great if it could at least report the non-symbolized trace. Currently it lacks any context on the error.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy9V8lu4zgQ_Zr4QtggtevgQxb1tDHZYBvdmL4IJEXZnJFEg6QSe75-ilRWpWdJ2j2BoUhF8VW9YpGqx1R1mH_dig7ZrUDm0DLVyD-FRrXSiCJDO2mHZyobgw6qRxth_cu1ahp1L7sNUr3d9fYkPD3BFyf48Zrgh9_wGF7ALyBhjIfbYrm8WcIcdFpVWhizenTlbFtBd1PW17XQU3UndA2ekOoQHd5FeJ-QGGOcRDHPCKIW7TgY05owjlmVhDFFbOctdV2lOIhpjJF5bYmyIbSvy8W6QKpGBtwjjzbCt1staIXWD1wuL79coaf4gb2b3IpW6cPwwilkhlMrIWKXN1EN5tvL4nRVINOzVlrILus3SIud0pBQhbbW7oxLYvAJfhtptz2bcdXCQ9PcPf6b7rT6XXALj9KYXhi4QbSrkOx401fCLw3X1GwRo_wPqykXs8H9yoIBVX27e1oqPEP-71arjaYtonrTt6KzLg4EyL3RcGWye_T-XCFTEqHptBIt7TaNgFvZNbITxhtr2jd2SjXfwkrvs6RMonEM6B4YutwNkKijLUw-CTLRmV4LX2pbeifQyC8QdWMa3Z6uPyOoUvNQj6K7k1p1Lnx0RzWC0nMLVa5-uzq7uVx8K5almwJml-2dkp1Pu4RU5s-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