[PD] Strange bug in my patch

Matteo Sisti Sette matteosistisette at gmail.com
Sat Feb 27 18:59:36 CET 2010


colet.patrice at free.fr escribió:

> 
> I don't think you're wrong on this but, what about [until] object that can just
> crash/hung the COMPUTER and not only pd?
> 

Yeah, that's an issue that should be addressed.
1) If the COMPUTER hangs (it does not happen to me, in Window, when I 
bang an [until] object, but maybe it's because I'm on a dual core 
machine), it is the operating system's fault. No matter how bad a 
program hangs (even in the case of a malicious program), the operating 
system must guarantee that the whole system keeps working and that you 
have at least the ability to kill the hung/offending program
2) When you trigger an infinite loop, Pd shouldn't hung: it should warn 
you that a possibly infinite message tree is hanging the execution of 
the patch, and it should allow you to interrupt it, at the very least to 
save unsaved patches and exit. Or it could not warn you at all but some 
"kill" button should then always be available on the console window (for 
example).

As I see it, Pd is a virtual machine and the patch is the program that 
runs on that virtual machine. So if your patch is buggy (i.e. triggers 
an infinite loop), the virtual machine can hang, that's ok, it's the 
patcher's fault, but the virtual machine is virtual and should only 
"virtually" hang. Pd, which simulates the virtual machine, is also an 
application, and the patch is its input: and no matter the input, the 
application as such shouldn't hang.

Flash Player for example does that: if your script gets trapped in an 
infinite while, the player (the virtual machine) prompts the user to 
decide whether to interrupt the execution (it can't know whether the 
loop is infinite or just very long, and so can't pd know - but it 
detects a possible hanging and prompts the user whether she wants to 
interrupt it or keep waiting, in which case the prompt pops up again later).
It seems to me that this often fails to work properly in Flash Player 
however.

Btw I thought I had heard of a "watchdog" process of Pd (there would be 
three processes: gui, engine and watchdog) whose function would be to 
avoid Pd hanging your computer......



-- 
Matteo Sisti Sette
matteosistisette at gmail.com
http://www.matteosistisette.com




More information about the Pd-list mailing list