1

I have a iOS project developed with XCode that uses libpd to load a Pure Data patch. My project uses a mix of [osc~] and [phasor~] with modulated parameters (pitch, volume, etc). My app is in 64-bit as now required. I am using the latest version of Pure Data and libpd.

It crashes in one place. I have an [osc~] that has its pitch modulated by an envelope. When I change the value of the length of the envelope (= modulation rate) on a device, it randomly crashes during testing but always on the same line of libpd code. I thought it had to do with how fast the parameter was changed but no, it also happens when the parameter is slowly changed.

Here is below a (reduced) patch where the problem occurs. I have recently catched up with Pure Data. Any suggestions or corrections are welcome.

modulatedOscillator.pd

Here is a screenshot of the crash in XCode with the code sequence and the line of clock_unset that crashes.

crash_m_sched.png
(source: pdpatchrepo.info)

Full picture here.

I have done some printing and it crashes in this function:

void clock_unset(t_clock *x){
    if (x->c_settime >= 0){
        if (x == clock_setlist) clock_setlist = x->c_next;
        else{
            t_clock *x2 = clock_setlist;
            while (x2->c_next != x) x2 = x2->c_next;
            x2->c_next = x->c_next;
        }
        x->c_settime = -1;
    }
}

On this line :

while (x2->c_next != x) x2 = x2->c_next;

With a printed value of : x2->c_next==NULL

Anyone has experienced something similar?

Thanks.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
André
  • 671
  • 1
  • 7
  • 21
  • it seems that the clock that is being unset is not found in the list of currently maintained clocks. however, this is probably one of the most often used functions in Pd and afaict you only use bog standard built-in objects, which should make the patch pretty failsafe. i'm guessing that your problem is related to the new multi-instance features of Pd and you simply hit a bug. please report the bug at the appropriate places (either with libpd or Pd itself) – umläute May 26 '15 at 13:38
  • Thanks for the reply. I'll carry on testing my complete patch before reporting a bug. I hope this is not the case. – André May 26 '15 at 13:48
  • My complete patch uses lots of objects that listen to messages from XCode. Sometimes the same message from XCode is listened and received by maybe 50 objects. 50 does not sound huge but should I try to reduced the number of listening objects (by using more inlets) ? Thanks. – André May 26 '15 at 13:55
  • i really don't understand your additional question (in the comment), and i'm not sure how it relates to the original question: if you have multiple questions, please ask them separately. please also note that [so]'s comment-system should not be used as a chat (use a chat, a mailinglist, a forum for that) – umläute May 26 '15 at 13:57

0 Answers0