Skip to content

Commit

Permalink
Run child process with ASAN_OPTIONS=verify_asan_link_order=0.
Browse files Browse the repository at this point in the history
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 ...".)
  • Loading branch information
bernhardu committed Aug 16, 2021
1 parent 3abd886 commit 5d5775e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/RecordSession.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2242,6 +2242,15 @@ static string lookup_by_path(const string& name) {
env.push_back("SYSTEMD_RDRAND=0");
}

#if defined(__SANITIZE_ADDRESS__)
// 1. This is needed to run the test suite with an ASan-instrumented rr
// because of rr's lack of support for children execing ASan binaries,
// and should be removed if/when rr gains such support.
// 2. This is specific to the case of running the test suite
// and isn't supposed to help with general usage.
env.push_back("ASAN_OPTIONS=verify_asan_link_order=0");
#endif

shr_ptr session(
new RecordSession(full_path, argv, env, disable_cpuid_features,
syscallbuf, syscallbuf_desched_sig, bind_cpu,
Expand Down

0 comments on commit 5d5775e

Please sign in to comment.