On 7/4/08, Charles Forsyth <[EMAIL PROTECTED]> wrote:
> > When I trigger a division by zero the handler is not called, I just
> > get trap 19 message.
>
>
> if i do a floating-point division by zero, the SIGFPE signal handler is
> called,
> because ape's signal recognises the initial "sys: fp: ". (ie, it works for
> me.)
>
> it doesn't work for an integer division by zero, which produces a different
> message for the underlying notify:
>
> 8.out 205840: suicide: sys: trap: divide error pc=0x00001089
>
> but that's fine too! Linux's signal(2) says, apparently referring to POSIX
> rules:
>
> .... Integer division by zero has undefined result.
> On some architectures it will generate a SIGFPE signal. (Also dividing
> the most negative integer by -1 may generate SIGFPE.) Ignoring this
> signal might lead to an endless loop.
>
> Linux might not be particularly good at documenting this particular area,
> so perhaps the standard(s) have useful hints or advice that APE could follow.
>
>
Any chance this is some 9vx issue? I tried the test code below it
worked in 9grid.jp ,but gave the following message in 9vx
8.out 89: suicide: sys: trap: 19 (reserved) pc=0x00001067
#include <stdio.h>
#include <signal.h>
void e_hand(int sig)
{
printf("Signal");
return;
}
int main()
{
double a, d;
d = 5.0;
signal(SIGFPE, e_hand);
a = 1/(d-5);
return 0;
}
--
http://www.fernski.com