Sign in Join

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

Mailing lists / fpc-pascal / 2010-11

debugging faulty pointer

3 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

tim launchbury

Hello all

I have an app I am writing for work, using fpgui and fpc v2.4.2 on Mandriva Linux 2010.1,and it appears to have a problem. If I compile it with -gh and -gc flags it crashes on startup with the following message

pointer $09BB93BC does not point to valid memory block Marked memory at $09BB93FC invalid
Wrong signature $00000000 instead of 3B1E2C54
$0808D487 line 501 of SSIMainForm.pas

It also says

No heap dump by heaptrc unit
Exitcode = 204

If I run it under gdb then the address of the pointer is different. However if I put a breakpoint at line 501 of SSIMainForm.pas it is never reached, but exits before.

I am faily sure that the problem is not in fpgui or fpc, as I have compiled the fpghi examples with the same compiler flags and they run with no problem.

If I use either -gh or -gc but not both then the problem goes away.

I have built fpgui with debug flags and tried single stepping through all the code from the start of my program but with no success.

Does anyone have any suggestions on how to proceed with debugging this?

Regards

Tim

PS Congratulations to the fpc team for the compiler and Graeme for fpgui;
both some of the best software I have ever worked with.
Jonas Maebe
to tim launchbury
tim launchbury wrote 8 lines
If I use either -gh or -gc but not both then the problem goes away. I have built fpgui with debug flags and tried single stepping through all the code from the start of my program but with no success. Does anyone have any suggestions on how to proceed with debugging this?

Compile with -gv, and run the program under Valgrind.

Jonas

José Mejuto
to tim launchbury: Hello all I have an app I am writing for work, using fpgui and fpc v2.4.2 on Mandriva…

Hello FPC-Pascal,

Wednesday, November 17, 2010, 7:42:43 AM, you wrote:

tl> pointer $09BB93BC does not point to valid memory block tl> Marked memory at $09BB93FC invalid
tl> Wrong signature $00000000 instead of 3B1E2C54
tl> $0808D487 line 501 of SSIMainForm.pas
[...]
tl> Does anyone have any suggestions on how to proceed with debugging this?

This usually happends when FreeMem the same block two times.

Best regards, José