What Happens When Your Program Segfaults
HeapSmith
0:00 / 0:00
What Happens When Your Program Segfaults
129 просмотров · 10 дн. назад
HeapSmith
103 подписчика
129 просмотров · 10 дн. назад
Your C program dies with "Segmentation fault (core dumped)" and exit code 139, yet it never printed a word, so who wrote that line? We follow one bad store to address zero: the MMU refuses it, the kernel's page fault handler finds the address in none of the process's memory regions, and instead of killing the program it sends signal 11. We catch that signal, watch a handler get called again and again, see why a stack overflow needs a second stack, and find out how your shell turns 11 into words and 139.
Related Videos
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
How Virtual Memory Works: • How Virtual Memory Works
How malloc Works: • How malloc Works
How a CPU Runs Your Code: • How a CPU Runs Your Code
What Happens When You Press a Key: • What Happens When You Press a Key
How Unix Pipes Work: • How Unix Pipes Work
What Happens When You Press the Power Button: • What Happens When You Press the Power Button
Contents
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
00:00 - Who Printed That?
00:28 - One Bad Store
01:41 - Most Faults Are Fine
02:50 - Two Kinds of Bad
03:50 - Signal Eleven
04:54 - Catching It
06:09 - When the Stack Runs Out
07:10 - The Default Action
08:03 - The Shell's Sentence
09:16 - Why Most Bugs Don't Crash
#operatingsystems #computerscience #programming