[PATCH] D144830: [asan darwin] Allow clients to implement `__sanitizer_report_error_summary`
Dave MacLachlan via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 27 16:34:15 PST 2023
dmaclach updated this revision to Diff 500967.
dmaclach edited the summary of this revision.
dmaclach added a comment.
Switched over to using "__sanitizer_sandbox_on_notify" from "__sanitizer_print_stack_trace" because it's available in the internal headers and serves the same purpose.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D144830/new/
https://reviews.llvm.org/D144830
Files:
compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp
Index: compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp
===================================================================
--- compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp
+++ compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp
@@ -987,9 +987,11 @@
// Verify that interceptors really work. We'll use dlsym to locate
// "puts", if interceptors are working, it should really point to
// "wrap_puts" within our own dylib.
+ // "__sanitizer_sandbox_on_notify" is an exported function, but not
+ // overridable by the client.
Dl_info info_puts, info_runtime;
RAW_CHECK(dladdr(dlsym(RTLD_DEFAULT, "puts"), &info_puts));
- RAW_CHECK(dladdr((void *)__sanitizer_report_error_summary, &info_runtime));
+ RAW_CHECK(dladdr((void *)__sanitizer_sandbox_on_notify, &info_runtime));
if (internal_strcmp(info_puts.dli_fname, info_runtime.dli_fname) != 0) {
Report(
"ERROR: Interceptors are not working. This may be because %s is "
@@ -1039,7 +1041,7 @@
return;
Dl_info info;
- RAW_CHECK(dladdr((void *)__sanitizer_report_error_summary, &info));
+ RAW_CHECK(dladdr((void *)__sanitizer_sandbox_on_notify, &info));
const char *dylib_name = StripModuleName(info.dli_fname);
bool lib_is_in_env = internal_strstr(dyld_insert_libraries, dylib_name);
if (!lib_is_in_env)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144830.500967.patch
Type: text/x-patch
Size: 1312 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230228/c8ac9d57/attachment.bin>
More information about the llvm-commits
mailing list