A segmentation fault is difficult to anticipate and protect against. I imagine that g++ in Linux probably generates a signal for this and other type of system errors. How do I go about 'catching' these signals to prevent ugly terminination?