Author Topic: Error using HeapTrace  (Read 2980 times)


  • Hero Member
  • *****
  • Posts: 652
Error using HeapTrace
« on: November 01, 2010, 05:24:44 pm »
   I've made an application which has a Thread that reads bar codes from a serial scanner. This thread generates keypress events with a Synchronize.

   It works without problems, so I wanted to test whether it has a memory leak or not. On the first run I opened the port, started the thread, then I stopped the thread (without reading a bar code) and terminate it. Then I quit the program with no memory leak.

   At the second one I scanned a bar code but this time it has risen this exception while synchronizing:
Marked memory at $01BA2778 invalid
Wrong signature $1061D179 instead of 9E7D8017
  $0809161B  TSCANNER__ONRECV,  line 1011 of scanner.pas
  $080901BF  TRECVTHREAD__DOONRECV,  line 642 of scanner.pas
  $081C95D4  THREADSYNC_IOCALLBACK,  line 637 of /usr/lib/lazarus/

the line 1011 is a call to a procedure we call SendKeyPress(Key: word); which uses (on Linux)

Code: Pascal  [Select][+][-]
  1. function XSendEvent(para1:PDisplay; para2:TWindow; para3:TBool; para4:clong; para5:PXEvent):TStatus;cdecl;external libX11;

to generate the event.

The question is:
Is there a problem with heaptrace and threads and/or OS calls?

I'm using Lazarus v0.9.28.2-0 beta on Ubuntu 9.10


TinyPortal © 2005-2018