{"action":"created","issue":{"url":"https://api.github.com/repos/libpd/libpd/issues/94","labels_url":"https://api.github.com/repos/libpd/libpd/issues/94/labels{/name}","comments_url":"https://api.github.com/repos/libpd/libpd/issues/94/comments","events_url":"https://api.github.com/repos/libpd/libpd/issues/94/events","html_url":"https://github.com/libpd/libpd/issues/94","id":83189579,"number":94,"title":"libpd crashes with vlines~ in (libpd) clock_unset (?)","user":{"login":"PascalDouillard","id":10989820,"avatar_url":"https://avatars.githubusercontent.com/u/10989820?v=3","gravatar_id":"","url":"https://api.github.com/users/PascalDouillard","html_url":"https://github.com/PascalDouillard","followers_url":"https://api.github.com/users/PascalDouillard/followers","following_url":"https://api.github.com/users/PascalDouillard/following{/other_user}","gists_url":"https://api.github.com/users/PascalDouillard/gists{/gist_id}","starred_url":"https://api.github.com/users/PascalDouillard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PascalDouillard/subscriptions","organizations_url":"https://api.github.com/users/PascalDouillard/orgs","repos_url":"https://api.github.com/users/PascalDouillard/repos","events_url":"https://api.github.com/users/PascalDouillard/events{/privacy}","received_events_url":"https://api.github.com/users/PascalDouillard/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-31T21:10:49Z","updated_at":"2015-06-01T06:57:29Z","closed_at":null,"body":"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.\r\n\r\nThe Pure Data patch runs fine in Pure Data but it crashes in XCode. 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.\r\n\r\nHere is below a (reduced) patch where the problem occurs. I have recently catched up with Pure Data. Any suggestions or corrections are welcome.\r\n\r\nmodulatedOscillator.pd (http://forum.pdpatchrepo.info/uploads/files/upload-9c1506d8-30a2-4af3-8927-b4f97c73474e.pd)\r\n\r\nHere is a screenshot of the crash in XCode with the code sequence and the line of clock_unset that crashes.\r\n\r\n![crash_m_sched](https://cloud.githubusercontent.com/assets/10989820/7903859/79938d6a-07e9-11e5-97d6-28fb59664a6e.png)\r\n\r\nI have done some printing and it crashes in this function:\r\n\r\nvoid clock_unset(t_clock *x){\r\n    if (x->c_settime >= 0){\r\n        if (x == clock_setlist) clock_setlist = x->c_next;\r\n        else{\r\n            t_clock *x2 = clock_setlist;\r\n            while (x2->c_next != x) x2 = x2->c_next;\r\n            x2->c_next = x->c_next;\r\n        }\r\n        x->c_settime = -1;\r\n    }\r\n}\r\n\r\nOn this line :\r\n\r\nwhile (x2->c_next != x) x2 = x2->c_next;\r\n\r\nWith a printed value of : x2->c_next==NULL\r\n\r\nSomeone replied to me about the issue on Stack Overflow:\r\n\"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.\"\r\n\r\nCould it be a bug? Thanks in advance.\r\n"},"comment":{"url":"https://api.github.com/repos/libpd/libpd/issues/comments/107329918","html_url":"https://github.com/libpd/libpd/issues/94#issuecomment-107329918","issue_url":"https://api.github.com/repos/libpd/libpd/issues/94","id":107329918,"user":{"login":"PascalDouillard","id":10989820,"avatar_url":"https://avatars.githubusercontent.com/u/10989820?v=3","gravatar_id":"","url":"https://api.github.com/users/PascalDouillard","html_url":"https://github.com/PascalDouillard","followers_url":"https://api.github.com/users/PascalDouillard/followers","following_url":"https://api.github.com/users/PascalDouillard/following{/other_user}","gists_url":"https://api.github.com/users/PascalDouillard/gists{/gist_id}","starred_url":"https://api.github.com/users/PascalDouillard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PascalDouillard/subscriptions","organizations_url":"https://api.github.com/users/PascalDouillard/orgs","repos_url":"https://api.github.com/users/PascalDouillard/repos","events_url":"https://api.github.com/users/PascalDouillard/events{/privacy}","received_events_url":"https://api.github.com/users/PascalDouillard/received_events","type":"User","site_admin":false},"created_at":"2015-06-01T06:57:29Z","updated_at":"2015-06-01T06:57:29Z","body":"Good idea, thanks. I'll try libpd 0.7."}}