[Lazarus] lazarus 1.6+fpc 2.6.4, win32, crashes in iphtml.pas

Luca Olivetti luca at wetron.es
Thu Sep 29 19:35:33 CEST 2016


Hello,

I'm playing with lazarus 1.6 (a bit late, I know) with fpc 2.6.4, win32, 
  and I have a strange problem with the ide:
the object inspector information box shows nothing and, eventually, when 
I click on fields in the object inspector, lazarus becomes unresponsive 
and then crashes.
If try to begug the ide under lazarus (tried both with the old 1.4.4 and 
the new 1.6), I see that it crashes in the heap manager (heap.inc) when 
it tries to allocate 1117978624 bytes (!)
This is the call stack:

#0 HANDLEERRORADDRFRAME(-1, 0x7c9201e0, 0x7c91e920) at 
D:\fpc-2.6.4\rtl\inc\system.inc:962
#1 HANDLEERRORFRAME(203, 0x10f6f92c) at D:\fpc-2.6.4\rtl\inc\system.inc:992
#2 HANDLEERROR(203) at D:\fpc-2.6.4\rtl\inc\system.inc:1002
#3 ALLOC_OSCHUNK(0x17619c4, 0, 1117978624) at 
D:\fpc-2.6.4\rtl\inc\heap.inc:833
#4 SYSGETMEM_VAR(1117973760) at D:\fpc-2.6.4\rtl\inc\heap.inc:1006
#5 SYSGETMEM(1117973760) at D:\fpc-2.6.4\rtl\inc\heap.inc:1050
#6 GETMEM(0x1b, 1117973745) at D:\fpc-2.6.4\rtl\inc\heap.inc:251
#7 NEWANSISTRING(1117973736) at D:\fpc-2.6.4\rtl\inc\astrings.inc:64
#8 FPC_TRUELY_ANSISTR_UNIQUE(0xfda683) at 
D:\fpc-2.6.4\rtl\inc\astrings.inc:659
#9 fpc_ansistr_unique at D:\fpc-2.6.4\rtl\i386\i386.inc:1585
#10 UPPERCASE(0xfda683 #255#139'E'#152#137'E'#248#198'E'#224, 0xfda683 
#255#139'E'#152#137'E'#248#198'E'#224) at 
D:\fpc-2.6.4\rtl\objpas\sysutils\sysstr.inc:97
#11 TIPHTML__NEXTTOKEN(<error reading variable>) at iphtml.pas:5132
#12 TIPHTML__PARSEHEAD(0x154e04c0, <error reading variable>) at 
iphtml.pas:5451
#13 TIPHTML__PARSEHTML(<error reading variable>) at iphtml.pas:7474
#14 TIPHTML__PARSE(<error reading variable>) at iphtml.pas:7538
#15 TIPHTML__LOADFROMSTREAM(0x131e14c0, <error reading variable>) at 
iphtml.pas:4725
#16 TLAZIPHTMLCONTROL__SETHTMLCONTENT(0x131e14c0, 0x0, <error reading 
variable>) at ipidehtmlcontrol.pas:368
#17 TMAINIDE__OICHANGEDTIMERTIMER(0x1324fc48, <error reading variable>) 
at main.pp:11811
#18 TCUSTOMTIMER__DOONTIMER(<error reading variable>) at customtimer.pas:175
#19 TCUSTOMTIMER__TIMER(<error reading variable>) at customtimer.pas:150
#20 TIMERCALLBACKPROC(0, 275, 20158, 489829657) at 
.\win32\win32callback.inc:2773
#21 USER32!GetDC at :0
#22 ?? at :0

The strange things is the transition between #10 and #11, line 5132 of 
iphtml.pas *doesn't* call uppercase, it is

    ParmName := ParmString

and ParmString is

   function ParmString: string;
   begin
     if PBW = 0 then
       Result := ''
     else begin
       ParmBuf[PBW] := #0;
       Result := StrPas(ParmBuf);
       PBW := 0;
     end;
   end;

Maybe there's a stray pointer somewhere that messes up the stack?
If I uninstall turbopower_ipro I get the plain text information box in 
the object inspector and no crashes.

If I run lazarus directly under gdb, I get a different backtrace (but 
still crashes in TIpHtml.ParseHead):

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 3692.0x340]
fpc_ansistr_decr_ref (S=0xfda682) at D:/fpc-2.6.4/rtl/i386/i386.inc:1542
1542            decl    (%edx)
(gdb) bt
#0  fpc_ansistr_decr_ref (S=0xfda682) at D:/fpc-2.6.4/rtl/i386/i386.inc:1542
#1  0x10f6f810 in ?? ()
#2  0x00fdb714 in TIPHTML__PARSEHEAD (PARENT=0x13821af0,
     this=<error reading variable>) at iphtml.pas:5451
