I wrote a very simple c program:
#include
int main(){
int a=2;
int b=0;
printf(\"%d\\n\", a/b);
}
and run it wi
Here, it raises a SIGFPE.
You forgot to tell strace
to follow children. Add the -f
option to strace
and you should see something similar to:
[pid 2304] read(3, "\312\376\272\276\0\0\0001\0n\n\0\23\0I\t\0\3\0J\7\0K\n\0L\0M\n\0N\0"..., 2369) = 2369
[pid 2304] --- SIGFPE (Floating point exception) @ 0 (0) ---
[pid 2304] rt_sigreturn(0x1c50800) = 5
[pid 2304] write(2, "Exception in thread \"main\" ", 27Exception in thread "main" ) = 27
[pid 2304] write(2, "java.lang.ArithmeticException: /"..., 40java.lang.ArithmeticException: / by zero) = 40
[pid 2304] write(2, "\n", 1