[perl #58460] [PATCH] Bug with ResizablePMCArray::Append

Will Coleda via RT parrotbug-followup at parrotcode.org
Mon Nov 2 02:42:14 UTC 2009


On Mon Oct 13 22:04:32 2008, chromatic at wgz.org wrote:
> On Friday 29 August 2008 21:47:41 Stephen Weeks wrote:
> 
> > I tried using resizablepmcarray's append() in cardinal and I got
> 'double
> > fre or corruption' on program exit.
> >
> > I tried to fix it, but I'm not sure about GC issues.
> >
> > As far as I can tell, the attached shouldwork.patch (which adds
> > GC_WRITE_BARRIER before the write) should fix the problem, but it
> doesn't
> > change anything.
> >
> > The attached doeswork.patch actually does fix the issue, but has
> some
> > obvious issues.
> >
> > As far as I can tell, shouldwork.patch is doing the same thing as
> > calling VTABLE_set_pmc_keyed_int does, so I'm not sure why it
> doesn't
> > work.
> >
> > I couldn't reproduce it with ResizablePMCArrays directly, though.
> I'll
> > keep working to see if I can generate a small test case.
> >
> > Anyone have any ideas?
> 
> Do you have a small PIR program which demonstrates the problem?  Does
> r31933
> help?
> 
> -- c
> 

I threw together some PIR (see below) and was unable to duplicate the error.

Marking ticket as resolved - if this still an issue for you, please open a new ticket referring to 
this one, at https://trac.parrot.org/

Regards.

---

$ ./parrot --gc-debug foo.pir
1
2
$ cat  foo.pir
.include 'hllmacros.pir'

.sub 'main' :main
  $P1= new 'ResizablePMCArray'
  $P2= new 'ResizablePMCArray'
  push $P1, 1
  push $P2, 2
  $P1.'append'($P2)
  
  $P3 = iter $P1 
  .While($P3, {
    $S0 = shift $P3
    say $S0
  })
.end


-- 
Will "Coke" Coleda


More information about the parrot-dev mailing list