File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
source/loader/layers/sanitizer Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -366,8 +366,6 @@ ur_result_t SanitizerInterceptor::enqueueMemSetShadow(
366366 static auto MemSet =
367367 (void *(*)(void *, int , size_t ))GetMemFunctionPointer (" memset" );
368368 if (!MemSet) {
369- context.logger .error (
370- " Failed to get 'memset' function from libc.so.6" );
371369 return UR_RESULT_ERROR_UNKNOWN;
372370 }
373371
Original file line number Diff line number Diff line change 1212 */
1313
1414#include " common.hpp"
15+ #include " ur_sanitizer_layer.hpp"
1516
1617#include < asm/param.h>
1718#include < dlfcn.h>
@@ -71,11 +72,16 @@ bool DestroyShadowMem() {
7172}
7273
7374void *GetMemFunctionPointer (const char *FuncName) {
74- void *handle = dlopen (LIBC_SO, RTLD_NOLOAD);
75+ void *handle = dlopen (LIBC_SO, RTLD_LAZY | RTLD_NOLOAD);
7576 if (!handle) {
77+ context.logger .error (" Failed to dlopen {}" , LIBC_SO);
7678 return nullptr ;
7779 }
78- return dlsym (handle, FuncName);
80+ auto ptr = dlsym (handle, FuncName);
81+ if (!ptr) {
82+ context.logger .error (" Failed to get '{}' from {}" , FuncName, LIBC_SO);
83+ }
84+ return ptr;
7985}
8086
8187} // namespace ur_sanitizer_layer
You can’t perform that action at this time.
0 commit comments