On Sun, Jun 9, 2013 at 12:38 PM, Max Leske <maxleske@gmail.com> wrote:

I still can't tell you how the closure become corrupted but I now know how to get rid of it. I'm also pretty sure that closures work fine (as you say) and that I probably mistook the same corrupt instance for different instances.

Yes, but can you see how Fuel can construct bad instances?  Is so, you must see that Fuel needs fixing.
 

Cheers,
Max

> How does that happen?  It doesn't happen in normal use.  I can see how Fuel
> does it.  I can't see how non-Fuel use would do it (other than deliberate
> construction).  A closure is created by evaluating the push-closure
> bytecode in a specific method, and when this closure is created, it refers,
> through its outer context to the method object containing the evaluated
> push-closure bytecode.  Since the closure's startpc is derived from the pc
> of the push-closure bytecode, there is always a match.
>
> However, when Fuel serializes (IIRC) it serializes a *reference* to a
> method in the form of a class-name,selector pair, and this approach can
> obviously yield an invalid method.
>
> therefore I think it much more likely that what you;re seeing is a result
> of a bug in Fuel than some systemic problem with closures.



--
best,
Eliot