Skip to content

Commit 1da9d8a

Browse files
authored
[asan] Ignore vDSO on FreeBSD (#76223)
Most asan tests `FAIL` on FreeBSD 14.0/amd64 with ``` ==17651==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD. ``` With `ASAN_OPTIONS=verbosity=2` one sees: ``` ==4880==info->dlpi_name = [vdso] info->dlpi_addr = 0xffffe780 ==4880==info->dlpi_name = lib/clang/18/lib/freebsd/libclang_rt.asan-i386.so info->dlpi_addr = 0x2808a000 ``` Ignoring the vDSO as on Linux fixes this. Tested on `amd64-pc-freebsd14.0`.
1 parent 41ef6fc commit 1da9d8a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: compiler-rt/lib/asan/asan_linux.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@ static int FindFirstDSOCallback(struct dl_phdr_info *info, size_t size,
140140
internal_strncmp(info->dlpi_name, "linux-", sizeof("linux-") - 1) == 0)
141141
return 0;
142142
# endif
143+
# if SANITIZER_FREEBSD
144+
// Ignore vDSO.
145+
if (internal_strcmp(info->dlpi_name, "[vdso]") == 0)
146+
return 0;
147+
# endif
143148

144149
*name = info->dlpi_name;
145150
return 1;

0 commit comments

Comments
 (0)