[Python-Dev] Sandboxing Python (original) (raw)

Steven D'Aprano steve at pearwood.info
Sun Mar 4 23:53:48 CET 2012


Armin Rigo wrote:

Hi Mark,

On Sun, Mar 4, 2012 at 18:34, Mark Shannon <mark at hotpy.org> wrote: You can't solve the too much time, without solving the halting problem, Not sure what you mean by that. It seems to me that it's particularly easy to do in a roughly portable way, with alarm() for example on all UNIXes.

What time should you set the alarm for? How much time is enough before you decide that a piece of code is taking too long?

The halting problem is not that you can't breaking out of an infinite loop, but that you can't in general decide when you are in an infinite loop.

I think that Mark's point is that you can't, in general, tell when you are in a "too much time" attack (or bug) that needs to be broken out of rather than just a legitimately long calculation which will terminate if you wait just a little longer.

-- Steven



More information about the Python-Dev mailing list