File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
source/loader/layers/sanitizer Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -366,8 +366,6 @@ ur_result_t SanitizerInterceptor::enqueueMemSetShadow(
366
366
static auto MemSet =
367
367
(void *(*)(void *, int , size_t ))GetMemFunctionPointer (" memset" );
368
368
if (!MemSet) {
369
- context.logger .error (
370
- " Failed to get 'memset' function from libc.so.6" );
371
369
return UR_RESULT_ERROR_UNKNOWN;
372
370
}
373
371
Original file line number Diff line number Diff line change 12
12
*/
13
13
14
14
#include " common.hpp"
15
+ #include " ur_sanitizer_layer.hpp"
15
16
16
17
#include < asm/param.h>
17
18
#include < dlfcn.h>
@@ -22,7 +23,7 @@ extern "C" __attribute__((weak)) void __asan_init(void);
22
23
23
24
namespace ur_sanitizer_layer {
24
25
25
- bool IsInASanContext () { return __asan_init != nullptr ; }
26
+ bool IsInASanContext () { return ( void *) __asan_init != nullptr ; }
26
27
27
28
static bool ReserveShadowMem (uptr Addr, uptr Size) {
28
29
Size = RoundUpTo (Size, EXEC_PAGESIZE);
@@ -71,13 +72,14 @@ bool DestroyShadowMem() {
71
72
}
72
73
73
74
void *GetMemFunctionPointer (const char *FuncName) {
74
- void *handle = dlopen (LIBC_SO, RTLD_LAZY);
75
+ void *handle = dlopen (LIBC_SO, RTLD_LAZY | RTLD_NOLOAD );
75
76
if (!handle) {
76
- return (void *)nullptr ;
77
+ context.logger .error (" Failed to dlopen {}" , LIBC_SO);
78
+ return nullptr ;
77
79
}
78
- void * ptr = dlsym (handle, FuncName);
80
+ auto ptr = dlsym (handle, FuncName);
79
81
if (!ptr) {
80
- return ( void *) nullptr ;
82
+ context. logger . error ( " Failed to get '{}' from {} " , FuncName, LIBC_SO) ;
81
83
}
82
84
return ptr;
83
85
}
You can’t perform that action at this time.
0 commit comments