On Fri, Feb 14, 2003 at 08:18:43AM +0100, Frank Heckenbach wrote:
Emil Jerabek wrote:
I also encountered some segfaults. Unfortunately I wasn't able to reduce the problem to a simple test case, because it manifests only during garbage collection (which doesn't occur at all on short input files, and the trouble might arose long before the actual crash anyway).
I found an instance myself now, and the following fixes it. Hope it does so for your case, too.
I'll try it, thanks. Anyway, I rebuilt the compiler with ENABLE_GC_ALWAYS_COLLECT meanwhile, which helped to pinpoint the problem. All five segfaults I got actually reduced to the same pattern, namely deep nesting of conditionals (and/or loops), such as this one:
program p4;
procedure g; var c: integer; begin if true then begin if true then begin case c of 40: begin if true then if true then begin if true then begin ; if true then if true then begin ; if true then begin ; if true then c := c - 48 end end end end end end end end end;
begin end.
[pas]% gpc -v Reading specs from /usr/local/lib/gcc-lib/i586-pc-linux-gnu/3.2.1/specs Configured with: ../gcc-3.2.1/configure --enable-languages=pascal --disable-nls --enable-checking --enable-gc-checking --enable-gc-always-collect Thread model: posix gpc version 20030209, based on gcc-3.2.1 Delete /tmp/ccUdXKeS.gpa? (y or n) y [pas]% gpc crash4.pas -Q g {GC 126k -> crash4.pas: In procedure `g': crash4.pas:29: internal error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See URL:http://www.gnu-pascal.de/todo.html for instructions. Delete /tmp/ccT5oAVp.s? (y or n)
Emil