View Issue Details

IDProjectCategoryView StatusLast Update
0020103LazarusIDEpublic2011-10-08 11:04
ReportercobinesAssigned ToMattias Gaertner 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformWin32OSWindows XPOS VersionSP3
Product Version0.9.31 (SVN)Product Build32126 
Target VersionFixed in Version 
Summary0020103: Crash when displaying hint of unit in uses clause
DescriptionStart new project, move mouse over a unit in uses clause, IDE will crash:

Program received signal SIGSEGV, Segmentation fault.
0x00708531 in TCODEHELPMANAGER__CODENODETOELEMENTNAME (TOOL=0x0,
    CODENODE=0x0, this=<error reading variable>, result=0x0)
    at codehelp.pas:1846
1846 if CodeNode.Desc in AllSourceTypes then begin
#0 0x00708531 in TCODEHELPMANAGER__CODENODETOELEMENTNAME (TOOL=0x0,
    CODENODE=0x0, this=<error reading variable>, result=0x0)
    at codehelp.pas:1846
        TOOL = 0x0
        CODENODE = 0x0
        NODENAME = 0x0
        CODENODETOELEMENTNAME = 0x8cdfb44
        RESULT = 0x8cdfb44
0000001 0x00709905 in TCODEHELPMANAGER__GETHTMLHINT (CODE=0x91c2328, X=25, Y=8,
    OPTIONS=..., BASEURL=0xdc8e38 'lazdoc://',
    HTMLHINT=0xa56d530 '<div class="header">
'0000013#10' <a href="source://E:\devel\lazarus\lcl\fileutil.pas(1,1)">E:\<wbr/>devel\<wbr/>lazarus\<wbr/>lcl\<wbr/>fileutil.pas(1,1)</a>'0000013#10'</div>'0000013#10, CACHEWASUSED=true,
    this=<error reading variable>) at codehelp.pas:2296
        CODE = 0x91c2328
        X = 25
        result = CHPRFAILED
        CURSORPOS = {X = 25, Y = 8, CODE = 0x91c2328}
        CTTOOL = 0x0
        CTNODE = 0x0
        XYPOS = {X = 1, Y = 1, CODE = 0x91c66a8}
        ATOPLINE = 1
        CTHINT = 0x0
        LISTOFPCODEXYPOSITION = 0x0
        ELEMENTNAME = 0x0
        ANOWNER = 0x0
        FPDOCFILENAME = 0x0
        FPDOCFILE = 0x0
        COMPLETE = true
        ELEMENTNODE = 0x12e450
        ELEMENTNAMES = 0x9c6f088
        I = 1238016
        OLDXYPOS = {X = 175325432, Y = 147716912, CODE = 0x644a91}
        OLDCTTOOL = 0x0
        OLDCTNODE = 0x8cdfb60
        N = 1
        LASTOWNER = 0x0
        S = 0x0
        CMD = 0x8cdfb30
        GETHTMLHINT = CHPRFAILED
        RESULT = CHPRFAILED
0000002 0x007038ae in TIDEHELPMANAGER__GETHINTFORSOURCEPOSITION (
    EXPANDEDFILENAME=0xa7340f8 'unit1.pas', CODEPOS=...,
    BASEURL=0xdc8e38 'lazdoc://',
    HTMLHINT=0xa56d530 '<div class="header">
'0000013#10' <a href="source://E:\devel\lazarus\lcl\fileutil.pas(1,1)">E:\<wbr/>devel\<wbr/>lazarus\<wbr/>lcl\<wbr/>fileutil.pas(1,1)</a>'0000013#10'</div>'0000013#10, FLAGS=...,
    this=<error reading variable>) at idehelpmanager.pas:1548
        EXPANDEDFILENAME = 0xa7340f8 'unit1.pas'
        result = 4662496
        CODE = 0x91c2328
        CACHEWASUSED = true
        HINTFLAGS = [CHHODECLARATIONHEADER]
        GETHINTFORSOURCEPOSITION = 4662496
        RESULT = 4662496
0000003 0x00472607 in TMAINIDE__ONSRCNOTEBOOKSHOWHINTFORSOURCE (
    SRCEDIT=0xa3d7690, CLIENTPOS=..., CARETPOS=...,
    this=<error reading variable>) at main.pp:16218
        SRCEDIT = 0xa3d7690
        CLIENTPOS = {X = 425, Y = 224}
        CARETPOS = {X = 25, Y = 8}
        ACTIVEUNITINFO = 0xa528278
        BASEURL = 0xdc8e38 'lazdoc://'
        SMARTHINTSTR = 0xa56d530 '<div class="header">