#3  0x00fe2865 in TIPHTML__PARSEHTML (this=<error reading variable>)
     at iphtml.pas:7474
#4  0x00fe2b96 in TIPHTML__PARSE (this=<error reading variable>)
     at iphtml.pas:7538
#5  0x00fd99fa in TIPHTML__LOADFROMSTREAM (S=0x1388c0c8,
     this=<error reading variable>) at iphtml.pas:4725
#6  0x01032007 in TLAZIPHTMLCONTROL__SETHTMLCONTENT (STREAM=0x1388c0c8,
     NEWURL=0x0, this=<error reading variable>) at ipidehtmlcontrol.pas:368
#7  0x00793a62 in DOHTML (parentfp=0x10f6fa84) at idehelpintf.pas:345
#8  0x00793913 in THINTWINDOWMANAGER__SHOWHINT (SCREENPOS=...,
     THEHINT=0x14ad8838 '<html><head><link rel="stylesheet" 
href="lazdoc://lazarus/lazdoc.css" type="text/css">'#13#10'<meta 
http-equiv="Content-Type" content="text/html; 
charset=utf-8"></head>'#13#10'<body>'#13#10'<div class="header"> 
<nobr>'..., this=<error reading variable>) at idehelpintf.pas:367
#9  0x00849258 in TSOURCEEDITORHINTWINDOWMANAGER__ACTIVATEHINT (
     SCREENRECT=..., ABASEURL=0x138b56c 'lazdoc://',
     AHINT=0x14ad8838 '<html><head><link rel="stylesheet" 
href="lazdoc://lazarus/lazdoc.css" type="text/css">'#13#10'<meta 
http-equiv="Content-Type" content="text/html; 
charset=utf-8"></head>'#13#10'<body>'#13#10'<div class="header"> 
<nobr>'..., AAUTOSHOWN=true, this=<error reading variable>)
     at sourceeditor.pp:1907
#10 0x0086589b in TSOURCEEDITORMANAGER__ACTIVATEHINT (SCREENRECT=...,
     BASEURL=0x138b56c 'lazdoc://',
     THEHINT=0x14ad8838 '<html><head><link rel="stylesheet" 
href="lazdoc://lazaru
s/lazdoc.css" type="text/css">'#13#10'<meta http-equiv="Content-Type" 
content="t
ext/html; charset=utf-8"></head>'#13#10'<body>'#13#10'<div 
class="header">  <nob
r>'..., AUTOSHOWN=true, this=<error reading variable>)
     at sourceeditor.pp:10685
#11 0x0084dbf0 in TSOURCEEDITOR__ACTIVATEHINT (CLIENTRECT=...,
     ABASEURL=0x138b56c 'lazdoc://',
     AHINT=0x14ad8838 '<html><head><link rel="stylesheet" 
href="lazdoc://lazarus/
lazdoc.css" type="text/css">'#13#10'<meta http-equiv="Content-Type" 
content="tex
t/html; charset=utf-8"></head>'#13#10'<body>'#13#10'<div class="header"> 
  <nobr>
'..., AAUTOSHOWN=true, this=<error reading variable>)
     at sourceeditor.pp:3304
#12 0x00470cd8 in TMAINIDE__ONSRCNOTEBOOKSHOWHINTFORSOURCE (
     SRCEDIT=0x128142c0, CARETPOS=..., AUTOSHOWN=true,
     this=<error reading variable>) at main.pp:10818
#13 0x0086074a in TSOURCENOTEBOOK__SHOWSYNEDITHINT (MOUSEPOS=...,
     this=<error reading variable>) at sourceeditor.pp:8860
#14 0x00849745 in TSOURCEEDITORHINTWINDOWMANAGER__HINTTIMER (
     SENDER=0x1337d598, this=<error reading variable>) at 
sourceeditor.pp:1991
#15 0x006009a3 in TCUSTOMTIMER__DOONTIMER (this=<error reading variable>)
     at customtimer.pas:175
#16 0x0060092a in TCUSTOMTIMER__TIMER (this=<error reading variable>)
     at customtimer.pas:150
#17 0x005581a0 in TIMERCALLBACKPROC (WINDOW_HWND=0, MSG=275, IDEVENT=18759,
     DWTIME=489955458) at ./win32/win32callback.inc:2773
#18 0x7e398734 in USER32!GetDC () from C:\WINDOWS\system32\user32.dll
#19 0x00000000 in ?? ()
(gdb)


I tried both 1.6 and the fixes_1_6 branch with the same result.

Under Linux, where I'm using fpc 3.0.0, I have no such problems.

Bye
-- 
Luca Olivetti
Wetron Automation Technology http://www.wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007


More information about the Lazarus mailing list