If SIGSEGV/ SIGILL/ etc. happens in your own code, the signal handler will not work in the context of an asynchronous signal (this is a fundamentally synchronous signal, but it will still be an AS context if this happens inside the standard library function), so you can legally call it pthread_exitfrom the signal handler. However, there are still problems that make this practice questionable:
SIGSEGV/SIGILL/ ... , , raise, kill, pthread_kill, sigqueue .. ( ). undefined . undefined, . UB . UB, / .
(, - access-after- free, , ,...), , (, malloc), . AS- pthread_exit. , UB (. ), , , .
, , . - . , , , , , , ( , ).