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


Groups > comp.lang.python > #2760

Re: Sandboxed Python: memory limits?

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <martin@v.loewis.de>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.005
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'subject:Python': 0.04; 'extensions': 0.04; 'mentioned,': 0.05; 'covered.': 0.09; 'this:': 0.11; 'am,': 0.14; 'wrote:': 0.14; 'extensions,': 0.16; 'received:80.67': 0.16; 'received:80.67.31': 0.16; 'received:ispgateway.de': 0.16; 'subject:memory': 0.16; 'stuff': 0.18; 'modules': 0.20; 'cc:no real name:2**0': 0.20; 'cc:2**0': 0.20; 'header:In-Reply-To:1': 0.22; 'cc:addr:python-list': 0.22; 'thu,': 0.22; "i'm": 0.26; 'instead': 0.26; 'chris': 0.27; 'subject:?': 0.29; 'certainly': 0.29; 'cc:addr:python.org': 0.31; 'lock': 0.31; 'martin': 0.33; 'caught': 0.35; 'header:User- Agent:1': 0.35; 'too': 0.36; 'case,': 0.36; 'case': 0.37; 'apr': 0.38; 'but': 0.38; 'likely': 0.39; 'received:de': 0.39; 'would': 0.40; '2011': 0.62; 'believe': 0.66; 'schrieb': 0.84; 'stupid': 0.84; 'subject:limits': 0.84; 'instrument': 0.95
Date Thu, 07 Apr 2011 10:01:39 +0200
From "Martin v. Loewis" <martin@v.loewis.de>
User-Agent Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20110307 Icedove/3.0.11
MIME-Version 1.0
Newsgroups comp.lang.python
To Chris Angelico <rosuav@gmail.com>
Subject Re: Sandboxed Python: memory limits?
References <mailman.62.1302055157.9059.python-list@python.org> <inij0j$v6v$1@online.de> <mailman.91.1302134778.9059.python-list@python.org>
In-Reply-To <mailman.91.1302134778.9059.python-list@python.org>
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding 7bit
X-Df-Sender martin@v.loewis.de
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Message-ID <mailman.103.1302163340.9059.python-list@python.org> (permalink)
Lines 21
NNTP-Posting-Host 82.94.164.166
X-Trace 1302163340 news.xs4all.nl 81485 [::ffff:82.94.164.166]:58660
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:2760

Show key headers only | View raw


Am 07.04.2011 02:06, schrieb Chris Angelico:
> On Thu, Apr 7, 2011 at 6:38 AM, Martin v. Loewis <martin@v.loewis.de> wrote:
>> You can adjust the implementations of PyMem_Malloc and PyObject_Malloc.
>> This would catch many allocations, but not all of them. If you adjust
>> PyMem_MALLOC instead of PyMem_Malloc, you catch even more allocations -
>> but extensions modules which directly call malloc() still would bypass
>> this accounting.
> 
> I'm not too concerned about extensions, here; in any case, I lock most
> of them off. I just want to prevent stupid stuff like this:
> 
> a='a'
> while True:
>     a+=a

That would certainly be caught by instrumenting PyObject_MALLOC. More
generally, I believe that if you instrument the functions I mentioned,
your use case is likely covered.

Regards,
Martin

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Sandboxed Python: memory limits? Chris Angelico <rosuav@gmail.com> - 2011-04-06 11:59 +1000
  Re: Sandboxed Python: memory limits? "Martin v. Loewis" <martin@v.loewis.de> - 2011-04-06 22:38 +0200
    Re: Sandboxed Python: memory limits? Chris Angelico <rosuav@gmail.com> - 2011-04-07 10:06 +1000
      Re: Sandboxed Python: memory limits? "Martin v. Loewis" <martin@v.loewis.de> - 2011-04-07 10:01 +0200
      Re: Sandboxed Python: memory limits? "Martin v. Loewis" <martin@v.loewis.de> - 2011-04-07 10:01 +0200
    Re: Sandboxed Python: memory limits? Chris Angelico <rosuav@gmail.com> - 2011-04-07 10:10 +1000
      Re: Sandboxed Python: memory limits? David Bolen <db3l.net@gmail.com> - 2011-04-07 14:36 -0400
        Re: Sandboxed Python: memory limits? Chris Angelico <rosuav@gmail.com> - 2011-04-08 04:59 +1000

csiph-web