Quantcast
Channel: Active questions tagged kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 6369

Why are segfaults called faults (and not aborts) if they are not recoverable?

$
0
0

My following understanding of the terminology is this

1) An interrupt
is "a notification" that is initiated by the hardware to call the OS to run its handlers

2) A trap
is "a notification" that is initiated by the software to call the OS to run its handlers

3) A fault
is an exception that is raised by the processor if an error has occurred but it is recoverable

4) An abort
is an exception that is raised by the processor if an error has occurred but it is non-recoverable

Why do we call it a segmentation fault and not a segmentation abort then?

A segmentation fault
is when your program attempts to access memory it has either not been assigned by the operating system, or is otherwise not allowed to access.

My experience (primarily while testing C code) is that anytime a program throws a segmentation fault it is back to the drawing board - is there a scenario where the programmer can actually "catch" the exception and do something useful with it?


Viewing all articles
Browse latest Browse all 6369

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>