Remove #ifdef SIGSEGV
Refactor can_dump_core
Move this flag outside the signal handler
Fiddle
Do the can_dump_core check