Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #54654 > unrolled thread

Re: building an online judge to evaluate Python programs

Started byModulok <modulok@gmail.com>
First post2013-09-23 11:32 -0600
Last post2013-09-23 11:32 -0600
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: building an online judge to evaluate Python programs Modulok <modulok@gmail.com> - 2013-09-23 11:32 -0600

#54654 — Re: building an online judge to evaluate Python programs

FromModulok <modulok@gmail.com>
Date2013-09-23 11:32 -0600
SubjectRe: building an online judge to evaluate Python programs
Message-ID<mailman.274.1379957537.18130.python-list@python.org>

[Multipart message — attachments visible in raw view] — view raw

>
>
> If you want to run untrusted Python code and prevent malice (or stupidity)
> from harming you, you need OS-level protection.
>
>
Agreed. Just for fun here's a simple example of what could be an honest
mistake
that consumes all physical memory and swap. A well behaved kernel will kill
the
process eventually when it can no longer allocate memory, but not before
bringing the machine to its knees:

    class Foo(object):
        def __init__(self):
            self.x = 1
        def __iter__(self):
            return self
        def next(self):
            self.x += 1
            # Oops. In a well behaved iterator this should eventually
            # raise 'StopIteration'. I knew I forgot something.


    a = Foo()
    b = list(a)


-Modulok-

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web