Asserts considered harmful (or GMP spills its sensitive information)
Vincent Lefevre
vincent at vinc17.net
Tue Jan 1 11:00:58 UTC 2019
On 2019-01-01 11:22:56 +0100, Joerg Arndt wrote:
> * Vincent Lefevre <vincent at vinc17.net> [Jan 01. 2019 11:11]:
> > [...]
> > >
> > > Second, the SIGABRT terminates the process and can write a core file.
> >
> > That's the default behavior, but you can trap SIGABRT if you want.
>
> From man 3 abort:
> If the SIGABRT signal is ignored, or caught by a handler that
> returns, the abort() function will still terminate the process. It
> does this by restoring the default disposition for SIGABRT and then
> raising the signal for a second time.
Yes, that's why if you want to avoid process termination, you need
to write a handler that does not return (as said in the man page).
This is rather intuitive: if the handler returns, resuming the
program at the same point makes no sense because in general, the
memory state at this point is not valid.
--
Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
More information about the gmp-bugs
mailing list