[chuck-users] chuck under gdb?

Tom Lieber tom at alltom.com
Sun May 24 08:37:09 EDT 2009


On Sun, May 24, 2009 at 1:32 AM, Robert Poor <rdpoor at gmail.com> wrote:
> I've recompiled chuck with -g and it just gets stranger: with a construct
> along the lines of:
>
> fun void a() {
>        <<< "in a before b" >>>;
>        b();
>        <<< "in a after b" >>>;
> }
>
> fun void b() {
>        <<< "entering b" >>>;
>        ...do some stuff...
>        <<< "exiting b" >>>;
> }
>
> There are no yields() that would let another process run in-between the call
> to b and returning to a, but it *sometimes* crashes after the return, so I
> see the equivalent of:
>
>        "in a before b"
>        "entering in b"
>        "exiting in b"
>        [crash]
>
> I'm seeing a "KERN_INVALID_ADDRESS" at a non-zero address, thrown from
> inside Chuck_Instr_Reg_Push_Imm::execute()
>
> I'm at a real loss how to tackle this one.  Its part of a large body of
> code, so excerpting it down to a minimal example would be tough.  Absent any
> suggestions from the Chuck wizards out there, I'm tempted to simply re-write
> my code in a different way and hope it makes a difference.  But that's not
> my favorite approach.
>
> Suggestions more than welcome.

Well, the only non-bus-error of ways to crash ChucK I'm familiar with
is to use variables before their definition in a way the compiler
doesn't catch. Liiike:

fun void a() { b(); }
a();
int v[1];
fun void b() { <<< v[0] >>>; }

-- 
Tom Lieber
http://AllTom.com/


More information about the chuck-users mailing list