未验证 提交 3a1b1e18 编写于 作者: Z zhangcui 提交者: Gitee

解决udevd 进程无法抓取 启动内存的问题。

Signed-off-by: Nzhangcui <zhangcui11@huawei.com>
上级 aa191d48
......@@ -67,7 +67,6 @@ static int parse_hook_variable(enum EnumHookMode* mode, char* path, int size)
if (!mode || !path || size <= 0) {
return -1;
}
bool flag = __set_hook_flag(false);
char hook_param_value[OHOS_PARAM_MAX_SIZE + 1] = {0};
unsigned int len = OHOS_PARAM_MAX_SIZE;
get_native_hook_param(hook_param_value, len);
......@@ -111,7 +110,6 @@ static int parse_hook_variable(enum EnumHookMode* mode, char* path, int size)
}
}
}
__set_hook_flag(flag);
return 0;
}
......@@ -336,9 +334,7 @@ static void install_ohos_malloc_hook(struct musl_libc_globals* globals)
static void* init_ohos_malloc_hook()
{
bool flag = __set_hook_flag(false);
install_ohos_malloc_hook(&__musl_libc_globals);
__set_hook_flag(flag);
return NULL;
}
......@@ -375,12 +371,10 @@ static void __install_malloc_hook()
init_ohos_malloc_hook();
}
} else if (shared_library_handle != (void*)-1) {
bool flag = __set_hook_flag(false);
on_start_func_t start_func = (on_start_func_t)(function_of_shared_lib[ON_START_FUNCTION]);
if (start_func && !start_func()) {
// __musl_log(__MUSL_LOG_ERROR, "%s: failed to enable malloc\n", getprogname());
}
__set_hook_flag(flag);
volatile const struct MallocDispatchType* so_dispatch_value = (volatile const struct MallocDispatchType* )atomic_load_explicit(&__musl_libc_globals.so_dispatch_table, memory_order_acquire);
atomic_store_explicit(&__musl_libc_globals.current_dispatch_table, (volatile long long)so_dispatch_value, memory_order_seq_cst);
}
......@@ -389,14 +383,12 @@ static void __install_malloc_hook()
static void __uninstal_malloc_hook()
{
atomic_store_explicit(&__hook_enable_hook_flag, (volatile bool)false, memory_order_seq_cst);
bool flag = __set_hook_flag(false);
__set_default_malloc();
on_end_func_t end_func = (on_end_func_t)(function_of_shared_lib[ON_END_FUNCTION]);
if (end_func) {
end_func();
}
__set_hook_flag(flag);
}
static void __install_malloc_hook_signal_handler()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册