Skip to content

Commit 76e6f7d

Browse files
authored
lua: work around LeakSanitizer internal errors (google#11804)
When using `-fanitize=address`, we consistently get spurious build failures on ARM64 due to some issue with the leak detection pass at the end of execution: ``` ==2413==AddressSanitizer: failed to intercept '__isoc99_printf' ==2413==AddressSanitizer: failed to intercept '__isoc99_sprintf' ==2413==AddressSanitizer: failed to intercept '__isoc99_snprintf' ==2413==AddressSanitizer: failed to intercept '__isoc99_fprintf' ==2413==AddressSanitizer: failed to intercept '__isoc99_vprintf' ==2413==AddressSanitizer: failed to intercept '__isoc99_vsprintf' ==2413==AddressSanitizer: failed to intercept '__isoc99_vsnprintf' ==2413==AddressSanitizer: failed to intercept '__isoc99_vfprintf' ==2413==AddressSanitizer: failed to intercept 'xdr_destroy' ==2413==AddressSanitizer: failed to intercept 'crypt' ==2413==AddressSanitizer: failed to intercept 'crypt_r' ==2413==AddressSanitizer: failed to intercept '__cxa_throw' ==2413==AddressSanitizer: failed to intercept '__cxa_rethrow_primary_exception' ==2413==AddressSanitizer: libc interceptors initialized || `[0x002000000000, 0x007fffffffff]` || HighMem || || `[0x001400000000, 0x001fffffffff]` || HighShadow || || `[0x001200000000, 0x0013ffffffff]` || ShadowGap || || `[0x001000000000, 0x0011ffffffff]` || LowShadow || || `[0x000000000000, 0x000fffffffff]` || LowMem || MemToShadow(shadow): 0x001200000000 0x00123fffffff 0x001280000000 0x0013ffffffff redzone=16 max_redzone=2048 quarantine_size_mb=256M thread_local_quarantine_size_kb=1024K ``` Note, it does not happen for me locally and on AWS Graviton 2 using the same build-with command line. Related to google#11798 Related to google/sanitizers#723 Related to ligurio/lua-c-api-tests#72
1 parent 0518518 commit 76e6f7d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

projects/lua/build.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ esac
6565

6666
export LSAN_OPTIONS="verbosity=1:log_threads=1"
6767

68+
# Workaround for a LeakSanitizer crashes,
69+
# see https://github.com/google/oss-fuzz/issues/11798.
70+
if [ "$ARCHITECTURE" = "aarch64" ]; then
71+
export ASAN_OPTIONS=detect_leaks=0
72+
fi
73+
6874
: ${LD:="${CXX}"}
6975
: ${LDFLAGS:="${CXXFLAGS}"} # to make sure we link with sanitizer runtime
7076

0 commit comments

Comments
 (0)