On Mon, Dec 20, 2010 at 12:51 PM, Victor Stinner <vstinner at edenwall.com> wrote: .. > Are you sure that a signal handler changes the registers? At least Linux saves > integer and float registers before calling the signal handler, and then > restores them. > What if the program crashes (again) in the signal handler before having a chance to restore registers? Also, can you point to documentation that describes register restoring behavior? I am not sure all registers are (or even can be) restored. > The fault handler only changes some registers and write some bytes on the > stack. The stack pointer is restored at exit, so I don't think that it causes > troubles to use a core dump. > > Dump a core file doesn't rely on process registers or mappings. Why do you > think that it will break the core dump function? Because I had actual experience with that using R. Your code may be better, but R brings up a dialog on segfault asking whether to produce a core dump. Occasionally, that core dump would be completely unusable because it would point to an unrelated point in the code. I don't have a specific case handy because long ago I disabled segfault handlers in the local R installation. (I actually use RPy which loads R into Python as a shared library, so the two handlers will conflict anyways.)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4