diff --git a/cli/loader_exe.c b/cli/loader_exe.c index 983cef02fa0374..07a0bddcd4b87f 100644 --- a/cli/loader_exe.c +++ b/cli/loader_exe.c @@ -63,6 +63,15 @@ int main(int argc, char * argv[]) return ret; } +#if defined(__GLIBC__) && (defined(_COMPILER_ASAN_ENABLED_) || defined(_COMPILER_TSAN_ENABLED_)) +// fork is generally bad news, but it is better if we prevent applications from +// making it worse as openblas threadpools cause it to hang +int __register_atfork232(void (*prepare)(void), void (*parent)(void), void (*child)(void), void *dso_handle) { + return 0; +} +__asm__ (".symver __register_atfork232, __register_atfork@@GLIBC_2.3.2"); +#endif + #ifdef __cplusplus } // extern "C" #endif