[PD] segfault on external with libpd & JUCE

Joel Matthys jwmatthys at gmail.com
Wed Aug 5 20:29:18 CEST 2015


Hello all. I'm working on a project with libpd & JUCE. I'm trying to 
include a couple of externals.

Following directions from here: 
https://github.com/danomatika/ofxPd#adding-pure-data-external-libraries-to-ofxpd

I included the source files in my JUCE project, #included them in my 
audio renderer code, initialize portaudio and libpd:

libpd_init_audio(2, 2, this->getSampleRate()); //two channel in, two 
channel out
bob_tilde_setup();

This compiles fine, and if the external is non-audio, everything works. 
But for externals with DSP, I get a segfault:

Program received signal SIGSEGV, Segmentation fault.
0x000000000041b2d7 in bob_dsp (x=0xf40660, sp=0xf3f610) at 
../../Source/bob~.c:237
237            sp[2]->s_vec, sp[3]->s_vec, sp[0]->s_n);
(gdb) bt
#0  0x000000000041b2d7 in bob_dsp (x=0xf40660, sp=0xf3f610) at 
../../Source/bob~.c:237
#1  0x00007ffff649dae1 in ugen_doit () from /usr/local/lib/libpdcpp.so
#2  0x00007ffff649dc3e in ugen_doit () from /usr/local/lib/libpdcpp.so
#3  0x00007ffff649e4a1 in ugen_done_graph () from /usr/local/lib/libpdcpp.so
#4  0x00007ffff64a6427 in canvas_dodsp () from /usr/local/lib/libpdcpp.so
#5  0x00007ffff64a7aef in canvas_resume_dsp () from 
/usr/local/lib/libpdcpp.so
#6  0x00007ffff64dfb39 in glob_evalfile () from /usr/local/lib/libpdcpp.so

offending line is:
dsp_add(bob_perform, 6, x, sp[0]->s_vec, sp[1]->s_vec,sp[2]->s_vec, 
sp[3]->s_vec, sp[0]->s_n);

Any help is appreciated!
Joel



More information about the Pd-list mailing list