Re: [classad-users] swig broken in classad 0.9.8


Date: Tue, 27 Jun 2006 13:39:07 -0500
From: Erik Paulson <epaulson@xxxxxxxxxxx>
Subject: Re: [classad-users] swig broken in classad 0.9.8
On Sun, Jun 25, 2006 at 03:25:11PM -0700, Alain Roy wrote:
> 
> >1. I undefed Copy right away in the ClassAd code, so the definition from
> >perl isn't seen. Nate thinks he did this as well at one point, but wasn't
> >what did in the end (but he's not sure what he did in the end either)
> >
> >2. I renamed all occourances of Copy() in classads to deepcopy().
> 
> On first blush, I agreed that solution #2 was preferable. It has a 
> difficult disadvantage though: it breaks backwards compatibility, and 
> I'm 90% certain it will break code used by collaborators. Grrr...
> 
> I'll look into this more carefully when I have a chance.
> 

Cool, thanks.

> >There's also a minor bug in ClassAd::Simple code that cases
> >the test suite to fail - in evalaute_expr, it's got:
> >
> >if (ref($expr))
> >    {
> >    ($value) = $this->evaluate_expr_expr($expr->copy);
> >    }
> >
> >but it only works if it's
> >
> >if (ref($expr))
> >    {
> >    ($value) = $this->evaluate_expr_expr($expr);
> >    }
> 
> I haven't looked at this code (and I'm offline right now) but this 
> looks like a serious bug, not a minor one: a copy should be evaluated 
> just as successfully. Or am I misunderstanding the code?
> 

No, you'd think that it would work with a copy. But there's some
type magic deep at work here, that neither I nor Nate understand. 

The SWIG interface clearly has bugs that will only become apparent after
it gets used more, and we understand better who owns what memory, and
how the C++ objects map back to what perl objects. 

-Erik
[← Prev in Thread] Current Thread [Next in Thread→]