Skip to content

commit d3c902e5 causes infinite recursion in lazarus

System Information

  • Operating system: Linux
  • Processor architecture: x86-64
  • Compiler version: d3c902e5 (edited Makefiles to replace -O2 with -O- and -Xs with -gw3)
  • Device: Computer
  • lazarus version: freepascal.org/lazarus/lazarus@dde42200 (edited Makefiles to replace -O2 with -O- and -Xs with -gw3)

Steps to reproduce

open lazarus

What is the current bug behavior?

lazarus segmentation fault if compiled without optimization (infinite recursion) or freezes if compiled with optimization (infinite tailcalls)

What is the expected (correct) behavior?

lazarus opens

Relevant logs and/or screenshots

  • bottom part of backtrace in gdb:
    #174580 0x00000000005587cd in Add (this=0x7fffe6152380, S=...) at ../objpas/classes/stringl.inc:1943
    #174581 0x0000000000eaf166 in AddObject (this=0x7fffe6152380, S=..., AObject=0x0) at dbgutilstypepatternlist.pas:319
    #174582 0x00000000005587cd in Add (this=0x7fffe6152380, S=...) at ../objpas/classes/stringl.inc:1943
    #174583 0x0000000000eaf166 in AddObject (this=0x7fffe6152380, S=..., AObject=0x0) at dbgutilstypepatternlist.pas:319
    #174584 0x00000000005587cd in Add (this=0x7fffe6152380, S=...) at ../objpas/classes/stringl.inc:1943
    #174585 0x0000000000eaf166 in AddObject (this=0x7fffe6152380, S=..., AObject=0x0) at dbgutilstypepatternlist.pas:319
    #174586 0x00000000005587cd in Add (this=0x7fffe6152380, S=...) at ../objpas/classes/stringl.inc:1943
    #174587 0x0000000000eaf166 in AddObject (this=0x7fffe6152380, S=..., AObject=0x0) at dbgutilstypepatternlist.pas:319
    #174588 0x00000000005587cd in Add (this=0x7fffe6152380, S=...) at ../objpas/classes/stringl.inc:1943
    #174589 0x0000000000eaf166 in AddObject (this=0x7fffe6152380, S=..., AObject=0x0) at dbgutilstypepatternlist.pas:319
    #174590 0x00000000005587cd in Add (this=0x7fffe6152380, S=...) at ../objpas/classes/stringl.inc:1943
    #174591 0x0000000000eaf166 in AddObject (this=0x7fffe6152380, S=..., AObject=0x0) at dbgutilstypepatternlist.pas:319
    #174592 0x00000000005587cd in Add (this=0x7fffe6152380, S=...) at ../objpas/classes/stringl.inc:1943
    #174593 0x0000000000eaf166 in AddObject (this=0x7fffe6152380, S=..., AObject=0x0) at dbgutilstypepatternlist.pas:319
    #174594 0x00000000005587cd in Add (this=0x7fffe6152380, S=...) at ../objpas/classes/stringl.inc:1943
    #174595 0x0000000001467daa in DoEnvOptsLoaded () at idedebuggervalueformattersetup.pas:27
    #174596 0x0000000000a7c209 in RunBootHandlers (ht=libhEnvironmentOptionsLoaded) at lazideintf.pas:646
    #174597 0x00000000004e532a in LoadGlobalOptions (this=0x7fffe683f750) at main.pp:1426
    #174598 0x00000000004e61e8 in Create (this=0x7fffe683f750, $vmt=0x1, TheOwner=0x7ffff4e49010) at main.pp:1580
    #174599 0x0000000000425608 in $main () at lazarus.pp:144
  • Add function:
    function TStringList.Add(const S: string): Integer;
    
    begin
      Result := AddObject(S, nil);
    end;
  • AddObject function:
    function TDbgTypePatternList.AddObject(const S: string; AObject: TObject
      ): Integer;
    begin
      if AObject=nil then ;
      Result := Add(S); // used in assign, ignore object from other list
    end;
Edited by BZZZZ
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information