Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2003-11

Heaptrc

16 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mattias Gaertner
to Bob Wingard: Any time I try and link with heaptrc the resulting application raises and exception as…
I have to start the program outside the IDE. If I start inside the IDE the debugger tries to start but loops,

Hmm, a debugger that loops is buggy itself.
Marc, maybe we should add some smarter functions to read big call stacks.

my processor maxes out and Lazarus just hangs. I have not tried to start gdb from the command line yet.

Please do so.

If I compile without Heaptrc then everything works fine.

Maybe you want to try the memcheck unit in the components/units dir of lazarus. Dont add the heaptrc unit and add memcheck as the very first unit in the lpr file.

Mattias

Show quoted text 33 lines
Bob On Sat, 2003-11-08 at 18:09, Mattias Gaertner wrote: > On Sat, 08 Nov 2003 16:29:24 -0600 > Bob Wingard wrote: > > > Any time I try and link with heaptrc the resulting application raises > > and exception as soon as it starts, followed by a very long stack > > trace. I tried it with the default new application in Lazarus to see > > if it was something in my code and I got the same result. What am I > > missing? > > Can you debug the program? Where does it stop? > > Mattias > > > > > > > Mandrake Linux 9.2 Stock kernel > > CVS version of Lazarus. > > FPC version 1.0.10 [2003/06/26] for i386 > > _________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.lazarus.freepascal.org/mailarchives _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives

Reply by email

Bob Wingard
to Bob Wingard: Any time I try and link with heaptrc the resulting application raises and exception as…

Oh yea, I forgot to add that I installed fpc 1.0.11 just to see if it made a difference, no change.

Bob

Mattias Gaertner wrote 23 lines
On Sat, 08 Nov 2003 16:29:24 -0600 Bob Wingard wrote: > Any time I try and link with heaptrc the resulting application raises > and exception as soon as it starts, followed by a very long stack trace. > I tried it with the default new application in Lazarus to see if it was > something in my code and I got the same result. What am I missing? Can you debug the program? Where does it stop? Mattias > > Mandrake Linux 9.2 Stock kernel > CVS version of Lazarus. > FPC version 1.0.10 [2003/06/26] for i386 _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives

Reply by email

Bob Wingard

Any time I try and link with heaptrc the resulting application raises and exception as soon as it starts, followed by a very long stack trace. I tried it with the default new application in Lazarus to see if it was something in my code and I got the same result. What am I missing?

Mandrake Linux 9.2 Stock kernel
CVS version of Lazarus.
FPC version 1.0.10 [2003/06/26] for i386

TIA

Bob

Reply by email

Bob Wingard
to Bob Wingard

I have to start the program outside the IDE. If I start inside the IDE the debugger tries to start but loops, my processor maxes out and Lazarus just hangs. I have not tried to start gdb from the command line yet. If I compile without Heaptrc then everything works fine.

Bob

Mattias Gaertner wrote 23 lines
On Sat, 08 Nov 2003 16:29:24 -0600 Bob Wingard wrote: > Any time I try and link with heaptrc the resulting application raises > and exception as soon as it starts, followed by a very long stack trace. > I tried it with the default new application in Lazarus to see if it was > something in my code and I got the same result. What am I missing? Can you debug the program? Where does it stop? Mattias > > Mandrake Linux 9.2 Stock kernel > CVS version of Lazarus. > FPC version 1.0.10 [2003/06/26] for i386 _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives

Reply by email

Mattias Gaertner
to Bob Wingard: Any time I try and link with heaptrc the resulting application raises and exception as…
Any time I try and link with heaptrc the resulting application raises and exception as soon as it starts, followed by a very long stack trace. I tried it with the default new application in Lazarus to see if it was something in my code and I got the same result. What am I missing?

Can you debug the program? Where does it stop?

Mattias

Mandrake Linux 9.2 Stock kernel CVS version of Lazarus. FPC version 1.0.10 [2003/06/26] for i386

Reply by email

Bob Wingard
to Bob Wingard: Any time I try and link with heaptrc the resulting application raises and exception as…
Marc Weustink wrote 9 lines
At 01:34 9-11-2003, Mattias Gaertner wrote: >On Sat, 08 Nov 2003 18:15:15 -0600 >Bob Wingard wrote: > > > I have to start the program outside the IDE. If I start inside the IDE > > the debugger tries to start but loops, Eeek. Ehm, what does View->Debug windows->debugoutput say in this case. And is there some output on the console ?

The attached file has the console output for a standard project1 compiled with the heaptrc option set and generate debugging information for gdb. IDE.txt is the output when the program is executed inside the IDE. cmdline.txt is the output from running the program from the command line ./project1 &> cmdline.txt.

Bob

