develooper Front page | perl.perl6.internals | Postings from October 2001

Memory bug: new_string_header() and free_string()

Thread Next
From:
R. O'Neil
Date:
October 24, 2001 11:10
Subject:
Memory bug: new_string_header() and free_string()
Message ID:
20011024181023.97082.qmail@web11406.mail.yahoo.com
I noticed recently that calling pdump on a 
pbc file, in this case mops.pbc, causes a 
segfault.  I traced this down to calling 
free_string() in resources.c.  It just so 
happens that calling mem_allocate_aligned()
in new_string_header() makes the STRING 
pointer unacceptable for free().

This can be temporarily fixed by the included 
patch, but there is certainly some deeper
consideration in order.  I imagine the same
problem will pertain to PMCs since they are
allocated and deallocated similarly.

-Ryan



Index: resources.c
===================================================================
RCS file: /home/perlcvs/parrot/resources.c,v
retrieving revision 1.1
diff -r1.1 resources.c
26c26
<   return mem_allocate_aligned(sizeof(STRING));
---
>   return mem_sys_allocate(sizeof(STRING));    

__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About