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.
In your loop you might want to handle null conditions. (eg. null string).
cheers
Santosh