Skip to content

Commit

Permalink
Revert "[compiler-rt][darwin] check for strcmp to test interceptors i…
Browse files Browse the repository at this point in the history
…nstead of pthread_create"

This reverts commit 1e36bd8.
  • Loading branch information
aralisza committed Jan 13, 2022
1 parent cce6507 commit 53cb3a7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1050,13 +1050,13 @@ void MaybeReexec() {
RAW_CHECK("execv failed" && 0);
}

// Verify that interceptors really work. We'll use dlsym to locate
// "strcmp", if interceptors are working, it should really point to
// "wrap_strcmp" within our own dylib.
Dl_info info_strcmp;
void *dlopen_addr = dlsym(RTLD_DEFAULT, "strcmp");
RAW_CHECK(dladdr(dlopen_addr, &info_strcmp));
if (internal_strcmp(info.dli_fname, info_strcmp.dli_fname) != 0) {
// Verify that interceptors really work. We'll use dlsym to locate
// "pthread_create", if interceptors are working, it should really point to
// "wrap_pthread_create" within our own dylib.
Dl_info info_pthread_create;
void *dlopen_addr = dlsym(RTLD_DEFAULT, "pthread_create");
RAW_CHECK(dladdr(dlopen_addr, &info_pthread_create));
if (internal_strcmp(info.dli_fname, info_pthread_create.dli_fname) != 0) {
Report(
"ERROR: Interceptors are not working. This may be because %s is "
"loaded too late (e.g. via dlopen). Please launch the executable "
Expand Down

0 comments on commit 53cb3a7

Please sign in to comment.