ChucK: crash without reason

Linux howto's, compile information, information on whatever we learned on working with linux, MACOs and - of course - Products of the big evil....
Post Reply
User avatar
^rooker
Site Admin
Posts: 1483
Joined: Fri Aug 29, 2003 8:39 pm

ChucK: crash without reason

Post by ^rooker »

[PROBLEM]
I wrote a small ChucK program which does some sporking and one (not the sporked one) function is overloaded.

Code: Select all

fun int nextStep ( int index )
{
   0 => int out;
...
   return out
}

fun int nextStep ()
{
   nextStep ( myIndex );
}

Calling "nextStep()" within an endless loop:

Code: Select all

while(true) 
{
   nextStep();
}
runs for a while and then ChucK crashes... *sigh*


[SOLUTION]
I forgot the "return" statement within the overloaded "nextStep()" function!!!

Here's how it works now:

Code: Select all

fun int nextStep ()
{
   return nextStep ( myIndex );
}

This sucker has cost me 2 hours!!!
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
Post Reply