|
|
|
|
|
|
| Author |
Message |
Pink *nix forums beginner
Joined: 27 Feb 2005
Posts: 41
|
Posted: Fri Feb 17, 2006 7:34 pm Post subject:
Re: Apparent eval() leak for python 2.3.5
|
|
|
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:4
[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
|
Posted: Fri Feb 17, 2006 6:21 pm Post subject:
Apparent eval() leak for python 2.3.5
|
|
|
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 |
|
 |
|
|
The time now is Thu Jan 08, 2009 12:04 pm | All times are GMT
|
|
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
|
|