Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

misleading message for SIGFPE



When a command is terminated by SIGFPE, I get a message saying
"floating point exception" (this comes from Src/signames.c):

qaa% sh -c 'kill -FPE $$'
zsh: floating point exception (core dumped)  sh -c 'kill -FPE $$'

However, a SIGFPE may also be generated by integer operations
(such as 1 / 0).

ISO C and POSIX use the term "erroneous arithmetic operation".
The GNU C Library manual says "fatal arithmetic error".

BTW, in addition to the signal description, I would suggest to
output the signal name, e.g.

SIGFPE - erroneous arithmetic operation (core dumped)
SIGSEGV - segmentation fault (core dumped)
SIGKILL - killed

Otherwise it is not clear that the command termination is due to
a signal (even though the exit status can be checked / reported).

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - 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)




Messages sorted by: Reverse Date, Date, Thread, Author