[chuck-users] segmentation fault / OSC

Kassen signal.automatique at gmail.com
Mon Mar 23 19:19:25 EDT 2009


Hey, Dimitris!

>  For some reason I constantly get a "segmentation fault" fatal error
sometimes just after some seconds I run my shreds. What does this mean?

Typically it means you tried to address something that doesn't exist/ isn't
instantiated. It can also mean there is some bug in ChucK that affects you.


> I do something that might be silly, I send/receive parameters between
shreds using OscEvents, can this cause the problem?

I'm sure it can cause problems but it's no silly at all, this should work
fine.

> Is there another way of communicating (exchanging control signals in this
case) between processes?

Sure; you can make a public class that has static members. For example a
static Event in a public class can be used to send information across the
while VM. This can be useful for many things and can make your code a lot
more modular. Unless you want to experiment with OSC, for example because
you want to involve a second computer and/or musician this may be the most
simple way to go. For one thing ChucK's events are "strongly timed" while
OSC depends on the host OS to pass on the data.

Do note that static non-primitives can't be instantiated in classes right
now so you will need a workaround like in this example;

//-------------------------
public class Message
    {
    static Event @ event;

    static int data1;
    static float data2;
    }

new Event @=> Message.event;
//-------------------------------

> Once or twice I had an "OSC packet ...: buffer (or stack) overflow" error.
Is there a buffer or a limit on the messages you send / receive?

I don't know :¬)
I'm certain there must be some limit somewhere but I'm not sure what or
where it is.

>
> Can I somehow declare global variables? I checked the documentation and I
didn't find anything. If the problem is because of excessive use of OSC I
could maybe read/write global variables.


Sure! data1&2 in the above example will act as global variables. They will
be the same across all instances of the class, regardless of what file they
are in. they are NOT constant; any of those files may read them or write to
them, just like any of those files may signal, broadcast or wait for
Message.event

I think that should get you started, do shout if this was unclear. This is
a slightly hackish workaround for the current situation, at some point it
should be fixed. On the bad side; it has been like this for quite a while
now, on the good; it's quite workable like this once you get the hang of it.

Hope that helps.
Kas.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20090324/72131e0a/attachment.htm>


More information about the chuck-users mailing list