diff --git a/src/threadpool.c b/src/threadpool.c index e89761daf43..cfa2e442981 100644 --- a/src/threadpool.c +++ b/src/threadpool.c @@ -261,14 +261,6 @@ static void reset_once(void) { static void init_once(void) { -#ifndef _WIN32 - /* Re-initialize the threadpool after fork. - * Note that this discards the global mutex and condition as well - * as the work queue. - */ - if (pthread_atfork(NULL, NULL, &reset_once)) - abort(); -#endif init_threads(); } diff --git a/src/unix/linux.c b/src/unix/linux.c index 19a63af02f7..79339742d89 100644 --- a/src/unix/linux.c +++ b/src/unix/linux.c @@ -65,6 +65,12 @@ #define LLONG_MIN (-9223372036854775807LL - 1) #endif +#if defined(__has_feature) +#if __has_feature(memory_sanitizer) +#include +#endif +#endif + #ifndef __NR_io_uring_setup # define __NR_io_uring_setup 425 #endif @@ -1418,6 +1424,11 @@ static void uv__epoll_ctl_flush(int epollfd, void uv__io_poll(uv_loop_t* loop, int timeout) { uv__loop_internal_fields_t* lfields; struct epoll_event events[1024]; +#if defined(__has_feature) +#if __has_feature(memory_sanitizer) + __msan_unpoison(events, 1024); +#endif +#endif struct epoll_event prep[256]; struct uv__invalidate inv; struct epoll_event* pe; diff --git a/src/unix/signal.c b/src/unix/signal.c index 91fb149464e..bcd15f48208 100644 --- a/src/unix/signal.c +++ b/src/unix/signal.c @@ -62,16 +62,6 @@ RB_GENERATE_STATIC(uv__signal_tree_s, static void uv__signal_global_reinit(void); static void uv__signal_global_init(void) { - if (uv__signal_lock_pipefd[0] == -1) - /* pthread_atfork can register before and after handlers, one - * for each child. This only registers one for the child. That - * state is both persistent and cumulative, so if we keep doing - * it the handler functions will be called multiple times. Thus - * we only want to do it once. - */ - if (pthread_atfork(NULL, NULL, &uv__signal_global_reinit)) - abort(); - uv__signal_global_reinit(); }