Hi Lazarus guru's,
I have stumbled into a problem with a Lazarus application. At random times, from 5 minutes to several hours, it crashes suddenly, and silently. The only way to get a clue has been to run it with gdb.
It turns out that the crash occurs because of a Segmentation Fault in QTextEngine, triggered by a PostMessage, but apparently the cause was an endless loop in a previous PostMessage, which was executed some 1723 times. Attached the gdb stack trace (with 1722 identical items suppressed).
The scenario is a main thread using LCL, which is used, among other things not relevant here, to display information to the user, and another thread which communicates with a real-time process, and uses a PostMessage to wake up the main thread and make it show what required.
It appears that in some circumstances, the Application.ProcessMessages invoked in the main thread restarts the handling of the same message, thus creating and endless loop.
Is Application.ProcessMessages the vilain, or PostMessage or what?
Snippet of auxiliary thread code:
Show quoted text 11 lines
Snippet of main thread code:
Show quoted text 27 lines
Thanks for any help
Giuliano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PostMessage.log
Type: text/x-log
Size: 8152 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20160209/2e6a952f/attachment-0001.bin>
