Skip to content

Commit 5d5775e

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 3abd886 commit 5d5775e

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
@@ -2242,6 +2242,15 @@ static string lookup_by_path(const string& name) {
22422242
env.push_back("SYSTEMD_RDRAND=0");
22432243
}
22442244

2245+
#if defined(__SANITIZE_ADDRESS__)
2246+
// 1. This is needed to run the test suite with an ASan-instrumented rr
2247+
// because of rr's lack of support for children execing ASan binaries,
2248+
// and should be removed if/when rr gains such support.
2249+
// 2. This is specific to the case of running the test suite
2250+
// and isn't supposed to help with general usage.
2251+
env.push_back("ASAN_OPTIONS=verify_asan_link_order=0");
2252+
#endif
2253+
22452254
shr_ptr session(
22462255
new RecordSession(full_path, argv, env, disable_cpuid_features,
22472256
syscallbuf, syscallbuf_desched_sig, bind_cpu,

0 commit comments

Comments
 (0)