>>> (6): "-dDebug -O3" produces "Fatal: Internal error 200409241"
>>> in at least one unit (new in 2.1.4)
>>
>>Submit the relevant code.
>>
>
Marco,
Meanwhile I have a stripped down exploit. It seems the error is
related to the access of an open array from an internal subroutine.
Hope that helps
Wolfgang
program interr; {stripped down FPC demo}
{FPC 2.1.4 produces internal error with -dDebug -O3}
{INTERR.PAS(30,26) Fatal: Internal error 200409241 }
{Related to access array of longint from internal subroutine???}
{---------------------------------------------------------------------------}
procedure mp_prod_int(var a: longint; const b: array of longint; n:
longint);
{-calculate a = product of first n elements of longint array b}
var
thresh: longint; {threshold for recursive calls}
level: integer; {recursion level}
q: array[0..32] of longint; {stack for recursion}
procedure mp_set_int(var p: longint; L: longint);
begin
p := L;
end;
procedure rprod(var p: longint; L,H: longint);
{-calculate p=a[L]*a[L+1]*...a[H]}
var
m: longint;
begin
{increase recursion level}
inc(level);
if H-L<=thresh then begin
if L>H then p := 1
else begin
mp_set_int(p,b[L]); { <= Internal error 200409241}
{skip loop is p is zero}
while (L<H) and (p>0) do begin
inc(L);
mp_set_int(q[0],b[L]);
p := q[0]*p;
end;
end;
end
else begin
{recursive calls}
m := (L + H) div 2;
rprod(p,L,m);
{calculate second half only if p<>0}
if (p>0) then begin
rprod(q[level],m+1,H);
p := q[level]*p;
end;
end;
dec(level);
end;
begin
if n<2 then begin
{Easy out: empty product or single element}
if n=1 then mp_set_int(a,b[low(b)])
else a := 1;
exit;
end;
{value of thresh is not critical}
thresh := 4;
{initialize recursion level}
level := 0;
{initialize recursion stack}
rprod(a,low(b),low(b)+n-1);
end;
const
fak: array[1..15] of longint =
(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15);
var
p: longint;
begin
mp_prod_int(p,fak,12);
writeln(p);
end.
..... FPC 2.1.4
D:\BP_WE\WORK\MPINT>E:\FPC214\bin\i386-win32\fpc.exe -B -dDebug -O3
INTERR.PAS
Compiling Debug Version
Free Pascal Compiler version 2.1.4 [2007/05/11] for i386
Copyright (c) 1993-2007 by Florian Klaempfl
INTERR.PAS(30,26) Fatal: Internal error 200409241
Fatal: Compilation aborted
Error: E:\FPC214\BIN\I386-WIN32\ppc386.exe returned an error exitcode
(normal if
you did not specify a source file to be compiled)
..... FPC 2.0.4
D:\BP_WE\WORK\MPINT>E:\FPC204\bin\i386-win32\fpc.exe -B -dDebug -O3
INTERR.PAS
Compiling Debug Version
Free Pascal Compiler version 2.0.4 [2006/09/11] for i386
Copyright (c) 1993-2006 by Florian Klaempfl
Target OS: Win32 for i386
Compiling INTERR.PAS
Linking INTERR.exe
77 Lines compiled, 0.9 sec
D:\BP_WE\WORK\MPINT>INTERR.exe
479001600
Heap dump by heaptrc unit
0 memory blocks allocated : 0/0
0 memory blocks freed : 0/0
0 unfreed memory blocks : 0
True heap size : 98304 (176 used in System startup)
True free heap : 98128
--
In order to e-mail me a reply to this message, you will have
to remove PLEASE.REMOVE from the address shown in the header
or get it from http://home.netsurf.de/wolfgang.ehrhardt
(Free AES, CRC, Hash, and HMAC source for Pascal/Delphi)


|