ubpf
ubpf copied to clipboard
bpf_conformance/arm64 should run with address sanitizer enabled
Address sanitizer is failing when run under qemu for arm64 emulation.
Until this is resolved, ubsan is disabled for arm64.
==4232==LeakSanitizer has encountered a fatal error. ==4232==HINT: For debugging, try setting environment variable LSAN_OPTIONS=verbosity=1:log_threads=1
Running these tests with the sanitizers on native Arm64 platforms (macOS 12 & Ubuntu 20.04) does not seem to trigger the same issues. So I wonder if its a QEmu problem - I will investigate further as I get time.
An alternative solution would be to self-host an Arm64 runner which can be used by the actions to run tests. I'll investigate to see if I can get one setup - but this may take some time. If anyone else can get one setup that would also be fine from my PoV.
Have now reproduced this myself:
matgre01@matgre01-linux-vm:~/ubpf$ LSAN_OPTIONS=verbosity=1:log_threads=1 ./build/bin/bpf_conformance_runner --test_file_directory tests --plugin_path aarch64_test/run-jit.sh --plugin_options --interpret
==19768==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
malloc_context_size=30
SHADOW_SCALE: 3
SHADOW_GRANULARITY: 8
SHADOW_OFFSET: 0x1000000000
This suggests that this is indeed a Sanitizers don't work under QEmu problem.
It looks like having an Arm64 runner is the way forward.
Blocked on availability of an ARM64 self-hosted runner.