Patches item #2929284, was opened at 2010-01-10 14:36 Message generated for change (Comment added) made by katjav You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=478072&aid=2929284...
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: pd-extended Group: None Status: Open Resolution: Fixed Priority: 7 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Miller Puckette (millerpuckette) Summary: bang to switch~ while dsp off: Pd exits
Initial Comment: When a bang is sent to the switch~ object while dsp is turned off (after having been on at least once since start up of Pd), Pd will exit with segmentation fault. This was tested with Pd extended 0.41.4 on OSX 10.5 and on Linux Ubuntu. I guess the bug could be fixed by extending the conditional check in the bang method for block~/switch~:
if(x->x_switched && !x->x_switchon && canvas_dspstate)
(reported anonymously by Katja Vetter)
----------------------------------------------------------------------
Comment By: Katja (katjav) Date: 2010-02-15 13:24
Message: Hans, I suggested a check on canvas_dspstate because it seems to be a global variable reflecting the dsp status of all root canvases. glob_dsp uses it as well.
This suggestion was tested in Pd 0.41 on a Kubuntu system. With the modification, the switch~ object in an encapsulated subpatch switches dsp from off to on for one signal block, like it should do, and without Pd crashing. Apparently I overlooked conditions where it does not work, since it did not work for you.
Anyway, a check on dsp_chain does the job. Thanks.
----------------------------------------------------------------------
Comment By: Hans-Christoph Steiner (eighthave) Date: 2010-02-15 07:45
Message: I added a patch to add a warning error when switch~ is banged and the DSP is off, instead of crashing. It is also checked into Pd-extended 0.42.5: http://pure-data.svn.sourceforge.net/viewvc/pure-data?view=rev&revision=...
----------------------------------------------------------------------
Comment By: Hans-Christoph Steiner (eighthave) Date: 2010-02-14 01:35
Message: It seems that dsp_chain is the issue, so the code should be perhaps something like
if (x->x_switched && !x->x_switchon && dsp_chain)
----------------------------------------------------------------------
Comment By: Hans-Christoph Steiner (eighthave) Date: 2010-02-14 01:25
Message: Reproduced using Pd-extended 0.42.5-20100120 pd-gui-rewrite/0.43 on Mac OS X 10.5.8/Intel. Here's the stacktrace:
0 pd 0x0006b3e3 block_bang + 78 (d_ugen.c:227) 1 pd 0x00056eb4 outlet_bang + 56 (m_obj.c:370) 2 pd 0x0003e79c bng_newclick + 153 (g_bang.c:299) 3 pd 0x000378c8 canvas_doclick + 594 (g_editor.c:110) 4 pd 0x00038572 canvas_mousedown + 61 (g_editor.c:1440) 5 pd 0x00054e09 pd_typedmess + 1141 (m_class.c:792) 6 pd 0x00054ccf pd_typedmess + 827 (m_class.c:818) 7 pd 0x00058f5c binbuf_eval + 1224 (m_binbuf.c:726) 8 pd 0x00063232 socketreceiver_read + 1734 (s_inter.c:558) 9 pd 0x00061df2 sys_domicrosleep + 381 (s_inter.c:196) 10 pd 0x00061e7e sys_microsleep + 19 (s_inter.c:219) 11 pd 0x0005f004 m_mainloop + 1030 (m_sched.c:587) 12 pd 0x00061b21 sys_main + 2909 (s_main.c:304) 13 pd 0x00002852 _start + 216 14 pd 0x00002779 start + 41
Can you explain the addition of canvas_dspstate? For me, this change just makes it so bang never turns on the canvas-local DSP.
----------------------------------------------------------------------
Comment By: Katja (katjav) Date: 2010-02-14 00:37
Message: Above-mentioned bug exists in Pd 0.42-4 as well. I have checked that the problem is indeed solved with the following (where d_ugen_old.c is the original file and d_ugen.c the modified version):
diff d_ugen_old.c d_ugen.c 222c222 < if (x->x_switched && !x->x_switchon) ---
if (x->x_switched && !x->x_switchon && canvas_dspstate)
Hope this bug will be fixed soon cause I want to share a patch including the switch~ object.
Katja
----------------------------------------------------------------------
You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=478072&aid=2929284...