Codetools throws a SIGSEGV when trying to jump in code
Original Reporter info from Mantis: JuhaManninen @JuhaManninen
-
Reporter name: Juha Manninen
Original Reporter info from Mantis: JuhaManninen @JuhaManninen
- Reporter name: Juha Manninen
Description:
When trying to jump in code with Ctrl-Click or completing code there is a SIGSEGV.
it is caused by a Nil variable reference in TLinkScanner.SearchIncludeFile.
Here:
// then search the include file from fpc.cfg (-Fi option)
UnitSet:=CodeToolBoss.GetUnitSetForDirectory('');
if UnitSet<>nil then begin
CfgCache:=UnitSet.GetConfigCache(false); <-- CfgCache gets Nil
if CfgCache.Includes.GetString(AFilename,ExpFilename) then begin
NewCode:=LoadSourceCaseLoUp(ExpFilename);
Result:=(NewCode<>nil);
if Result then exit;
end;
end;
Revision 54438 by Maciej:
"CodeTools: find all *.ini files located in paths declared in fpc.cfg (-Fi option)"
A backtrace pasted to Additional information.
Additional information:
Program received signal SIGSEGV, Segmentation fault.
0x00000000008f66b3 in FINDNODE (this=0x0, S=0x7fffe4cf3598 'lcl_defines.inc') at codetoolsstructs.pas:771
771 Result:=FTree.FindKey(Pointer(s),FCompareKeyItemFunc);
(gdb) bt
#0 0x00000000008f66b3 in FINDNODE (this=0x0, S=0x7fffe4cf3598 'lcl_defines.inc') at codetoolsstructs.pas:771
#1 0x00000000008f78af in GETSTRING (this=0x0, NAME=0x7fffe4cf3598 'lcl_defines.inc', VALUE=0x0) at codetoolsstructs.pas:1046
#2 0x0000000000912e08 in SEARCHCASEDININCPATH (parentfp=0x7fffffffb4e0, RELFILENAME=0x7fffe4cf3598 'lcl_defines.inc') at linkscanner.pas:4003
#3 0x0000000000912a21 in SEARCHINCLUDEFILE (this=0x7fffe4dd6490, AFILENAME=0x7fffe4cf3598 'lcl_defines.inc', NEWCODE=0x0, MISSINGINCLUDEFILE=0x0) at linkscanner.pas:4075
#4 0x0000000000913351 in INCLUDEFILE (this=0x7fffe4dd6490, AFILENAME=0x7fffe4cf37d8 'lcl_defines.inc') at linkscanner.pas:4094
#5 0x0000000000912367 in INCLUDEDIRECTIVE (this=0x7fffe4dd6490) at linkscanner.pas:3888
#6 0x000000000090d89c in SHORTSWITCHDIRECTIVE (this=0x7fffe4dd6490) at linkscanner.pas:3202
#7 0x000000000090da35 in DODIRECTIVE (this=0x7fffe4dd6490, STARTPOS=743, DIRLEN=1) at linkscanner.pas:3221
#8 0x0000000000907784 in HANDLEDIRECTIVE (this=0x7fffe4dd6490) at linkscanner.pas:1757
#9 0x0000000000909212 in READCURLYCOMMENT (this=0x7fffe4dd6490) at linkscanner.pas:2189
#10 0x0000000000907a1c in READNEXTTOKEN (this=0x7fffe4dd6490) at linkscanner.pas:1801
#11 0x0000000000908b96 in SCAN (this=0x7fffe4dd6490, RANGE=LSRIMPLEMENTATIONSTART, CHECKFILESONDISK=true) at linkscanner.pas:2100
#12 0x0000000000990c3e in BEGINPARSING (this=0x7fffe4dd7fd0, RANGE=LSRIMPLEMENTATIONSTART) at customcodetool.pas:1992
#13 0x00000000009aff9e in BEGINPARSING (this=0x7fffe4dd7fd0, RANGE=LSRIMPLEMENTATIONSTART) at finddeclarationtool.pas:8354
#14 0x0000000000976141 in BUILDTREE (this=0x7fffe4dd7fd0, RANGE=LSRIMPLEMENTATIONSTART) at pascalparsertool.pas:598
#15 0x00000000009aebe9 in BUILDINTERFACEIDENTIFIERCACHE (this=0x7fffe4dd7fd0, EXCEPTIONONNOTUNIT=true) at finddeclarationtool.pas:8158
#16 0x00000000009ae9da in FINDIDENTIFIERININTERFACE (this=0x7fffe4dd7fd0, ASKINGTOOL=0x7fffe5b20b30, PARAMS=0x7fffe5ea1340) at finddeclarationtool.pas:8044
#17 0x00000000009ae485 in FINDIDENTIFIERINUSESSECTION (this=0x7fffe5b20b30, USESNODE=0x7fffe4fe8040, PARAMS=0x7fffe5ea1340, FINDMISSINGFPCUNITS=true) at finddeclarationtool.pas:7952
#18 0x00000000009a1dd5 in FINDIDENTIFIERINCONTEXT (this=0x7fffe5b20b30, PARAMS=0x7fffe5ea1340, IDENTFOUNDRESULT=(IFRABORTSEARCH | unknown: 1431655764)) at finddeclarationtool.pas:4860
#19 0x00000000009aba70 in FINDIDENTIFIERINCONTEXT (this=0x7fffe5b20b30, PARAMS=0x7fffe5ea1340) at finddeclarationtool.pas:7092
#20 0x00000000009ac805 in FINDANCESTOROFCLASSINHERITANCE (this=0x7fffe5b20b30, IDENTIFIERNODE=0x7fffe6ffd260, RESULTPARAMS=0x7fffe5ea0a40, FINDCLASSCONTEXT=true) at finddeclarationtool.pas:7382
#21 0x00000000009ad4c6 in FINDIDENTIFIERINANCESTORS (this=0x7fffe5b20b30, CLASSNODE=0x7fffe4fe9460, PARAMS=0x7fffe5ea0a40, IDENTFOUNDRESULT=(IFRABORTSEARCH | unknown: 1431655764))
at finddeclarationtool.pas:7629
#22 0x00000000009a20ea in SEARCHNEXTNODE (parentfp=0x7fffffffc0f0) at finddeclarationtool.pas:4553
#23 0x00000000009a1eb5 in FINDIDENTIFIERINCONTEXT (this=0x7fffe5b20b30, PARAMS=0x7fffe5ea0a40, IDENTFOUNDRESULT=(IFRABORTSEARCH | unknown: 1431655764)) at finddeclarationtool.pas:4901
#24 0x00000000009aba70 in FINDIDENTIFIERINCONTEXT (this=0x7fffe5b20b30, PARAMS=0x7fffe5ea0a40) at finddeclarationtool.pas:7092
#25 0x00000000009b2f39 in RESOLVEIDENTIFIER (parentfp=0x7fffffffc310) at finddeclarationtool.pas:9030
#26 0x00000000009b0b0a in FINDEXPRESSIONTYPEOFTERM (this=0x7fffe5b20b30, STARTPOS=206, ENDPOS=218, PARAMS=0x7fffe5ea0a40, WITHASOPERATOR=false, ALIASTYPE=0x0) at finddeclarationtool.pas:9610
#27 0x00000000009a16c1 in FINDDECLARATIONOFIDENTATPARAM (this=0x7fffe5b20b30, PARAMS=0x7fffe5ea0a40, EXPRTYPE=...) at finddeclarationtool.pas:3836
#28 0x000000000099a95a in FINDDECLARATION (this=0x7fffe5b20b30, CURSORPOS=..., SEARCHSMARTFLAGS=..., NEWEXPRTYPE=..., NEWPOS=..., NEWTOPLINE=1431655765) at finddeclarationtool.pas:2378
#29 0x000000000099b444 in FINDDECLARATION (this=0x7fffe5b20b30, CURSORPOS=..., SEARCHSMARTFLAGS=..., NEWTOOL=0x5555555555555555, NEWNODE=0x5555555555555555, NEWPOS=..., NEWTOPLINE=1431655765)
at finddeclarationtool.pas:2450
#30 0x000000000092c14a in FINDDECLARATION (this=0x7ffff7ff7530, CODE=0x7fffe4ae4520, X=19, Y=16, NEWCODE=0x5555555555555555, NEWX=1431655765, NEWY=1431655765, NEWTOPLINE=1431655765, FLAGS=...)
at codetoolmanager.pas:2024
#31 0x00000000004ebd95 in SRCNOTEBOOKMOUSELINK (this=0x7fffe851e4d0, SENDER=0x7fffe6edac30, X=19, Y=16, ALLOWMOUSELINK=true) at main.pp:11775
#32 0x0000000000a556fb in ISLINKABLE (this=0x7fffe6edac30, Y=16, X1=19, X2=31) at synedit.pp:5987
#33 0x0000000000f41876 in INTERNALUPDATECTRLMOUSE (this=0x7fffe7144ca0) at syneditmarkupctrlmouselink.pp:172
#34 0x0000000000f41762 in UPDATECTRLMOUSE (this=0x7fffe7144ca0) at syneditmarkupctrlmouselink.pp:144
#35 0x0000000000f415b7 in SETLASTMOUSECARET (this=0x7fffe7144ca0, AVALUE=...) at syneditmarkupctrlmouselink.pp:97
#36 0x0000000000a57700 in SETLASTMOUSECARET (this=0x7fffe6edac30, AVALUE=...) at synedit.pp:6413
#37 0x0000000000a48fef in MOUSEMOVE (this=0x7fffe6edac30, SHIFT=..., X=295, Y=303) at synedit.pp:3614
#38 0x00000000006c92a1 in WMMOUSEMOVE (this=0x7fffe6edac30, MESSAGE=...) at include/control.inc:4306