Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.039 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; 'python': 0.07; "it'd": 0.09; 'scripts': 0.10; 'pm,': 0.11; 'wrote:': 0.14; 'defined': 0.15; '###': 0.16; 'fiddle': 0.16; 'install...': 0.16; 'nefarious': 0.16; 'header:In-Reply-To:1': 0.22; 'mon,': 0.22; 'wonder': 0.24; 'memory': 0.24; 'environment': 0.26; 'instead': 0.26; 'chris': 0.27; 'tried': 0.27; 'message-id:@mail.gmail.com': 0.28; 'skip:" 30': 0.29; 'btw,': 0.31; 'subject.': 0.31; 'it.': 0.31; 'to:addr:python-list': 0.32; 'point': 0.35; 'machine': 0.37; 'received:209.85': 0.37; 'apr': 0.38; 'thread': 0.38; 'received:google.com': 0.38; 'but': 0.38; 'current': 0.38; 'unless': 0.38; 'to:addr:python.org': 0.39; 'received:209': 0.39; 'would': 0.40; 'header:Received:5': 0.40; '2011': 0.62; 'our': 0.63; 'double': 0.69; 'bombs': 0.84; 'received:209.85.210.174': 0.84; 'received:mail-iy0-f174.google.com': 0.84; 'safe.': 0.95 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=uolVWRLbqHKs5m+eyfo62dsuP8g/l0e+tLabAWshbow=; b=my+AYUi0RUXUS2bUs4nZ1RzD0KP5yjl6boiu5DABwYXcZOkL7qssLauHA1SOZp3p0r ScfsTjMzRX4YceAm0ZA+GzVB6QlPJktZo1q1MT8AHERigreuAXE27rx/sZl7xMD133M4 ZCXMuEKfk18Chcy4FACvS3juqBnw96D7YIv+A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=uL2ITZz5xgo0Goe7aNLRHHjxGGL7mWxAP5bmCu5GeihSxGDGVdIh02P8ojO1o7swLg RWkBJmuXZ4CL1F2UU2GG1GcbVkQ2stg02iMAe03Cr9+bbL0nmxvuAjd97Wr1z1JseqV9 bLOybVWJo7I2IcYUh8V9s7aekiNkQhyL/OJaM= MIME-Version: 1.0 In-Reply-To: <20110418105300.S4T3T.1176868.root@web11-winn.ispmail.private.ntl.com> References: <20110418105300.S4T3T.1176868.root@web11-winn.ispmail.private.ntl.com> Date: Mon, 18 Apr 2011 19:57:00 +1000 Subject: Re: An unusual question... From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 30 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1303120624 news.xs4all.nl 81474 [::ffff:82.94.164.166]:59601 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:3479 On Mon, Apr 18, 2011 at 7:53 PM, wrote: > Talking of nefarious usage... > > I wonder what this would do left unchecked on a current machine and curre= nt Python install... > > ### > > global somestring > somestring =3D " " > > while 1: > =A0 =A0 =A0 =A0#print somestring > =A0 =A0 =A0 =A0somestring =3D somestring + " " > > ### It'd take a while, but eventually bomb with MemoryError. If instead you double the string's length with "somestring=3Dsomestring+somestring", it'll bomb a lot quicker. I know because I tried it. We have an isolation environment in which we'll be allowing our clients to provide Python scripts - which means we have to be sure it'll all be safe. BTW, the point at which it bombs is defined by ulimit/rlimit, unless you fiddle with the memory allocator. See previous thread on the subject. :D Chris Angelico