[lazarus] Heaptrc

Mattias Gaertner nc-gaertnma at netcologne.de
Mon Nov 10 17:35:48 EST 2003


On Mon, 10 Nov 2003 14:54:24 +0100
"Marc Weustink" <marc.weustink at cuperus.nl> wrote:

> + From: Mattias Gaertner [mailto:nc-gaertnma at netcologne.de]
> + Sent: zondag 9 november 2003 1:35
> +
> + On Sat, 08 Nov 2003 18:15:15 -0600
> + Bob Wingard <bwingard at gt.rr.com> wrote:
> +
> + > I have to start the program outside the IDE. If I start inside the IDE
> + > the debugger tries to start but loops,

fixed


> [...]
> The error:
> SIGSEGV @ $0810f52a  _SYSLINUX$$_GET_CALLER_ADDR$LONGINT
> 
> The callstack:
> 0 0810f52a _SYSLINUX$$_GET_CALLER_ADDR$LONGINT()
> 1 0810d668 _HEAPTRC$$_TRACEGETMEM$LONGINT()
> 2 081160b0 _SYSLINUX$$_ASMGETMEM$POINTER$LONGINT()
> 3 0811540a _SYSLINUX$$_PUSHEXCEPTADDR$LONGINT()
> 4 08071b64 INDEXOFSTYLE(WNAME: $8125af5)  gtkproc.inc:4490
> 5 08071cce RELEASESTYLE(WNAME: $8125af5)  gtkproc.inc:4542
> 6 08077732 GTKSTYLECHANGED(WIDGET: $8942e70, PREVIOUS_STYLE: $0, DATA:
> $816b834)  gtkcallback.inc:3171
> 7 401ab181 gtk_marshal_NONE__POINTER ()  /usr/lib/libgtk-1.2.so.0
> 
> From the IDE output:
> [TDebugManager.OnDebuggerChangeState] state: dsPause
> TCmdLineDebugger.SendCmdLn "-stack-info-depth"
> TCmdLineDebugger.SendCmdLn "-stack-list-arguments 1 7 7"
> TCmdLineDebugger.SendCmdLn "-stack-list-frames 7 7"
> 
> you can see that the IDE tries to find the source for the error, however
> it starts looking at entry 7 (why 7 and not start at 0 ?)

fixed


> and it stays there.
> In normal situations the last entry on the callstack is application.run
> and there we can find sources for. In this case we don't have the source
> and my guess is that the IDE hangs on this.
> Thats error one.


> Why the exeption is raised the first place, i don't know. Don't have all
> sources here, but I guess again that GTKSTYLECHANGED is trying to release
> the nil PREVIOUS_STYLE

I guess not. 
The exception is raised, while creating the ansistring exception frame. It
seems heaptrc spotted an overrun. 

Bob, please use the memcheck unit (deactivate the use of the heaptrc unit).
Compile the memcheck unit with -dExtra (or add {$DEFINE EXTRA} at start).
This will activate the "keepreleased". Also set quicktrace to false. Your
program will become very slow due to the massive tests. Don't do this with
the IDE unless you have a fast machine with lots of ram.
If it is a buffer overrun, this will spot it much earlier.


Mattias






More information about the Lazarus mailing list