ok, to start, a segmentation error occurs when the CPU tries to access an address that the process does not have access to. At the lowest level, a memory mapping implementation should detect this, which generally causes an interrupt. The kernel receives this interrupt and has a table of addresses for other code segments, each of which is designed to handle this interrupt.
When the kernel receives this interrupt, it translates it into a specific value (I'm vague because the exact data differs with both the hardware architecture and the kernel implementation). SIGSEGV usually defined as a value of 11, but the exact value does not matter; it is defined in signal.h .
At this point, the signal value is transferred to another table inside the kernel, which contains the addresses of the "signal handlers". One of these handlers is at the offset represented by SIGSEGV . If you haven’t done something to change it, this address is usually a subroutine that calls the main dump, assuming appropriate restrictions, but you can replace this with the address of your own procedure, which can do whatever you like.
source share