[fpc-pascal] debugging faulty pointer

tim launchbury tim at tlaunchbury.ukfsn.org
Wed Nov 17 07:42:43 CET 2010

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?



PS Congratulations to the fpc team for the compiler and Graeme for fpgui;
both some of the best software I have ever worked with.

More information about the fpc-pascal mailing list