[fpc-devel] Misterious error

José Mejuto joshyfun at gmail.com
Wed Dec 28 14:25:56 CET 2011


Hello FPC,

I'm now running:

Lazarus 0.9.31 r34428
FPC 2.7.1 i386-win32-win32/win64 r19895

With this setup something strange is happening in a project of mine,
when I close the project a SIGSEGV happends in the win32callback.inc
of LCL without callback stack trace and with all local variables using
a base pointer of nil (gdb messages like 'window unable to read
address 0x8').

This seems to have nothing in relation with fpc itself, but as soon as
I do any string operation inside the procedure everything starts to
work as it should. In my first test I wrote a simple
"writeln(integer(@window))" before the line that crashes everything,
but before the crash, the value of @window is normal.

Then I try to write 2 values so use "writeln(strtoint(window)+'
'+strtoint(msg))' and suddenly everything starts to work.

I know that such operation can change the code generation and hide an
error, so I simple declare a "var" section like:

var
  s: string;
begin

and remove the writeln so the only change to the code is the variable
declaration and now it works.

Does anybody have an idea how can I debug this problem ? Assembler
code looks the same in both cases.

To me it looks like the code is trying to free some strings or
interfaces but at a point where the manager of automated types has
been "disabled" so the declaration of a new ansistring "reconnects"
it. Maybe it is a crazy idea but is the only one that I have now.

-- 
Best regards,
 José




More information about the fpc-devel mailing list