Skip to content

Commit 4f90a93

Browse files
committed
ASan: Run with verify_asan_link_order=0.
Avoids error message: 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. Affected tests: nested_detach nested_detach_kill nested_detach_kill_stuck nested_detach_wait
1 parent 002528b commit 4f90a93

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/main.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,13 @@ size_t saved_argv0_space() {
234234
using namespace rr;
235235

236236
int main(int argc, char* argv[]) {
237+
238+
#ifdef __SANITIZE_ADDRESS__
239+
if (getenv("ASAN_OPTIONS") == NULL) {
240+
setenv("ASAN_OPTIONS", "verify_asan_link_order=0", 1);
241+
}
242+
#endif
243+
237244
rr::saved_argv0_ = argv[0];
238245
rr::saved_argv0_space_ = argv[argc - 1] + strlen(argv[argc - 1]) + 1 - rr::saved_argv0_;
239246

0 commit comments

Comments
 (0)