chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] double-free or corruption


From: Santosh Rajan
Subject: Re: [Chicken-users] double-free or corruption
Date: Wed, 6 Jul 2011 10:49:14 +0530



On Wed, Jul 6, 2011 at 9:22 AM, David N Murray <address@hidden> wrote:
Hi all,

I have some code that runs fine on my Mac and under OpenBSD.  Under Linux
however, it crashes.  Same code, all running under csi 4.7.0 64-bit.
Could this be an issue with my code?  I'm not sure I fully understand the
ramifications of using shared structure with partition and append and want
to make sure it's not my code causing the problem.  Is there a way to
track this down?  It's been a few dozen years since I read a core dump.
The last debugging message my code displayed showed that I just finished
writing a text file via for-each over the list I created (with partition
and append) using format and then close-output-port.  If I'm reading the
backtrace correctly, I'm in fclose and a free() is being called.d

TIA,
Dave

*** glibc detected *** /usr/local/bin/csi: double free or corruption
(!prev): 0x0000000000661780 ***


I am just hazarding a guess here, but I hope this helps.
The behaviour of realloc() with size 0 is not consistent across platforms.
http://en.wikipedia.org/wiki/Malloc#realloc

In your loop you might want to handle null conditions. (eg. null string).

cheers
Santosh
 
“The young man knows the rules but the old man knows the exceptions”. Oliver Wendell Holmes


reply via email to

[Prev in Thread] Current Thread [Next in Thread]