summaryrefslogtreecommitdiffstats
path: root/collectors
diff options
context:
space:
mode:
authorAdrien Mahieux <adrien.mahieux@gmail.com>2020-01-02 21:58:49 +0100
committerVladimir Kobal <vlad@prokk.net>2020-01-02 22:58:49 +0200
commit195856feb38d27b4ac15fb5006615690a900a40b (patch)
tree80d11d23e516fbccf3d17c6bc0de34297383cfe2 /collectors
parent447e9bdf8f5cc7c37bc0feb9499dfb47d7f9d008 (diff)
[Fix] remove pthread_setname_np segfault on musl (#7664)
Reported by #7626 on Docker, this segfault occurs with cpuidle plugin. The name setting was set after a pthread_join, thus occuring after the thread was terminated. While glibc handles this correctly, musl segfault
Diffstat (limited to 'collectors')
-rw-r--r--collectors/proc.plugin/proc_stat.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/collectors/proc.plugin/proc_stat.c b/collectors/proc.plugin/proc_stat.c
index 50fab90e64..373a06770a 100644
--- a/collectors/proc.plugin/proc_stat.c
+++ b/collectors/proc.plugin/proc_stat.c
@@ -1003,12 +1003,11 @@ int do_proc_stat(int update_every, usec_t dt) {
else
error("Cannot read current process affinity");
+ // These threads are very ephemeral and don't need to have a specific name
if(unlikely(pthread_create(&thread, NULL, wake_cpu_thread, (void *)&core)))
error("Cannot create wake_cpu_thread");
else if(unlikely(pthread_join(thread, NULL)))
error("Cannot join wake_cpu_thread");
- if(thread)
- pthread_setname_np(thread, "PLUGIN[cpuidle]");
cpu_states_updated = 1;
}
}