Martin G C Davies wrote:
My fault I'm afraid. I wasn't on the list before, so John Archer submitted this for me. I did a slight change to my original bug source and, since it core dumped, I didn't spot the unhelpful writeln. The original source was:-
program bug1 (output);
procedure level_1 ; label 1;
procedure level_2 ; procedure level_3 ;
begin (* level_3 code *) writeln( 'level_3' ) ; writeln( 'goto 1' ) ; goto 1 ; writeln( 'should not get here1' ) ; end ; (* level_3 code *)
begin (* level_2 code *)
writeln( 'level_2' ) ; level_3 ; writeln( 'should not get here2' ) ; end ; (* level_2 code *)
begin (* level_1 code *) writeln( 'level_1' ) ; level_2 ; writeln( 'should not get here' ) ;
1:
writeln( 'label 1' ) ;
end ; (* level_1 code *)
begin level_1 ; end.
but with GPC I compile using just:-
gpc bug1.pas
and the run gives:-
level_1 level_2 level_3 goto 1 Segmentation Fault(coredump)
I tried to find more with GDB but the output isn't much use:-
It rather looks like the stack manipulation (or something) has got rather mucked up.
Doesn't crash for me (neither on Linux nor Solaris). Maybe this bug has been fixed with some other recent fix. So I have to ask you to do more debugging on your machine or wait for the next GPC release and retry with it ...
Frank