Why wouldn't it be able to? A segfault is just a signal like any other.
Hmm, maybe I should put that in all my programs - then I won't ever have bugs from segfaults.
:)
char foo[640*1024];
int main(int argc, char ** argv) { return 0; }
When ran, it made the OS say "Out of memory" and then it was lab assistant's headache to unload all that resident stuff that was sitting there and eating good 20-30% of available RAM. They typically opposed to doing that, so the TAs assumed the program actually worked. The end :)Hmm ... :)
Second, the debugger generally catches the signal before it gets handled.