[chuck-users] scott may have found a spork bug

Spencer Salazar ssalazar at CS.Princeton.EDU
Fri Sep 21 04:33:53 EDT 2007

While I haven't thoroughly gone through the code Scott posted, one  
thing did catch my eye:

             if(node.item.cc == control)
             node.next @=> node;

This looks like a nice corner case that, if spork was used, the spork- 
handling code might not anticipate.  Investigating further I was able  
to come up with a minimal example that crashes chuck on OS X  

class Someclass
     int i;
     fun void f()
         0 => i;

new Someclass @=> Someclass @ someclass;

spork ~ someclass.f();
// placing me.yield() here prevents the crash
new Someclass @=> someclass;
me.yield(); // necessary to let the sporked shred execute and cause  

While Scott's code doesn't seem to be causing any crashes, the  
spottiness of using spork as he described and the crashing caused by  
the above code seems to indicate that something is not quite right  
with the spork member function implementation.

Scott, maybe sticking a me.yield() after spork ~ node.item.set 
(value); would make things work a little better.  Although, unless  
you are trying specifically to control shred execution order, I don't  
actually see the utility of spork in this particular case, as the set 
() function doesn't allow time to pass.


On Sep 20, 2007, at 3:16 AM, Kassen wrote:

> On 9/20/07, Scott Wheeler <wheeler at kde.org> wrote:
> > [...] this wouldn't be the first time things went a little odd when
> > inside of classes and you certainly have no shortage of those here.
> Aside from being generally an OOP fan, it certainly makes a lot of the
> things in there a lot easier.
> I wasn't criticising you; I could tell you are a OOP fan and that's  
> cool. I also know (because I too use classes if not always with as  
> much enthusiasm as you do) that with ChucK some things that  
> normally work fine act weird when done inside of classes, just this  
> summer we had some especially obnoxious cases of that.
> So; I was trying to help pinpoint the source of the issue because  
> as far as I could see after a quick look what you are trying should  
> work just fine.
> Yours,
> Kas.
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users

More information about the chuck-users mailing list