Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
From: "J. Josh Feng" <fengj@percy.engr.wisc.edu>
Subject: Re: Floating Point Exception
Date: 1999/09/08	[thread overview]
Message-ID: <37D68D2A.4EE43A28@percy.engr.wisc.edu> (raw)
In-Reply-To: 37D6008A.464F60FF@ijs.si

On Wed, Sep 08, 1999 at 06:22:03AM +0000, Tone Kokalj wrote:
> J. Josh Feng wrote:                                       
> 
> > Tone Kokalj wrote:
> > >
> > > Hi All !                     
> > >
> > > Please, can somebody help me.
> > >
> > > I have the following problem. I have access to two Linux/Alphas
> > > PC21164-P7.  But I am not able to do something really useful with
> > > them, since I got "Floating Point Exceptions" and the console report
> > > something like:
> > >
> > > arithmetic trap at 0000000120090248: 11 0000000800000000
> > >
> > > It is not that the applications I am running are bad, since they are
> > > well established and runs on other platforms quite well.
> > >
> >
> > I had this quite often. I assume you use GCC (egcs more precisely). My
> > guess is that some
> > variable in your program is used before a value is assigned to it. For
> > example:
> 
> First, thanks for the answer. But it is really not linked with GCC. I could
> compile theprogram with FORTRAN90 on DEC Alpha with static linking the
> libraries, which will
> run 100% OK on DEC, but will FPE fail on Linux/GNU Alpha.
>    
   
I think g77 will translate the Fortran program to a C program first and
then
uses gcc.


> This morning I did a little of debugging. I found out that the program
> (written in FORTRAN77 and compiled with g77) crashed while executing
> FORMAT sentence. More precisely it crashed in
> ../../../../libf2c/libI77/wref.c:211. And that is terrifying - to crash in
> FORMAT.  
>    

Try this little fortran program
        
        real x, y

        write(*,*) x, y

        end
  
It will give FPE. Now modify it to

        real x, y
        
        x = 0;
        y = 0;
        write(*,*) x, y

        end

Then it runs ok. It seems that the I/O routine (wref.c) can not handle
'undefined' values (there must be some bits set in undefined variables
before
you assign any values to them such that those bits will confuse I/O
routine).

> The only "specialized" program that runs succeessfully is my own (written in
> C),
> since I wrote small  FPE signal handler. But I would really omit this
> FPE signal
> handler in numerical programs, since I don't know what would be its impact
> (maybe all obtained values will be meaningless).
>  

I have this kind of concern also. So I don't use any signal handler in
my
programs, and if they run ok, then I have to assume or believe that
everything
works the way it should. Frankly, I don't really know the tech reason
for FPE.  
I have tried to hack GCC compiler on Alpha, but it is just beyond my
comprehension.
        
        
           
-- 
J. Joshua Feng                            (O)608/262-3640
Electrical & Computer Engr., Univ. of Wisconsin - Madison
http://www.cae.wisc.edu/~fengj  fengj@percy.engr.wisc.edu



  reply	other threads:[~1999-09-08  4:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-07  4:00 Floating Point Exception Tone Kokalj
1999-09-07  4:00 ` J. Josh Feng
1999-09-08  4:00   ` Tone Kokalj
1999-09-08  4:00     ` J. Josh Feng [this message]
1999-09-08  4:00       ` Greg Lindahl
1999-09-08  4:00   ` Greg Lindahl
1999-09-09  4:00     ` Tone Kokalj
1999-09-09  4:00       ` Eberhard Burr
1999-09-10  4:00         ` Tone Kokalj
1999-09-07  4:00 ` Greg Lindahl
  -- strict thread matches above, loose matches on Subject: below --
2001-05-29 10:11 Floating point exception BERTRAND Joël
2001-05-29 12:50 ` BERTRAND Joël
2001-06-25 21:45   ` Ken Whaley
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox