glibc >= 2.33 uses shared functions for stat family functions.
D111984 added support for non-64 bit variants but they
do not appear to be enough as we have been noticing msan
errors on 64-bit stat variants on Chrome OS.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I am noticing a unit tests error with this change for glob_altdirfunc.cpp file but not sure how to resolve it.
MemorySanitizer:DEADLYSIGNAL ==3854677==ERROR: MemorySanitizer: SEGV on unknown address 0x000000000000 (pc 0x000000000000 bp 0x7ffeeab8eb60 sp 0x7ffeeab8eb28 T3854677) ==3854677==Hint: pc points to the zero page. ==3854677==The signal is caused by a READ memory access. ==3854677==Hint: address points to the zero page. #0 0x0 (<unknown module>) #1 0x449cef (compiler-rt/test/msan/X86_64/Linux/Output/glob_altdirfunc.cpp.tmp+0x449cef) #2 0x4433e5 (compiler-rt/test/msan/X86_64/Linux/Output/glob_altdirfunc.cpp.tmp+0x4433e5) #3 0x44370a (/compiler-rt/test/msan/X86_64/Linux/Output/glob_altdirfunc.cpp.tmp+0x44370a) #4 0x7f0f777021ff (/lib/x86_64-linux-gnu/libpthread.so.0+0x131ff) (BuildId: 54322f9a621b22e9ea3a4a96b6692f7a0f931b2d)
to avoid crash you need:
INIT_STAT64;
INIT_LSTAT64;
around sanitizer_common_interceptors.inc:10554
can you please add corresponding tests similar to
llvm-project/compiler-rt/test/sanitizer_common/TestCases/Posix/lstat.cpp
llvm-project/compiler-rt/test/msan/fstat.cpp
compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h | ||
---|---|---|
468–471 | Just SANITIZER_INTERCEPT_STAT64 should be enough for now |
also fstat?