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

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

Thread Previous
From:
Mike Lambert
Date:
July 31, 2002 23:03
Subject:
Re: [perl #15845] [BUG] GC segfault
Message ID:
Pine.LNX.4.44.0208010202000.1949-100000@jall.org
Applied with some modification, thanks.

Mike Lambert

Richard Cameron wrote:

> Date: Wed, 31 Jul 2002 22:24:55 +0100
> From: Richard Cameron <Richard.Cameron@OrbisUK.com>
> To: perl6-internals@perl.org
> Cc: bugs-bitbucket@netlabs.develooper.com
> Subject: Re: [perl #15845] [BUG] GC segfault
>
>
> 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


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