[chuck-users] chuck segfaults at startup on core2duo on linux jack

Ken Restivo ken at restivo.org
Fri Apr 27 04:37:14 EDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

My old C debugging memories are slowly returning.

I recompiled with CHUCK_DEBUG, and still, this looks really bad:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 47625308423024 (LWP 27946)]
0x00000000004b2d8d in osc_ctor (SELF=0x0, ARGS=0x9591a8, SHRED=0x9588d0) at ugen_osc.cpp:249
249         OBJ_MEMBER_UINT(SELF, osc_offset_data) = (t_CKUINT)d;

(gdb) bt
#0  0x00000000004b2d8d in osc_ctor (SELF=0x0, ARGS=0x9591a8, SHRED=0x9588d0) at ugen_osc.cpp:249
#1  0x0000000000421200 in Chuck_Instr_Func_Call_Member::execute (this=0x76a050, vm=0x76d770, shred=0x9588d0)
    at chuck_instr.cpp:2651
#2  0x000000000042aebb in call_pre_constructor (vm=0x76d770, shred=0x9588d0, pre_ctor=0x793610, stack_offset=0)
    at chuck_instr.cpp:2070
#3  0x000000000042138f in Chuck_Instr_Pre_Constructor::execute (this=0x958090, vm=0x76d770, shred=0x9588d0)
    at chuck_instr.cpp:2084
#4  0x000000000040faac in Chuck_VM_Shred::run (this=0x9588d0, vm=0x76d770) at chuck_vm.cpp:1426
#5  0x0000000000413bd2 in Chuck_VM::compute (this=0x76d770) at chuck_vm.cpp:608
#6  0x0000000000413f43 in Chuck_VM::run (this=0x76d770) at chuck_vm.cpp:555
#7  0x00000000004776ca in main (argc=3, argv=0x7fff0a0b9668) at chuck_main.cpp:702

(gdb) list
244     CK_DLL_CTOR( osc_ctor )
245     {
246         Osc_Data * d = new Osc_Data;
247         Chuck_DL_Return r;
248         // return data to be used later
249         OBJ_MEMBER_UINT(SELF, osc_offset_data) = (t_CKUINT)d;
250         osc_ctrl_freq( SELF, &(d->freq), &r, SHRED );
251     }
252     
253     

(gdb) info local
d = (Osc_Data *) 0x8d0570
r = {
  v_int = 0, 
  v_uint = 0, 
  v_float = 0, 
  v_dur = 0, 
  v_time = 0, 
  v_object = 0x0, 
  v_string = 0x0
}
... which comes from ...

(gdb) up
#1  0x0000000000421200 in Chuck_Instr_Func_Call_Member::execute (this=0x76a050, vm=0x76d770, shred=0x9588d0)
    at chuck_instr.cpp:2651
2651            f( (Chuck_Object *)(*mem_sp), mem_sp + 1, shred );

(gdb) list
2646        if( func->native_func_type == Chuck_VM_Code::NATIVE_CTOR )
2647        {
2648            // cast to right type
2649            f_ctor f = (f_ctor)func->native_func;
2650            // call
2651            f( (Chuck_Object *)(*mem_sp), mem_sp + 1, shred );
2652        }
2653        else
2654        {
2655            // cast to right type


(gdb) info locals
f = (f_ctor) 0x4b2d52 <osc_ctor>
mem_sp = (long unsigned int *&) @0x875c18: 0x9591a0
reg_sp = (long unsigned int *&) @0x8e1958: 0x9691b8
retval = {
  v_int = 0, 
  v_uint = 0, 
  v_float = 0, 
  v_dur = 0, 
  v_time = 0, 
  v_object = 0x0, 
  v_string = 0x0
}
func = (class Chuck_VM_Code *) 0x793610
local_depth = 0
stack_depth = 1
push = 0
__PRETTY_FUNCTION__ = "virtual void Chuck_Instr_Func_Call_Member::execute(Chuck_VM*, Chuck_VM_Shred*)"


But, this is C++, stuff-- SIGSEGV in a constructor-- and I don't know C++ well enough to be able to do anything more from here. I suspect non-64-bit-safe stuff, but I can't figure out where.

Anyway, this is bleak. I was really hoping to get ChucK working on this laptop, so I could use it for live stuff. Doesn't look so encouraging now.

- -ken
- -----------------------
On Wed, Apr 18, 2007 at 02:48:15PM -0400, Spencer Salazar wrote:
> Hey Ken,
> Yikes, sorry to hear that.  Could you provide a stack trace of this?   
> That would be most helpful in figuring out the problem.  Im not sure  
> if you're handy with gdb, but the easiest way to do it is like this:
> 
> $ gdb chuck
> (gdb) run -v5 cw.ck
> ... (crash happens) ...
> (gdb) backtrace
> ... (stack trace printed here) ...
> 
> Copying all of the output of that gdb session (including the chuck  
> log output) will be very helpful as that typically specifies exactly  
> where the crash is occurring.
> 
> It would also be helpful if you could provide the text of cw.ck, if  
> you don't mind.  It can be assumed that cw.ck doesn't crash ChucK on  
> other machines, correct?
> 
> spencer
> 
> On Apr 18, 2007, at 1:49 AM, Ken Restivo wrote:
> 
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Alas, I am dead in the ChucK waters.
> >
> > Just got a new Core 2 Duo laptop. Built ChucK 1.2.0.8 for linux- 
> > jack. Planned to use this machine for ChucK experimentation and  
> > live performance.
> >
> > And then:
> >
> > $ chuck cw.ck
> > Segmentation fault
> >
> > Gah!
> >
> > $ chuck --probe
> > [chuck]: found 1 device(s) ...
> > [chuck]: ------( chuck -- dac1 )---------------
> > [chuck]: device name = "Jack Server"
> > [chuck]: probe [success] ...
> > [chuck]: # output channels = 2
> > [chuck]: # input channels  = 2
> > [chuck]: # duplex Channels = 2
> > [chuck]: default device = YES
> > [chuck]: natively supported data formats:
> > [chuck]:   32-bit float
> > [chuck]: supported sample rates:
> > [chuck]:   48000 Hz
> > [chuck]:
> > [chuck]: ------( chuck -- 3 MIDI inputs )------
> > [chuck]:     [0] : "Midi Through Port-0"Segmentation fault
> >
> >
> > Sad. No ChucK for me! This is with the stock 1.2.0.8
> >
> > - -ken
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.1 (GNU/Linux)
> >
> > iD8DBQFGJbF8e8HF+6xeOIcRAllLAKD0f78S+IOEEFqJIGcASfthaIX5mACghGW1
> > qb6fSvK2uBex703V7MQKri8=
> > =kaw9
> > -----END PGP SIGNATURE-----
> > _______________________________________________
> > chuck-users mailing list
> > chuck-users at lists.cs.princeton.edu
> > https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
> 
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFGMbY6e8HF+6xeOIcRAlqEAJ4khbJWq9i2U8KRWAZxpTlOen80IgCgmBrP
h/2AQ122UOvkoIvsFxOwMDo=
=GGPa
-----END PGP SIGNATURE-----


More information about the chuck-users mailing list