develooper Front page | perl.perl6.internals | Postings from July 2002

Re: [perl #15845] [BUG] GC segfault

Thread Previous | Thread Next
Richard Cameron
July 31, 2002 18:48
Re: [perl #15845] [BUG] GC segfault
Message ID:

On Tuesday, July 30, 2002, at 07:20 PM, Simon Glover (via RT) wrote:

>  This code segfaults:
>       sweepoff
>       set I0, 0
> LOOP: new P0, .PerlString
>       set P0, "ABC"
>       save P0
>       inc I0
>       lt I0, 127, LOOP
>       end

This is a fairly straightforward fix.

Parrot_do_dod_run() ordinarily updates pool->num_free_objects as a side 
effect of looking for unused headers. If dod is disabled with sweepoff, 
then num_free_objects doesn't get updated. This confuses a piece of code 
later on which decides that it doesn't need to allocate any new buffers 
after all (although all other evidence point to the contrary).

Parrot segfaults soon after.

I've attached two patches, the first fixes the problem by telling the 
allocator to ignore the value of num_free_objects if it's unknown; the 
second adds the erstwhile crashing code to the test suite (although I'm 
not convinced I've put it in the best place).


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About