If you want to follow the route of the signal handler, it is easy to get the address of the instruction that causes the signal handler to start. When you create your signal handler, set the bit SA_SIGINFOin the flag settings. Then, when you write the handler, it will have access to the structure siginfo_t, which includes the field si_addr, which is the address of the memory cell that caused the exception.
source
share