'0000013#10' <a href="source://E:\devel\lazarus\lcl\fileutil.pas(1,1)">E:\<wbr/>devel\<wbr/>lazarus\<wbr/>lcl\<wbr/>fileutil.pas(1,1)</a>'0000013#10'</div>'0000013#10
        EXPRESSION = 0x0
        DEBUGEVAL = 0x0
        DEBUGEVALDEREFER = 0x0
        DBGTYPE = 0x909bcb
        DBGTYPEDEREFER = 0x8cdfc50
        HASHINT = false
        P = 25
0000004 0x00789351 in TSOURCENOTEBOOK__SHOWSYNEDITHINT (MOUSEPOS=...,
    this=<error reading variable>) at sourceeditor.pp:7410
        EDITPOS = {X = 425, Y = 224}
        ASRCEDIT = 0xa3d7690
        ASYNEDIT = 0xa4c76b8
        EDITCARET = {X = 25, Y = 8}
        AMARK = 0x8cdfcec
        I = 147717336
        HINTSTR = 0x0
        CURHINT = 0x0
        MLINE = 0x0
0000005 0x00789081 in TSOURCENOTEBOOK__HINTTIMER (SENDER=0xa705d20,
    this=<error reading variable>) at sourceeditor.pp:7340
        SENDER = 0xa705d20
        MOUSEPOS = {X = 426, Y = 396}
        ACONTROL = 0xa4c76b8
0000006 0x005b2b63 in TCUSTOMTIMER__DOONTIMER (this=<error reading variable>)
    at customtimer.pas:181
No locals.
0000007 0x005b2aea in TCUSTOMTIMER__TIMER (this=<error reading variable>)
    at customtimer.pas:156
No locals.
0000008 0x0052e670 in TIMERCALLBACKPROC (WINDOW_HWND=0, MSG=275, IDEVENT=716,
    DWTIME=19285320) at ./win32/win32callback.inc:2661
        TIMERINFO = 0x927c500
        N = 0
0000009 0x7e368734 in USER32!GetDC () from C:\WINDOWS\system32\user32.dll
No symbol table info available.
0000010 0x00000000 in ?? ()
No symbol table info available.


When not running in GDB it often does not crash at you don't even notice but a few times IDE exited unexpectedly, so I ran a session in GDB. I'm hoping this was it.
TagsNo tags attached.
Fixed in Revision32460
LazTarget-
Widgetset
Attached Files

Relationships

has duplicate 0019839 resolvedMattias Gaertner SIGSEGV/AV in CodeTools 

Activities

FWIW it can be worked-around with:

------------------------------- ide/codehelp.pas -------------------------------
index d0f1f2c..6b79c29 100644
@@ -2355,7 +2355,7 @@ begin
           OldCTNode:=CTNode;
           if (not OldCTTool.FindDeclaration(OldXYPos,[fsfSearchSourceName],
             CTTool,CTNode,XYPos,aTopLine))
- or (CTNode=OldCTNode)
+ or (CTNode=OldCTNode) or (CTNode=nil)
           then begin
             {$ifdef VerboseLazDoc}
             debugln(['TCodeHelpManager.GetHTMLHint inherited not found: ',dbgs(OldXYPos)]);
Cobines, Mattias had committed 2 related fixes. Can you please try r32166 or above?

cobines

2011-09-03 23:04

reporter   ~0051433

The crash still happens. It is the FindDeclaration in line 2275 that returns CTNode=nil. If I add a similar check there as in commit 32166 it doesn't crash anymore.

cobines

2011-09-22 23:44

reporter   ~0052118

Fixed in revision 32460.

Juha Manninen

2011-10-08 09:40

developer   ~0052770

Fixed together with other issues.

Issue History

Date Modified Username Field Change
2011-08-31 00:20 cobines New Issue
2011-08-31 00:49 Flávio Etrusco (notifications not working) Relationship added has duplicate 0019839
2011-08-31 11:13 Flávio Etrusco (notifications not working) Note Added: 0051311
2011-09-03 22:08 Flávio Etrusco (notifications not working) LazTarget => -
2011-09-03 22:08 Flávio Etrusco (notifications not working) Note Added: 0051427
2011-09-03 22:08 Flávio Etrusco (notifications not working) Assigned To => Mattias Gaertner
2011-09-03 22:08 Flávio Etrusco (notifications not working) Status new => feedback
2011-09-03 23:04 cobines Note Added: 0051433
2011-09-22 23:44 cobines Note Added: 0052118
2011-10-08 09:40 Juha Manninen Fixed in Revision => 32460
2011-10-08 09:40 Juha Manninen Status feedback => resolved
2011-10-08 09:40 Juha Manninen Resolution open => fixed
2011-10-08 09:40 Juha Manninen Note Added: 0052770
2011-10-08 11:04 cobines Status resolved => closed