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

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

Thread Previous | Thread Next
From:
Richard Cameron
Date:
July 31, 2002 18:48
Subject:
Re: [perl #15845] [BUG] GC segfault
Message ID:
F55E4CFE-A4CB-11D6-B95A-003065E5E6AE@OrbisUK.com

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).

Richard.



Thread Previous | 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