[fpc-pascal] catch segfaults
Jonas Maebe
jonas.maebe at elis.ugent.be
Thu Mar 14 11:29:56 CET 2013
On 14 Mar 2013, at 11:16, Tomas Hajny wrote:
> On Thu, March 14, 2013 09:23, Xiangrong Fang wrote:
>>
>> I am sorry that was what I thought, but does not work, see screenshot
>> attached.
>
> The screenshot does not show where exactly the problem happens
> (except for
> the address, but that is useless without context), i.e. if it is
> covered
> by the try..except construct.
Indeed, it probably crashes in FreeMemory or fs.free because the heap
manager structures have been corrupted. The fs.Read itself does not
necessarily raise an exception by itself in case there's still enough
room in the heap block that contains buf, or if another one comes
right after it.
Jonas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20130314/67eb6f90/attachment.html>
More information about the fpc-pascal
mailing list