[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: SIGFPE trapping on HPPA (was: Yorick FTBFS: DM needs access to HPPA machine)



Hi,

Le 14 déc. 09 à 16:06, Carlos O'Donell a écrit :
Could you please provide a small test case and describe the expected behaviour?

Attached is a rather small testcase.

Compile with
  gcc -lm -o fputest fputest.c

Run with
  ./fputest
or with any succession of 'i's and 'f's, e.g.
  ./fputest iffifi

The expected behaviour (checked on i386) is that for each f or i letter, a line is output, for instance
     $ ./fputest iffi
     Triggering integer SIGFPE: 1/0=(SIGFPE trapped)0
     Triggering floating SIGFPE: 1./0.=(SIGFPE trapped)0.000000
     Triggering floating SIGFPE: 1./0.=(SIGFPE trapped)0.000000
     Triggering integer SIGFPE: 1/0=(SIGFPE trapped)0
     $ echo $?
     0

All the SIGFPEs should be trapped and the program should exit gracefully (check $?).

Under HPPA, the integer SIGFPEs are trapped but the floating-point SIGFPEs are not:
     $ ./fputest iffi
     Triggering integer SIGFPE: 1/0=(SIGFPE trapped)0
     Triggering floating SIGFPE: 1./0.=Floating point exception
     $ echo $?
     136

It's great if you can check why this is.

Best regards, Thibaut.

Attachment: fputest.c
Description: Binary data



Reply to: