Closed
Description
Running https://github.com/rust-lang/rust/blob/master/src/test/ui/sanitizer-memory.rs under -C lto=fat
, the test segfaults with:
==11725==ERROR: MemorySanitizer: SEGV on unknown address 0x3ffe4b748058 (pc 0x5567fb27ac91 bp 0x000000000000 sp 0x7ffe4b747fe0 T11725)
==11725==The signal is caused by a READ memory access.
#0 0x5567fb27ac90 in xor (/home/nikic/rust/sanitizer-memory+0x63c90)
#1 0x5567fb27b19d in main (/home/nikic/rust/sanitizer-memory+0x6419d)
#2 0x7f37be59cb96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
#3 0x5567fb21eff9 in _start (/home/nikic/rust/sanitizer-memory+0x7ff9)
I ran into this in #67759, because as of LLVM 10 the same happens with ThinLTO as well.
This issue is that __msan
symbols gets internalized and DCEd, as they are not part of the exported symbol list.