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

970917: DEC Alpha, Linux, and netCDF-3.3.1 - floating point exception



Scott,

>Date: Wed, 17 Sep 1997 14:49:19 -0600 
>From: "Scott R. Wilson" <address@hidden>
>Organization: Bio-Rad Semiconductor Division, CD Systems
>To: address@hidden,
>To: address@hidden
>Subject: Re: 970917: DEC Alpha, Linux, and netCDF-3.3.1 - floating poi
nt exception 
>Keywords: 199709162327.RAA11816

In the above message, you wrote:

> Here's some info on the nc_test failure. It gets past the
>        (void) signal(SIGFPE, SIG_IGN);
> with no problems. It faults in write_file(testfile) as follows (I tried
> to print out everything that might be important):
> 
> (gdb) break main
> (gdb) run -c
> .
> .
> .
> (gdb) n
> 136         init_gvars();
> (gdb) n
> 138         if ( create_file ) {
> (gdb) print testfile
> $1 = "test.nc"
> (gdb) n
> 139             write_file(testfile);
> (gdb) n
> 
> Program received signal SIGFPE, Arithmetic exception.
> 0x120099d6c in ncx_put_float_double () at ncx.c:1263
> 1263            float xx = (float) *ip;
> (gdb) where
> #0  0x120099d6c in ncx_put_float_double () at ncx.c:1263
> #1  0x12009f250 in ncx_putn_float_double () at ncx.c:3600
> #2  0x12008f22c in ncx_pad_putn_Idouble () at attr.c:975
> #3  0x120091bac in nc_put_att_double () at attr.c:2123
> #4  0x12008aa04 in put_atts () at util.c:584
> #5  0x12008b148 in write_file () at util.c:655
> #6  0x12000b090 in main () at nc_test.c:139

Yup.  The above indicates that the system is raising a floating-point
exception on trying to convert a too-large C "double" to a C "float".
This despite the fact that the system's been told to ignore SIGFPE.

Try the following:

    1.  Go into the "nc_test/" subdirectory.

    2.  Edit the file "nc_test.c": change the line

            #include <signal.h>

        to

            #include <bsd/signal.h>

    3.  Execute the command "make"

    4.  Execute the command "make test".

Please let me know what you find.

--------
Steve Emmerson   <http://www.unidata.ucar.edu>