Show quoted text 13 lines
>Hmm, a debugger that loops is buggy itself. >Marc, maybe we should add some smarter functions to read big call stacks. ?? What do you mean here. Is reading the callstack a problem here ? Marc _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bin00081.bin
Type: application/octet-stream
Size: 4707 bytes
Desc: "heaptrcoutput.tgz"
Url : http://localhost/pipermail/lazarus/attachments/20031109/c0bb7581/bin00081.bin

Reply by email

Marc Weustink
to Bob Wingard: Any time I try and link with heaptrc the resulting application raises and exception as…
Mattias Gaertner wrote 20 lines
On Sun, 09 Nov 2003 16:55:30 +0100 Marc Weustink wrote: > At 01:34 9-11-2003, Mattias Gaertner wrote: > >On Sat, 08 Nov 2003 18:15:15 -0600 > >Bob Wingard wrote: > > > > > I have to start the program outside the IDE. If I start inside the IDE > > > the debugger tries to start but loops, > > Eeek. Ehm, what does View->Debug windows->debugoutput say in this case. > And is there some output on the console ? > > >Hmm, a debugger that loops is buggy itself. > >Marc, maybe we should add some smarter functions to read big call stacks. > > ?? What do you mean here. > Is reading the callstack a problem here ? Yes, if the call stack is long.

It is only a problem if you want to watch the callstack.

That is not the case here. The callstack is only 7 calls deep, and since there is no source, the ide tries to find the closest source. It hangs after the first call is retrieved.

Marc

Show quoted text 6 lines
Mattias _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives

Reply by email

Marc Weustink
to Bob Wingard: Any time I try and link with heaptrc the resulting application raises and exception as…
Bob Wingard wrote 16 lines
On Sun, 2003-11-09 at 12:05, Marc Weustink wrote: > At 18:25 9-11-2003, you wrote: > >On Sun, 2003-11-09 at 09:55, Marc Weustink wrote: > > > At 01:34 9-11-2003, Mattias Gaertner wrote: > > > >On Sat, 08 Nov 2003 18:15:15 -0600 > > > >Bob Wingard wrote: > > > > > > > > > I have to start the program outside the IDE. > > > > > If I start inside the IDE the debugger tries > > > > > to start but loops, > > OK, thanx for these. But, can you still give me the output of the > View->Debug windows->Debug Output dialog ? Can't get there, lazarus is totally locked up when this happens. I have to issue a kill [lazarus pid].

Can you open it before running (and make it a bit larger)?

Show quoted text 11 lines
> Somehow it seems that it sucessfull retrieves the topmost call in the > callstack, but after that ???? > Does the same happen if you don't have the "Call Stack" window open ? > I do not have the call stack window open when this happens. just before lazarus hangs I get a message box with the following message. Execution paused Address: $0810F52A Procedure: _SYSLINUX_$$GET_CALLER_ADDR$LONGINT (Some day an assembler window might pop up here :) With an OK button, as soon as I press OK processor usage goes max

OK, now I understand why the callstack is searched. When no source is found, the IDE tries to find the "nearest" available source.

I guess get_caller_addr is used by heaptrc

Hmm... Do you have an sample app to reproduce this ?

Marc

Reply by email

Marc Weustink
to Bob Wingard: Any time I try and link with heaptrc the resulting application raises and exception as…
Mattias Gaertner wrote 5 lines
On Sat, 08 Nov 2003 18:15:15 -0600 Bob Wingard wrote: > I have to start the program outside the IDE. If I start inside the IDE > the debugger tries to start but loops,

Eeek. Ehm, what does View->Debug windows->debugoutput say in this case. And is there some output on the console ?

Hmm, a debugger that loops is buggy itself. Marc, maybe we should add some smarter functions to read big call stacks.

?? What do you mean here.
Is reading the callstack a problem here ?

Marc

Reply by email

Marc Weustink
to Bob Wingard: Any time I try and link with heaptrc the resulting application raises and exception as…
you wrote 17 lines
On Sun, 2003-11-09 at 09:55, Marc Weustink wrote: > At 01:34 9-11-2003, Mattias Gaertner wrote: > >On Sat, 08 Nov 2003 18:15:15 -0600 > >Bob Wingard wrote: > > > > > I have to start the program outside the IDE. If I start inside the IDE > > > the debugger tries to start but loops, > > Eeek. Ehm, what does View->Debug windows->debugoutput say in this case. And > is there some output on the console ? The attached file has the console output for a standard project1 compiled with the heaptrc option set and generate debugging information for gdb. IDE.txt is the output when the program is executed inside the IDE. cmdline.txt is the output from running the program from the command line ./project1 &> cmdline.txt.

OK, thanx for these. But, can you still give me the output of the View->Debug windows->Debug Output dialog ?

Somehow it seems that it sucessfull retrieves the topmost call in the callstack, but after that ????

