Skip to content

Commit c52e4d7

Browse files
committed
Run child process with ASAN_OPTIONS=verify_asan_link_order=0.
libasan.so checks if it is the first loaded shared library and exists if not. In some tests rr records another rr process which gets then as first library librrpage.so. Visible in tests: nested_detach nested_detach_kill nested_detach_wait ==1913200==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. (Fixes test not yet, all show then "... requested allocation size ... exceeds maximum ...".)
1 parent f8c949c commit c52e4d7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/RecordSession.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2408,6 +2408,15 @@ static string lookup_by_path(const string& name) {
24082408
env.push_back("SYSTEMD_RDRAND=0");
24092409
}
24102410

2411+
#if defined(__SANITIZE_ADDRESS__)
2412+
// 1. This is needed to run the test suite with an ASan-instrumented rr
2413+
// because of rr's lack of support for children execing ASan binaries,
2414+
// and should be removed if/when rr gains such support.
2415+
// 2. This is specific to the case of running the test suite
2416+
// and isn't supposed to help with general usage.
2417+
env.push_back("ASAN_OPTIONS=verify_asan_link_order=0");
2418+
#endif
2419+
24112420
shr_ptr session(
24122421
new RecordSession(full_path, argv, env, disable_cpuid_features,
24132422
syscallbuf, syscallbuf_desched_sig, bind_cpu,

0 commit comments

Comments
 (0)