Skip to Main Content
Hands-On System Programming with Linux
book

Hands-On System Programming with Linux

by Kaiwan N. Billimoria, Tigran Aivazian
October 2018
Beginner content levelBeginner
794 pages
19h 23m
English
Packt Publishing
Content preview from Hands-On System Programming with Linux

Trapping and extracting information from a crash

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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Linux System Programming Techniques

Linux System Programming Techniques

Jack-Benny Persson
Linux Device Drivers, Second Edition

Linux Device Drivers, Second Edition

Jonathan Corbet, Alessandro Rubini

Publisher Resources

ISBN: 9781788998475Supplemental Content