Does the same happen if you don't have the "Call Stack" window open ?

Another strange thing I noticed:
[TDebugManager.OnDebuggerChangeState] state: dsRun [WARNING] Debugger: Unknown stopped reason:
TCmdLineDebugger.SendCmdLn "-break-insert FPC_RAISEEXCEPTION" TCmdLineDebugger.SendCmdLn "-break-insert FPC_BREAK_ERROR" TCmdLineDebugger.SendCmdLn "info program"
[Debugger] Log output: &"info program\n"
[Debugger] Target PID: 32126
TCmdLineDebugger.SendCmdLn "-exec-continue"
[TDebugManager.OnDebuggerChangeState] state: dsPause

There should have been a dsRun state (the result of the -exec-continue) before the last dsPause.
What version of GDB are you using ? (what's the output of gdb -v)

Marc (puzzeled)

Reply by email

Bob Wingard
to Bob Wingard: Any time I try and link with heaptrc the resulting application raises and exception as…
Marc Weustink wrote 39 lines
At 20:46 9-11-2003, Bob Wingard wrote: >On Sun, 2003-11-09 at 12:05, Marc Weustink wrote: > > At 18:25 9-11-2003, you wrote: > > >On Sun, 2003-11-09 at 09:55, Marc Weustink wrote: > > > > At 01:34 9-11-2003, Mattias Gaertner wrote: > > > > >On Sat, 08 Nov 2003 18:15:15 -0600 > > > > >Bob Wingard wrote: > > > > > > > > > > > I have to start the program outside the IDE. > > > > > > If I start inside the IDE the debugger tries > > > > > > to start but loops, > > > > OK, thanx for these. But, can you still give me the output of the > > View->Debug windows->Debug Output dialog ? > >Can't get there, lazarus is totally locked up when this happens. I have >to issue a kill [lazarus pid]. Can you open it before running (and make it a bit larger)? > > Somehow it seems that it sucessfull retrieves the topmost call in the > > callstack, but after that ???? > > Does the same happen if you don't have the "Call Stack" window open ? > > > I do not have the call stack window open when this happens. > just before lazarus hangs I get a message box with the following >message. Execution paused > Address: $0810F52A > Procedure: _SYSLINUX_$$GET_CALLER_ADDR$LONGINT > (Some day an assembler window might pop up here :) >With an OK button, as soon as I press OK processor usage goes max OK, now I understand why the callstack is searched. When no source is found, the IDE tries to find the "nearest" available source. I guess get_caller_addr is used by heaptrc Hmm... Do you have an sample app to reproduce this ?

Do you want the executable? The dump that I sent was from the default project1, just a form no controls.

Show quoted text 6 lines
Marc _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives

Reply by email

Marc Weustink
to Bob Wingard: Any time I try and link with heaptrc the resulting application raises and exception as…
Bob Wingard wrote 42 lines
On Sun, 2003-11-09 at 15:27, Marc Weustink wrote: > At 20:46 9-11-2003, Bob Wingard wrote: > >On Sun, 2003-11-09 at 12:05, Marc Weustink wrote: > > > At 18:25 9-11-2003, you wrote: > > > >On Sun, 2003-11-09 at 09:55, Marc Weustink wrote: > > > > > At 01:34 9-11-2003, Mattias Gaertner wrote: > > > > > >On Sat, 08 Nov 2003 18:15:15 -0600 > > > > > >Bob Wingard wrote: > > > > > > > > > > > > > I have to start the program outside the IDE. > > > > > > > If I start inside the IDE the debugger tries > > > > > > > to start but loops, > > > > > > OK, thanx for these. But, can you still give me the output of the > > > View->Debug windows->Debug Output dialog ? > > > >Can't get there, lazarus is totally locked up when this happens. I have > >to issue a kill [lazarus pid]. > > Can you open it before running (and make it a bit larger)? > > > > Somehow it seems that it sucessfull retrieves the topmost call in the > > > callstack, but after that ???? > > > Does the same happen if you don't have the "Call Stack" window open ? > > > > > I do not have the call stack window open when this happens. > > just before lazarus hangs I get a message box with the following > >message. Execution paused > > Address: $0810F52A > > Procedure: _SYSLINUX_$$GET_CALLER_ADDR$LONGINT > > (Some day an assembler window might pop up here :) > >With an OK button, as soon as I press OK processor usage goes max > > OK, now I understand why the callstack is searched. When no source is > found, the IDE tries to find the "nearest" available source. > > I guess get_caller_addr is used by heaptrc > > Hmm... Do you have an sample app to reproduce this ? > Do you want the executable? The dump that I sent was from the default project1, just a form no controls.

??
You just create a new project, enable heaptrc, and hit run ?

I tried that.
Can you send the sources and exe to me at my private email ?

Marc

Reply by email

Bob Wingard
to Bob Wingard: Any time I try and link with heaptrc the resulting application raises and exception as…
Marc Weustink wrote 21 lines
At 18:25 9-11-2003, you wrote: >On Sun, 2003-11-09 at 09:55, Marc Weustink wrote: > > At 01:34 9-11-2003, Mattias Gaertner wrote: > > >On Sat, 08 Nov 2003 18:15:15 -0600 > > >Bob Wingard wrote: > > > > > > > I have to start the program outside the IDE. If I start inside the IDE > > > > the debugger tries to start but loops, > > > > Eeek. Ehm, what does View->Debug windows->debugoutput say in this case. > And > > is there some output on the console ? > > The attached file has the console output for a standard project1 >compiled with the heaptrc option set and generate debugging information >for gdb. IDE.txt is the output when the program is executed inside the >IDE. cmdline.txt is the output from running the program from the command >line ./project1 &> cmdline.txt. OK, thanx for these. But, can you still give me the output of the View->Debug windows->Debug Output dialog ?

Can't get there, lazarus is totally locked up when this happens. I have to issue a kill [lazarus pid].

Show quoted text 5 lines
Somehow it seems that it sucessfull retrieves the topmost call in the callstack, but after that ???? Does the same happen if you don't have the "Call Stack" window open ?

I do not have the call stack window open when this happens. just before lazarus hangs I get a message box with the following message. Execution paused
Address: $0810F52A
Procedure: _SYSLINUX_$$GET_CALLER_ADDR$LONGINT
(Some day an assembler window might pop up here :) With an OK button, as soon as I press OK processor usage goes max

Show quoted text 14 lines
Another strange thing I noticed: [TDebugManager.OnDebuggerChangeState] state: dsRun [WARNING] Debugger: Unknown stopped reason: TCmdLineDebugger.SendCmdLn "-break-insert FPC_RAISEEXCEPTION" TCmdLineDebugger.SendCmdLn "-break-insert FPC_BREAK_ERROR" TCmdLineDebugger.SendCmdLn "info program" [Debugger] Log output: &"info program\n" [Debugger] Target PID: 32126 TCmdLineDebugger.SendCmdLn "-exec-continue" [TDebugManager.OnDebuggerChangeState] state: dsPause There should have been a dsRun state (the result of the -exec-continue) before the last dsPause. What version of GDB are you using ? (what's the output of gdb -v)

GNU gdb 5.3-25mdk (Mandrake Linux)
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i586-mandrake-linux-gnu".

Show quoted text 7 lines
Marc (puzzeled) _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives

Reply by email

Marc Weustink
to Mattias Gaertner: On Sat, 08 Nov 2003 18:15:15 -0600 Hmm, a debugger that loops is buggy itself. Marc,…

+ From: Mattias Gaertner
+ Sent: zondag 9 november 2003 1:35
+
+ On Sat, 08 Nov 2003 18:15:15 -0600
+ Bob Wingard wrote:
+
+ > I have to start the program outside the IDE. If I start inside the IDE
+ > the debugger tries to start but loops,
+
+ Hmm, a debugger that loops is buggy itself.
+ Marc, maybe we should add some smarter functions to read big
+ call stacks.
+
+
+ > my processor maxes out and
+ > Lazarus just hangs. I have not tried to start gdb from the
+ command line
+ > yet.
+
+ Please do so.

OK, after some mail conversation with Bob, I reconstructed the callstack (created with gdb, without lazarus).

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

Reply by email

Mattias Gaertner
to Bob Wingard: Any time I try and link with heaptrc the resulting application raises and exception as…
Show quoted text 15 lines
At 01:34 9-11-2003, Mattias Gaertner wrote: >On Sat, 08 Nov 2003 18:15:15 -0600 >Bob Wingard wrote: > > > I have to start the program outside the IDE. If I start inside the IDE > > the debugger tries to start but loops, Eeek. Ehm, what does View->Debug windows->debugoutput say in this case. And is there some output on the console ? >Hmm, a debugger that loops is buggy itself. >Marc, maybe we should add some smarter functions to read big call stacks. ?? What do you mean here. Is reading the callstack a problem here ?

Yes, if the call stack is long.

Mattias

Reply by email

Mattias Gaertner
to Mattias Gaertner: On Sat, 08 Nov 2003 18:15:15 -0600 Hmm, a debugger that loops is buggy itself. Marc,…
Show quoted text 8 lines
+ From: Mattias Gaertner + Sent: zondag 9 november 2003 1:35 + + On Sat, 08 Nov 2003 18:15:15 -0600 + Bob Wingard wrote: + + > I have to start the program outside the IDE. If I start inside the IDE + > the debugger tries to start but loops,

fixed

Show quoted text 23 lines
[...] 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

Show quoted text 5 lines
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

Reply by email