Open
Description
It looks like C++ exceptions are broken when using MSan with libcxx. Here is the minimum test program:
#include <iostream>
int main(int argc, char **argv)
{
try {
std::cout << "Testing C++ exception...\n";
throw std::runtime_error("boo");
} catch(std::exception &ex) {
std::cout << "Exception worked! (" << ex.what() << ")\n";
}
return 0;
}
Output:
Testing C++ exception...
MemorySanitizer:DEADLYSIGNAL
==3740922==ERROR: MemorySanitizer: stack-overflow on address 0x7ffe51dc5c38 (pc 0x7fde6dc661fc bp 0x7ffe51dc60a0 sp 0x7ffe51dc5c40 T3740922)
MemorySanitizer:DEADLYSIGNAL
MemorySanitizer: nested bug in the same thread, aborting.
Linkage:
$ ldd test | grep llvm
libc++.so.1 => /opt/llvm-18/lib-msan/libc++.so.1 (0x00007fee9257d000)
libc++abi.so.1 => /opt/llvm-18/lib-msan/libc++abi.so.1 (0x00007fee922c8000)
libunwind.so.1 => /opt/llvm-18/lib-msan/libunwind.so.1 (0x00007fee920ab000)