When dlvsym fails (because the requested symbol does not exist), it
might call malloc and crash with LSAN. Fixes regression in r334363.
Details
- Reviewers
vitalybuka kcc jakubjelinek
Diff Detail
Event Timeline
lib/sanitizer_common/sanitizer_linux_libcdep.cc | ||
---|---|---|
189 | Why this hunk? This will unnecessary forever pessimize sanitizers built against glibc 2.27+. |
lib/sanitizer_common/sanitizer_linux_libcdep.cc | ||
---|---|---|
189 | Only 32-bit builds are affected and the overhead is neglible as InitTlsSize is called only *once* per process. The advantage of this dynamic approach is that 32-bit programs can still be copied to a different OS with older glibc and execute without *unconditionally* crashing. The previous code used dlvsym to perform the version check, but as I now call gnu_get_libc_version directly for GNU libc in D48254, its overhead is pretty small. Given these circumstances, I think it is reasonable to unconditionally check the version. If you are interested in some numbers, |
Superseded by https://reviews.llvm.org/D48265
I still think it would be worth doing the unconditional check on x86 though, but it's a minor issue so I'll defer it.
Why this hunk? This will unnecessary forever pessimize sanitizers built against glibc 2.27+.