]> arthur.barton.de Git - netdata.git/commitdiff
added pthread_exit in hope it will solve the crash at exit
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sat, 6 Feb 2016 05:37:21 +0000 (07:37 +0200)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sat, 6 Feb 2016 05:37:21 +0000 (07:37 +0200)
src/plugin_checks.c
src/plugin_idlejitter.c
src/plugin_nfacct.c
src/plugin_proc.c
src/plugin_tc.c
src/plugins_d.c

index d597e346a19a63aea7e49b3803920e9df96f07da..62cc31da4b0524efceb04f740a6fcb20cd3ae2c2 100755 (executable)
@@ -91,6 +91,7 @@ void *checks_main(void *ptr)
                rrdset_done(check3);
        }
 
+       pthread_exit(NULL);
        return NULL;
 }
 
index 8f55a002ce96fd111a119ab42c07f5123d1c5fbb..a7197330c162d6b54f78c5d543da60e93d777b32 100755 (executable)
@@ -62,6 +62,7 @@ void *cpuidlejitter_main(void *ptr)
                rrdset_done(st);
        }
 
+       pthread_exit(NULL);
        return NULL;
 }
 
index 8c613c4c28b008cbbf7c00e4abd84002c23b43d3..0c5b39457b38cb83cf6f44289b71eabdbd17ebbb 100644 (file)
@@ -98,12 +98,14 @@ void *nfacct_main(void *ptr) {
        nl  = mnl_socket_open(NETLINK_NETFILTER);
        if(!nl) {
                error("nfacct.plugin: mnl_socket_open() failed");
+               pthread_exit(NULL);
                return NULL;
        }
 
        if(mnl_socket_bind(nl, 0, MNL_SOCKET_AUTOPID) < 0) {
                mnl_socket_close(nl);
                error("nfacct.plugin: mnl_socket_bind() failed");
+               pthread_exit(NULL);
                return NULL;
        }
        portid = mnl_socket_get_portid(nl);
@@ -127,11 +129,13 @@ void *nfacct_main(void *ptr) {
                if(!nlh) {
                        mnl_socket_close(nl);
                        error("nfacct.plugin: nfacct_nlmsg_build_hdr() failed");
+                       pthread_exit(NULL);
                        return NULL;
                }
 
                if(mnl_socket_sendto(nl, nlh, nlh->nlmsg_len) < 0) {
                        error("nfacct.plugin: mnl_socket_send");
+                       pthread_exit(NULL);
                        return NULL;
                }
 
@@ -144,6 +148,7 @@ void *nfacct_main(void *ptr) {
 
                if (ret == -1) {
                        error("nfacct.plugin: error communicating with kernel.");
+                       pthread_exit(NULL);
                        return NULL;
                }
 
@@ -210,6 +215,7 @@ void *nfacct_main(void *ptr) {
        }
 
        mnl_socket_close(nl);
+       pthread_exit(NULL);
        return NULL;
 }
 #endif
index 7f79364e3b54e6b911a659d43fe34eae13fe8ca2..ac96cb50b27bc4dffd8ee60bd63f3a0eeca64e2b 100755 (executable)
@@ -223,5 +223,6 @@ void *proc_main(void *ptr)
                bcopy(&now, &last, sizeof(struct timeval));
        }
 
+       pthread_exit(NULL);
        return NULL;
 }
index 15b8077c40af2105acf0c621b7fbba72bdae09c7..5ed9140505c8fa4031f28db8133b1e7bb9ef7dc2 100755 (executable)
@@ -521,6 +521,7 @@ void *tc_main(void *ptr)
                fp = mypopen(buffer, &tc_child_pid);
                if(!fp) {
                        error("TC: Cannot popen(\"%s\", \"r\").", buffer);
+                       pthread_exit(NULL);
                        return NULL;
                }
 
@@ -672,12 +673,14 @@ void *tc_main(void *ptr)
 
                if(netdata_exit) {
                        tc_device_free_all();
+                       pthread_exit(NULL);
                        return NULL;
                }
 
                sleep((unsigned int) rrd_update_every);
        }
 
+       pthread_exit(NULL);
        return NULL;
 }
 
index c07e592ea27fd07559809314f16c27716582104b..b4cb57888d7c52296bb6a7af1eb610ff3ffad894 100755 (executable)
@@ -403,6 +403,7 @@ void *pluginsd_worker_thread(void *arg)
                        cd->pid = 0;
                        cd->enabled = 0;
                        cd->obsolete = 1;
+                       pthread_exit(NULL);
                        return NULL;
                }
 
@@ -417,6 +418,7 @@ void *pluginsd_worker_thread(void *arg)
        }
 
        cd->obsolete = 1;
+       pthread_exit(NULL);
        return NULL;
 }
 
@@ -450,6 +452,7 @@ void *pluginsd_main(void *ptr)
                dir = opendir(dir_name);
                if(unlikely(!dir)) {
                        error("Cannot open directory '%s'.", dir_name);
+                       pthread_exit(NULL);
                        return NULL;
                }
 
@@ -524,6 +527,7 @@ void *pluginsd_main(void *ptr)
                sleep((unsigned int) scan_frequency);
        }
 
+       pthread_exit(NULL);
        return NULL;
 }