#include #include // Raise from different thread. void foo() { raise(SIGSEGV); } void bar() { foo(); } void qux() { bar(); } void* thread(void*) { qux(); return 0; } int main() { pthread_t th; pthread_create(&th, NULL, thread, NULL); pthread_join(th, NULL); }