[fpc-pascal] memory corruption

ik idokan at gmail.com
Thu Jan 26 03:50:32 CET 2012


Hello,

While testing my following code:
https://github.com/ik5/redis_client.fpc/blob/master/tests/test_parser.lpr#L166

When I'm executing the code on the second item (that is suppose to be null
in the protocol -> '$-1#13#10'),
the program crashes with the following message:
*** glibc detected *** redis_client/tests/test_parser: malloc(): memory
corruption (fast): 0x0000000000750d50 ***

Using gdb to display the information seems that the following like:
https://github.com/ik5/redis_client.fpc/blob/master/tests/test_parser.lpr#L85is
the cause.
It looks like accessing either tmps or ALine[j] is causing it.

I can't figure out the reason for it.

I'm using FPC 2.6.0 x86_64 on Archlinux.

What am I missing here ?

Thanks,
Ido
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20120126/413964a5/attachment.html>


More information about the fpc-pascal mailing list