<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/73837>73837</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[msan][aarch64][llvm-libunwind] Unwinder fails on ARM Msan builds
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
vitalybuka
</td>
</tr>
</table>
<pre>
Extracted from discussion in https://github.com/llvm/llvm-project/pull/72543
Full reproducer requires build setup like https://github.com/google/sanitizers/wiki/SanitizerBotReproduceBuild with zorg/buildbot/builders/sanitizers/buildbot_bootstrap_msan.sh
ninja -C /b/my/build/libcxx_build_msan/ check-cxx will fail format tests
if we rerun some of them: `MSAN_OPTIONS=fast_unwind_on_fatal=1:handle_abort=1:external_symbolizer_path=llvm_build0/bin/llvm-symbolizer`
The stacks below looks like exception handler can not be found.
This happens only on aarch64 Msan on Linux
```
/b/my/build/libcxx_build_msan/test/std/utilities/format/format.functions/Output/vformat.locale.pass.cpp.dir/t.tmp.exe
libc++abi: terminating due to uncaught exception of type std::__1::format_error: The argument index value is too large for the number of arguments supplied
MemorySanitizer:DEADLYSIGNAL
==1128068==ERROR: MemorySanitizer: ABRT on unknown address 0x03e700113684 (pc 0xffffbedf03f0 bp 0xffffce972130 sp 0xffffce972130 T1128068)
#0 0xffffbedf03f0 in __pthread_kill_implementation nptl/pthread_kill.c:44:76
#1 0xffffbedaa1e8 in raise signal/../sysdeps/posix/raise.c:26:13
#2 0xffffbed96af8 in abort stdlib/abort.c:79:7
#3 0xffffbf0bdd54 in abort_message abort_message.cpp
#4 0xffffbf06f588 in demangling_terminate_handler() cxa_default_handlers.cpp
#5 0xffffbf0bc558 in std::__terminate(void (*)()) cxa_handlers.cpp
#6 0xffffbf0c37e0 in __cxxabiv1::failed_throw(__cxxabiv1::__cxa_exception*) cxa_exception.cpp
#7 0xffffbf0c370c in __cxa_throw (/b/my/build/libcxx_build_msan/lib/libc++abi.so.1+0x8370c)
#8 0xaaaacf59e1d8 in std::__1::__throw_format_error[abi:ne180000](char const*) /b/my/build/libcxx_build_msan/include/c++/v1/__format/format_error.h:43:3
#9 0xaaaacf5a1148 in auto char const* std::__1::__format::__handle_replacement_field[abi:ne180000]<char const*, std::__1::basic_format_parse_context<char>, std::__1::basic_format_context<std::__1::back_insert_iterator<std::__1::__format::__output_buffer<char>>, char>>(char const*, char const*, std::__1::basic_format_parse_context<char>&, std::__1::basic_format_context<std::__1::back_insert_iterator<std::__1::__format::__output_buffer<char>>, char>&)::'lambda'(char const*)::operator()<std::__1::monostate>(char const*) const /b/my/build/libcxx_build_msan/include/c++/v1/__format/format_functions.h:277:13
#10 0xaaaacf5a10d8 in decltype(std::declval<char const*>()(std::declval<std::__1::monostate&>())) std::__1::__invoke[abi:ne180000]<char const* std::__1::__format::__handle_replacement_field[abi:ne180000]<char const*, std::__1::basic_format_parse_context<char>, std::__1::basic_format_context<std::__1::back_insert_iterator<std::__1::__format::__output_buffer<char>>, char>>(char const*, char const*, std::__1::basic_format_parse_context<char>&, std::__1::basic_format_context<std::__1::back_insert_iterator<std::__1::__format::__output_buffer<char>>, char>&)::'lambda'(char const*), std::__1::monostate&>(char const*&&, std::__1::monostate&) /b/my/build/libcxx_build_msan/include/c++/v1/__type_traits/invoke.h:344:25
#11 0xaaaacf5a0528 in std::__1::invoke_result<char const*, std::__1::monostate&>::type std::__1::invoke[abi:ne180000]<char const* std::__1::__format::__handle_replacement_field[abi:ne180000]<char const*, std::__1::basic_format_parse_context<char>, std::__1::basic_format_context<std::__1::back_insert_iterator<std::__1::__format::__output_buffer<char>>, char>>(char const*, char const*, std::__1::basic_format_parse_context<char>&, std::__1::basic_format_context<std::__1::back_insert_iterator<std::__1::__format::__output_buffer<char>>, char>&)::'lambda'(char const*), std::__1::monostate&>(char const*&&, std::__1::monostate&) /b/my/build/libcxx_build_msan/include/c++/v1/__functional/invoke.h:30:12
#12 0xaaaacf59f1d0 in decltype(auto) std::__1::__visit_format_arg[abi:ne180000]<char const* std::__1::__format::__handle_replacement_field[abi:ne180000]<char const*, std::__1::basic_format_parse_context<char>, std::__1::basic_format_context<std::__1::back_insert_iterator<std::__1::__format::__output_buffer<char>>, char>>(char const*, char const*, std::__1::basic_format_parse_context<char>&, std::__1::basic_format_context<std::__1::back_insert_iterator<std::__1::__format::__output_buffer<char>>, char>&)::'lambda'(char const*), std::__1::basic_format_context<std::__1::back_insert_iterator<std::__1::__format::__output_buffer<char>>, char>>(char const*&&, std::__1::basic_format_arg<std::__1::basic_format_parse_context<char>>) /b/my/build/libcxx_build_msan/include/c++/v1/__format/format_arg.h:103:12
#13 0xaaaacf59e6a0 in char const* std::__1::__format::__handle_replacement_field[abi:ne180000]<char const*, std::__1::basic_format_parse_context<char>, std::__1::basic_format_context<std::__1::back_insert_iterator<std::__1::__format::__output_buffer<char>>, char>>(char const*, char const*, std::__1::basic_format_parse_context<char>&, std::__1::basic_format_context<std::__1::back_insert_iterator<std::__1::__format::__output_buffer<char>>, char>&) /b/my/build/libcxx_build_msan/include/c++/v1/__format/format_functions.h:274:5
#14 0xaaaacf597f78 in std::__1::basic_format_context<std::__1::back_insert_iterator<std::__1::__format::__output_buffer<char>>, char>::iterator std::__1::__format::__vformat_to[abi:ne180000]<std::__1::basic_format_parse_context<char>, std::__1::basic_format_context<std::__1::back_insert_iterator<std::__1::__format::__output_buffer<char>>, char>>(std::__1::basic_format_parse_context<char>&&, std::__1::basic_format_context<std::__1::back_insert_iterator<std::__1::__format::__output_buffer<char>>, char>&&) /b/my/build/libcxx_build_msan/include/c++/v1/__format/format_functions.h:315:13
#15 0xaaaacf5978d4 in T std::__1::__vformat_to[abi:ne180000]<std::__1::back_insert_iterator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, char, std::__1::back_insert_iterator<std::__1::__format::__output_buffer<char>>>(T, std::__1::locale, std::__1::basic_string_view<T0, std::__1::char_traits<T0>>, std::__1::basic_format_args<std::__1::basic_format_context<std::__1::back_insert_iterator<std::__1::__format::__output_buffer<char>>, T0>>) /b/my/build/libcxx_build_msan/include/c++/v1/__format/format_functions.h:552:5
#16 0xaaaacee00624 in std::__1::back_insert_iterator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>> std::__1::vformat_to[abi:ne180000]<std::__1::back_insert_iterator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>(std::__1::back_insert_iterator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, std::__1::locale, std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::basic_format_args<std::__1::basic_format_context<std::__1::back_insert_iterator<std::__1::__format::__output_buffer<char>>, char>>) /b/my/build/libcxx_build_msan/include/c++/v1/__format/format_functions.h:562:10
#17 0xaaaacee00624 in std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> std::__1::vformat[abi:ne180000]<void>(std::__1::locale, std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::basic_format_args<std::__1::basic_format_context<std::__1::back_insert_iterator<std::__1::__format::__output_buffer<char>>, char>>) /b/my/build/libcxx_build_msan/include/c++/v1/__format/format_functions.h:597:3
#18 0xaaaacee00624 in auto $_1::operator()<char>(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::basic_string_view<char, std::__1::char_traits<char>>) const /b/my/build/llvm-project/libcxx/test/std/utilities/format/format.functions/vformat.locale.pass.cpp:42:7
#19 0xaaaacedea6b0 in void format_tests<char, (execution_modus)1, $_0, $_1>($_0, $_1) /b/my/build/llvm-project/libcxx/test/std/utilities/format/format.functions/format_tests.h:3148:3
#20 0xaaaacede80d0 in main /b/my/build/llvm-project/libcxx/test/std/utilities/format/format.functions/vformat.locale.pass.cpp:54:3
#21 0xffffbed96dbc in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#22 0xffffbed96e94 in __libc_start_main csu/../csu/libc-start.c:360:3
#23 0xaaaaced5a02c in _start (/b/my/build/libcxx_build_msan/test/std/utilities/format/format.functions/Output/vformat.locale.pass.cpp.dir/t.tmp.exe+0x10a02c)
MemorySanitizer can not provide additional info.
SUMMARY: MemorySanitizer: ABRT nptl/pthread_kill.c:44:76 in __pthread_kill_implementation
==1128068==ABORTING
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWl1z26jX_zTkhqkHgWTLF7lw6npnZ5r2mTR7sVcaBMhmg0EPIMfZT_8fkGTLjt26u2k3u5OZTiokzvv5HcAc6pxcaiGuQXYDsvkVbfzK2OuN9FQ9lc0DvSoNf7r-sPWWMi84rKxZQy4da5yTRkOp4cr72gEyA3gB8GIp_aopR8ysAV4oten_e1db84dgHuBF3SgF8GKCs5QANAdo1v5dNEpBK2preMOEhVb8fyOtcLBspOLQCd_UUMkH8TWRS2OWSgC8cFRLL_8U1gG8eJQPEuDFl_7djfF3vaCbyP1R-hX809glwIsorzS-f2x5HDDspxSlMd55S-ti7ageudXQIi31HxS-ew8DBcCL9VNPGrwiS7bdFnEYiQFeQLYS7OEd227ho1QKVlQqWBm7ph564bwbcpcVfBTQCtto6MxaQFNBvxJrQGYQjNHtl9mn4vP_3f_6-dMXQOYVdb5o9KPUvDC6qKinCpB5AshsRTVXoqClsb57JbZeWE1V4Z7WpVHB7KKmfgXIPESz1RoFa6TuI7yfCsYIDjW9XwnoPGUPDpZCmUeojHlwbSzFlonah1xq1bCQUQ218bAUsDKN5qOeiXRwRetaaAeNVk_QaEipZatxCm8d1WH8UepmOxQNxqj71w4vDERwdoi5DxMaL5X0UoTAt8HYPYyqRrOgffj2ufF1E75tuo_KMKrEqKbOjVhdj7i0gffIr-uR2IpWpSAe4BuAb2gpQ-y8sGupqZd6CXkjoDew0Yw2y5UfeCsE-6kOfuUBCWRWFEn70AovhLXGBn7B-9Qum7XQHkrNxRZuqGoElA56Y6CidhlcbUP2QN2sS2ED-57GQdfUtZKCtwrfirWxTzssATKbf5jNP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