misleading error message
Sergey B Kirpichev
skir at sagemath.org
Tue Sep 24 15:50:40 CEST 2024
On Tue, Sep 24, 2024 at 01:22:03PM +0200, Vincent Lefevre wrote:
> Actually the core dump may be Linux-specific. But POSIX still
> requires termination as the default action:
You are right.
> So perhaps SIGFPE is the right thing for GMP after all (as this
> could be regarded as overflow / out of range). In any case, the
> "Floating point exception" message from the system is incorrect,
> as SIGFPE is also generated for integer operations.
But I don't see why SIGFPE here is the right thing, while printing
an error message to stderr and calling abort() (as for errors
in the memory.c) - is not.
BTW, description in
https://pubs.opengroup.org/onlinepubs/009695399/basedefs/signal.h.html
lists SIGFPE as "Erroneous arithmetic operation." Perhaps, such message
from the system might be even more misleading for memory-related errors.
More information about the gmp-discuss
mailing list