From 40c9ea4431e3e2aecfa54dcc48bef55f602be497 Mon Sep 17 00:00:00 2001 From: luzhihao Date: Thu, 11 May 2023 14:41:19 +0800 Subject: [PATCH] bugfix: zombie task. --- src/probes/extends/ebpf.probe/src/ksliprobe/ksliprobe.c | 1 + src/probes/extends/ebpf.probe/src/pgsliprobe/pgsliprobe.c | 1 + src/probes/extends/ebpf.probe/src/sliprobe/redissli.c | 1 + src/probes/extends/ebpf.probe/src/stackprobe/stackprobe.c | 3 +++ 4 files changed, 6 insertions(+) diff --git a/src/probes/extends/ebpf.probe/src/ksliprobe/ksliprobe.c b/src/probes/extends/ebpf.probe/src/ksliprobe/ksliprobe.c index ac8484e..8f5513f 100644 --- a/src/probes/extends/ebpf.probe/src/ksliprobe/ksliprobe.c +++ b/src/probes/extends/ebpf.probe/src/ksliprobe/ksliprobe.c @@ -162,6 +162,7 @@ static int init_conn_mgt_process(int msg_evt_map_fd) fprintf(stderr, "Failed to create connection read/write message event handler thread.\n"); return -1; } + (void)pthread_detach(msg_evt_hdl_thd); printf("Connection read/write message event handler thread successfully started!\n"); return 0; diff --git a/src/probes/extends/ebpf.probe/src/pgsliprobe/pgsliprobe.c b/src/probes/extends/ebpf.probe/src/pgsliprobe/pgsliprobe.c index 34e749c..bee69b9 100644 --- a/src/probes/extends/ebpf.probe/src/pgsliprobe/pgsliprobe.c +++ b/src/probes/extends/ebpf.probe/src/pgsliprobe/pgsliprobe.c @@ -194,6 +194,7 @@ static int init_conn_mgt_process(int msg_evt_map_fd) fprintf(stderr, "Failed to create connection read/write message event handler thread.\n"); return -1; } + (void)pthread_detach(msg_evt_hdl_thd); printf("Connection read/write message event handler thread successfully started!\n"); return 0; diff --git a/src/probes/extends/ebpf.probe/src/sliprobe/redissli.c b/src/probes/extends/ebpf.probe/src/sliprobe/redissli.c index 19c6fb7..e9b8591 100644 --- a/src/probes/extends/ebpf.probe/src/sliprobe/redissli.c +++ b/src/probes/extends/ebpf.probe/src/sliprobe/redissli.c @@ -131,6 +131,7 @@ static int init_conn_mgt_process(int cmd_evt_map_fd) fprintf(stderr, "Failed to create connection command event handler thread.\n"); return -1; } + (void)pthread_detach(cmd_evt_hdl_thd); printf("Connection command event handler thread successfully started!\n"); return 0; diff --git a/src/probes/extends/ebpf.probe/src/stackprobe/stackprobe.c b/src/probes/extends/ebpf.probe/src/stackprobe/stackprobe.c index f050c27..41ad62e 100644 --- a/src/probes/extends/ebpf.probe/src/stackprobe/stackprobe.c +++ b/src/probes/extends/ebpf.probe/src/stackprobe/stackprobe.c @@ -1386,6 +1386,7 @@ cleanup: ERROR("[STACKPROBE]: attach memleak bpf failed %d\n", err); return -1; } + (void)pthread_detach(uprobe_attach_thd); #endif INFO("[STACKPROBE]: attach memleak bpf succeed.\n"); @@ -1576,6 +1577,7 @@ static void init_wr_flame_pthreads(struct svg_stack_trace_s *svg_st, const char g_stop = 1; return; } + (void)pthread_detach(wr_flame_thd); INFO("[STACKPROBE]: %s wr_flame_pthread successfully started!\n", flame_name); return; @@ -1641,6 +1643,7 @@ static void init_java_support_proc(StackprobeConfig *conf) ERROR("[STACKPROBE]: Failed to create java_support_pthread.\n"); return; } + (void)pthread_detach(attach_thd); INFO("[STACKPROBE]: java_support_pthread successfully started!\n"); return; -- 2.33.0