Memory bug: new_string_header() and free_string()

2001-10-24 Thread R. O'Neil

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



Re: Memory bug: new_string_header() and free_string()

2001-10-24 Thread Dan Sugalski

At 11:10 AM 10/24/2001 -0700, R. O'Neil wrote:
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().

Ah, those. STRING and PMC headers will be coming out of an arena soon, so 
this won't be as much of an issue.

Dan

--it's like this---
Dan Sugalski  even samurai
[EMAIL PROTECTED] have teddy bears and even
  teddy bears get drunk