libpd/libpd — Issue #5: Segfault scenario.
Author: rvega
Created: 2011-12-27 21:51:33+00:00
State: open

Hello.
I'm using libpd here: https://github.com/rvega/XookyNabox.
When I load this patch:

#N canvas 278 223 857 419 10;
#X obj 154 36 loadbang;
#X obj 154 322 dac~;
#X obj 154 77 random 10;
#X obj 154 96 * 200;
#X obj 154 116 + 200;
#X obj 154 160 phasor~;
#X obj 154 57 metro 2000;
#X obj 155 283 *~;
#X obj 155 249 vcf~ 2;
#X obj 181 214 *~ 2;
#X obj 181 192 sig~;
#X obj 154 136 t f f;
#X obj 228 227 osc~ 0.5;
#X obj 229 286 *~;
#X obj 229 250 clip~ 0 1;
#X msg 254 188 0.75;
#X connect 0 0 6 0;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 4 0 11 0;
#X connect 5 0 8 0;
#X connect 6 0 2 0;
#X connect 7 0 1 0;
#X connect 7 0 1 1;
#X connect 8 0 7 0;
#X connect 9 0 8 1;
#X connect 10 0 9 0;
#X connect 11 0 5 0;
#X connect 11 1 10 0;
#X connect 11 1 15 0;
#X connect 12 0 14 0;
#X connect 13 0 7 1;
#X connect 14 0 13 0;
#X connect 14 0 13 1;
#X connect 15 0 12 1;

I get a segfault:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
[Switching to process 4771 thread 0x1f03]
0x0000000000000000 in ?? ()
(gdb) backtrace
#0 0x0000000000000000 in ?? ()
#1 0x000000010005e89e in outlet_float (x=0x1002289a0, f=8.83757463e-39) at m_obj.c:385
#2 0x0000000100057711 in binbuf_eval (x=0x1002289a0, target=0x100228bb0, argc=6306896, argv=0x100603c50) at m_binbuf.c:725
#3 0x00000001000491f0 in message_float (x=0x1002289a0, f=0) at g_text.c:353
#4 0x000000010005e89e in outlet_float (x=0x1002289a0, f=8.83793336e-39) at m_obj.c:385
#5 0x000000010006ed85 in trigger_list (x=0x1002289a0, s=0x100228bb0, argc=1, argv=0x100603ce0) at x_connective.c:988
#6 0x000000010006ee94 in trigger_float (x=0x1002289a0, f=0) at x_connective.c:1034
#7 0x000000010005e89e in outlet_float (x=0x1002289a0, f=8.83811273e-39) at m_obj.c:385
#8 0x000000010005e89e in outlet_float (x=0x1002289a0, f=8.83815757e-39) at m_obj.c:385
#9 0x000000010005e89e in outlet_float (x=0x1002289a0, f=8.83820241e-39) at m_obj.c:385
#10 0x000000010005ea99 in outlet_bang (x=0x1002289a0) at m_obj.c:359
#11 0x0000000100077cbc in metro_tick (x=Cannot access memory at address 0x0
) at x_time.c:87
#12 0x000000010006004d in sched_tick (next_sys_time=2.1251120013319739e-314) at m_sched.c:372
#13 0x0000000100079459 in libpd_process_float (inBuffer=0x1002289a0, outBuffer=0x100228bb0) at z_libpd.c:143
#14 0x0000000100001a2e in process (nframes=256, arg=0x0) at main.cpp:206
#15 0x00000001000f83bc in Jack::JackClient::Execute ()
#16 0x00000001001057ee in Jack::JackPosixThread::ThreadHandler ()
#17 0x00007fff8fda58bf in _pthread_start ()
#18 0x00007fff8fda8b75 in thread_start ()

Other patches seem to work okay except for patches that use line and line~.

This is just in case this scenario is usefull for you guys since I'm just playing around.