On Mon, Dec 14, 2009 at 1:11 PM, Jacob Burbach <jmburb...@gmail.com> wrote:
> Program received signal SIGFPE, Arithmetic exception.
> [Switching to Thread 0xb627aa20 (LWP 30813)]
> 0x0865ece2 in findcell (hr=0xeb43550, key=
>        {num = nan(0x567891077bfa8), ref = {ptr = {obj = 0x1077bfa8,
> str = 0x1077bfa8, vec = 0x1077bfa8, hash = 0x1077bfa8, code =
> 0x1077bfa8, func = 0x1077bfa8, ccode = 0x1077bfa8, ghost =
> 0x1077bfa8}, reftag = 2146789257}}, hash=4111002719) at
> ../../../simgear/nasal/hash.c:67
> 67          if(IS_NUM(a)) return a.num == b.num;

I believe this may be a compiler bug. Can you provide a disassembly
around that line? 50 instructions in each direction should be fine I
think.
Nasal stores values in a tricky union and (on 32 bit systems) it uses
the reftag to differentiate between numbers and pointers.
The IS_NUM check is like this:

#define NASAL_REFTAG 0x7ff56789 // == 2,146,789,257 decimal
#define IS_REF(r) ((r).ref.reftag == NASAL_REFTAG)
#define IS_NUM(r) (!IS_REF(r))

Your gdb output shows that reftag is in fact equal to NASAL_REFTAG so
IS_NUM should be false and thus the comparison that raises the FPE
should not be executed. I suspect gdb generated code that at least
loads one of the values into the FPU triggering the FPE.

-- 
Csaba/Jester

------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to