Next, we will see a test program ch12/handle_segv.c, with deliberate bugs, to help us understand the use cases possible. All this will result in the SIGSEGV signal being generated by the OS. How the application developer handles this signal is important: we demonstrate how you can use it to gather important details, such as the address of the memory location upon whose access the crash took place and the value of all registers at that point in time. These details often provide useful clues into the root cause of the memory bug.
To help understand how we are constructing this program, run it without any parameters:
$ ./handle_segv Usage: ./handle_segv u|k r|wu => user modek => kernel mode r ...