niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Programming » python
Apparent eval() leak for python 2.3.5
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
Author Message
Pink
*nix forums beginner


Joined: 27 Feb 2005
Posts: 41

PostPosted: Fri Feb 17, 2006 7:34 pm    Post subject: Re: Apparent eval() leak for python 2.3.5 Reply with quote

John Marshall wrote:

Quote:
Hi,

I am reposting this message from python-dev.

Could someone please test the code below
to verify that there is indeed a problem
with eval() under python 2.3.5. I have
rebuilt python 2.3.5 under the latest debian
and under RH 7.3 (in case the problem is
in system libraries).

The following code causes the virtual memory
allocation to constantly increase until there
is no more memory left (the VIRT column of the
'top' utility display).

I have this leak, too in python2.3 under debian/sid:
Python 2.3.5 (#2, Nov 20 2005, 16:40:39)
[GCC 4.0.3 20051111 (prerelease) (Debian 4.0.2-4)] on linux2

python2.4 seems to be unaffected.
Python 2.4.2 (#2, Nov 20 2005, 17:04:4Cool
[GCC 4.0.3 20051111 (prerelease) (Debian 4.0.2-4)] on linux2

--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
Back to top
John Marshall
*nix forums beginner


Joined: 17 Feb 2006
Posts: 1

PostPosted: Fri Feb 17, 2006 6:21 pm    Post subject: Apparent eval() leak for python 2.3.5 Reply with quote

Hi,

I am reposting this message from python-dev.

Could someone please test the code below
to verify that there is indeed a problem
with eval() under python 2.3.5. I have
rebuilt python 2.3.5 under the latest debian
and under RH 7.3 (in case the problem is
in system libraries).

The following code causes the virtual memory
allocation to constantly increase until there
is no more memory left (the VIRT column of the
'top' utility display).

-----
#! /usr/bin/env python
#
# evalleak.py

def builddict():
d = {}
for i in xrange(10000):
d[i] = { "int": 0, "str": "nada", "dict": {} }
return d

if __name__ == "__main__":
d = builddict()
st = str(d)
print "len(st): %d" % len(st)
while 1:
d = eval(st)
-----

Thanks,
John
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
The time now is Thu Jan 08, 2009 12:04 pm | All times are GMT
navigation Forum index » Programming » python
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Python proficiency test Kent Johnson python 0 Fri Jul 21, 2006 10:47 am
No new posts Since there was talk of if-then-else not being allowed in... Casey Hawthorne python 5 Fri Jul 21, 2006 3:41 am
No new posts Using python code from Java? fortepianissimo python 4 Thu Jul 20, 2006 5:36 pm
No new posts FAQ 1.9 How does Perl compare with other languages like J... PerlFAQ Server Perl 0 Thu Jul 20, 2006 7:03 am
No new posts Depricated String Functions in Python Anoop python 14 Thu Jul 20, 2006 6:26 am

Arab Girl | Mobile Phone | Debt Consolidation | Libros medicina | Bankruptcy
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.2310s ][ Queries: 20 (0.1546s) ][ GZIP on - Debug on ]