Skip to content

Commit

Permalink
ASan: Run with verify_asan_link_order=0.
Browse files Browse the repository at this point in the history
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_kill
  nested_detach_kill_stuck
  nested_detach_wait
  • Loading branch information
bernhardu committed Apr 12, 2023
1 parent 002528b commit e07e77e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,13 @@ size_t saved_argv0_space() {

using namespace rr;

#ifdef __SANITIZE_ADDRESS__
#include <sanitizer/asan_interface.h>
const char *__asan_default_options() {
return "verify_asan_link_order=0";
}
#endif

int main(int argc, char* argv[]) {
rr::saved_argv0_ = argv[0];
rr::saved_argv0_space_ = argv[argc - 1] + strlen(argv[argc - 1]) + 1 - rr::saved_argv0_;
Expand Down

0 comments on commit e07e77e

Please sign in to comment.