Hello!
This short program compiles without a warning, but crashes at execution. The compiler is FPC 2.2 on the win32 platform.
program Crashes(input,output);
function B(l:integer):boolean; begin B:=true; end;
procedure Q(j:integer;function A(l:integer):boolean);
function E(l:integer):boolean; begin E := false end;
begin if A(j) then Q(200,E); end;
begin Q(100,B); end.
This is the compiler command: $ gpc --classic-pascal -g -Wall crashes.p
Here are the stack frames from gdb:
Loaded symbols for /cygdrive/c/WINDOWS/system32/ntdll.dll Loaded symbols for /cygdrive/c/WINDOWS/system32/kernel32.dll Loaded symbols for /usr/bin/cygwin1.dll Loaded symbols for /cygdrive/c/WINDOWS/system32/advapi32.dll Loaded symbols for /cygdrive/c/WINDOWS/system32/rpcrt4.dll Loaded symbols for /cygdrive/c/WINDOWS/system32/secur32.dll
Program received signal SIGSEGV, Segmentation fault. 0x0022cc20 in ?? () (gdb) bt #0 0x0022cc20 in ?? () #1 0x004010a9 in _p__M0_S1_Q (J=200, A=@0x22cc20) at crashes.p:16 #2 0x004010c6 in _p__M0_S1_Q (J=100, A=@0x401050) at crashes.p:16 #3 0x004010e2 in _p__M0_main_program () at crashes.p:20 #4 0x0040115b in main (argc=1, argv=0x6927b0, envp=0x690090) at <implicit code>:22
I am pretty sure that this is a compiler bug, because this program used to run on MacPascal with no error.
-- Regis Cridlig cridlig@gmail.com
On 3 Apr 2008 at 10:59, Régis Cridlig wrote:
Hello!
This short program compiles without a warning, but crashes at execution. The compiler is FPC 2.2 on the win32 platform.
program Crashes(input,output);
function B(l:integer):boolean; begin B:=true; end;
procedure Q(j:integer;function A(l:integer):boolean);
function E(l:integer):boolean; begin E := false end;
begin if A(j) then Q(200,E); end;
begin Q(100,B); end.
This is the compiler command: $ gpc --classic-pascal -g -Wall crashes.p
Which GPC version are you using?
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.greatchief.plus.com/
On Thu, 3 Apr 2008, Prof A Olowofoyeku (The African Chief) wrote:
On 3 Apr 2008 at 10:59, Régis Cridlig wrote:
Hello!
This short program compiles without a warning, but crashes at execution. The compiler is FPC 2.2 on the win32 platform.
^^^^^^^ Hmmm, can you run FPC using gpc as the command? Anyway, program compiles and runs using latest gpc on linux platform.
Hope this helps Russ
program Crashes(input,output);
function B(l:integer):boolean; begin B:=true; end;
procedure Q(j:integer;function A(l:integer):boolean);
function E(l:integer):boolean; begin E := false end;
begin if A(j) then Q(200,E); end;
begin Q(100,B); end.
This is the compiler command: $ gpc --classic-pascal -g -Wall crashes.p
Which GPC version are you using?
Actually FPC 2.2 does not compile the code:
$ /cygdrive/c/FPC/2.2.0/bin/i386-win32/fpc.exe -Mmacpas crashes.p Free Pascal Compiler version 2.2.0 [2007/09/09] for i386 Copyright (c) 1993-2007 by Florian Klaempfl Target OS: Win32 for i386 Compiling crashes.p crashes.p(17,20) Error: Incompatible type for arg no. 2: Got "local E(SmallInt): Boolean", expected "<procedure variable type of function(SmallInt):Boolean;Regis ter>" crashes.p(24) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted Error: c:\FPC\2.2.0\bin\i386-win32\ppc386.exe returned an error exitcode (normal if you did not specify a source file to be compiled)
2008/4/3, Russell Whitaker russ@ashlandhome.net:
On Thu, 3 Apr 2008, Prof A Olowofoyeku (The African Chief) wrote:
On 3 Apr 2008 at 10:59, Régis Cridlig wrote:
Hello!
This short program compiles without a warning, but crashes at execution. The compiler is FPC 2.2 on the win32 platform.
^^^^^^^
Hmmm, can you run FPC using gpc as the command? Anyway, program compiles and runs using latest gpc on linux platform.
Hope this helps Russ
program Crashes(input,output);
function B(l:integer):boolean; begin B:=true; end;
procedure Q(j:integer;function A(l:integer):boolean);
function E(l:integer):boolean; begin E := false end;
begin if A(j) then Q(200,E); end;
begin Q(100,B); end.
This is the compiler command: $ gpc --classic-pascal -g -Wall crashes.p
Which GPC version are you using?
What is the latest stable release of gpc? I am using gcc version 3.4.4
-- Regis
2008/4/3, Russell Whitaker russ@ashlandhome.net:
On Thu, 3 Apr 2008, Prof A Olowofoyeku (The African Chief) wrote:
On 3 Apr 2008 at 10:59, Régis Cridlig wrote:
Hello!
This short program compiles without a warning, but crashes at execution. The compiler is FPC 2.2 on the win32 platform.
^^^^^^^
Hmmm, can you run FPC using gpc as the command? Anyway, program compiles and runs using latest gpc on linux platform.
Hope this helps Russ
program Crashes(input,output);
function B(l:integer):boolean; begin B:=true; end;
procedure Q(j:integer;function A(l:integer):boolean);
function E(l:integer):boolean; begin E := false end;
begin if A(j) then Q(200,E); end;
begin Q(100,B); end.
This is the compiler command: $ gpc --classic-pascal -g -Wall crashes.p
Which GPC version are you using?
On 3 Apr 2008 at 14:25, Régis Cridlig wrote:
What is the latest stable release of gpc?
http://www.math.uni.wroc.pl/~hebisch/gpc/gpc-20070904.tar.bz2
Please write only to the GPC list.
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.greatchief.plus.com/
I tried downloading from http://www.math.uni.wroc.pl/~hebisch/gpc/gpc-20070904.tar.bz2 but it failed twice. The server's bandwidth must be very low.
Could you point me to a mirror site on the internet? (I am located in California)
Best Regards
-- Regis
2008/4/3, Prof A Olowofoyeku (The African Chief) chiefsoft@bigfoot.com:
On 3 Apr 2008 at 14:25, Régis Cridlig wrote:
What is the latest stable release of gpc?
http://www.math.uni.wroc.pl/~hebisch/gpc/gpc-20070904.tar.bz2
Please write only to the GPC list.
Best regards, The Chief
Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.greatchief.plus.com/