[fpc-pascal] run time error 208

Marc Santhoff M.Santhoff at t-online.de
Sun Feb 17 20:43:13 CET 2008


Am Sonntag, den 17.02.2008, 19:38 +0100 schrieb Jonas Maebe:
> On 17 Feb 2008, at 19:19, Marc Santhoff wrote:
> 
> > That's why I knew I had seen this number, it's in the procedure
> > SignalToRunerror(), so I'm not so stupid after all. ;)
> >
> > Is there any other way of examining the cause besides looking at the
> > values of the variables involved in the calculation?
> 
> You could check whether signaltorunerror is maybe missing some entries  
> in its case statement for SIGFPE reasons, and add any missing ones  
> (and if so, submit a patch for that).

The cause was an (easy to detect) division by zero. I expected such
errors to be caught ...

The code for FreeBSD in question looks like this:

case sig of
    SIGFPE :
          begin
            Case Info.si_code Of
                FPE_INTDIV : Res:=200;  {integer divide fault. Div0?}
                FPE_FLTOVF : Res:=205;  {Overflow trap}
                FPE_FLTUND : Res:=206;  {Stack over/underflow}
                FPE_FLTRES : Res:=216;  {Device not available}
                FPE_FLTINV : Res:=216;  {Invalid floating point operation}
               Else
                Res:=208; {coprocessor error}
                End;
             sysResetFPU;
          End;
    SIGILL,
    SIGBUS,
    SIGSEGV :
        res:=216;
  end;

What model of the i386 would be the best one for making a start?

I'd at least try to get the programmers manual for looking at the FPU
exception codes. Or maybe someone know a better way to get the necessary
information ...

Marc





More information about the fpc-pascal mailing list