Skip to content

Tag Archives: programming c linux

Handling stack overflows on Linux applications

07-Jan-09

When a program suffers a stack overflow it receives a SIGSEGV (segmentation fault) signal. If we want to detect it to distinguish it from other causes of SIGSEGV, we can use sigaltstack() and sigaction() to install a SA_ONSTACK handler for SIGSEGV which will run the signal handler on an alternative stack. On this signal handler [...]

Simple UDP client server with asynchronous I/O

06-Nov-08

I haven't found any example on the net of an asynchronous I/O UDP server, that is one that uses signals to receive UDP packets. I enclose an example which can be compiled with or without asynchronous I/O. Note that in my final implementation I'll use real time signals which pass the socket descriptor to the [...]