This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: critical memory leak in hashlib.md5
Type: resource usage Stage:
Components: Versions: Python 2.6
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: agateriver, benjamin.peterson
Priority: normal Keywords:

Created on 2008-02-29 02:39 by agateriver, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
md5.txt agateriver, 2008-02-29 02:39
Messages (3)
msg63120 - (view) Author: Xie Bengui (agateriver) Date: 2008-02-29 02:42
I write a pieces of code below to find my lost password:

import hashlib

for i in range(9999,99999999):
	m=hashlib.md5(str(i)).hexdigest()
	if m=="21e83200cfd4845fd5e07ee151d70caf":
		print "password is: ", i
		break


when I run it serval minutes, all memory use up.
msg63121 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-02-29 02:54
This is not a hashlib problem (or a bug at all.) range returns an list
of 99990000 numbers. The allocation of this list is the part taking up
all the memory. Try replacing range with xrange.
msg63122 - (view) Author: Xie Bengui (agateriver) Date: 2008-02-29 03:01
I am sorry for submitting this fake issue!

Thank Benjamin Peterson!
History
Date User Action Args
2022-04-11 14:56:31adminsetgithub: 46459
2008-02-29 14:09:17georg.brandlsetstatus: open -> closed
resolution: not a bug
2008-02-29 03:01:12agateriversetnosy: + agateriver
messages: + msg63122
2008-02-29 02:55:57benjamin.petersonsetseverity: normal -> minor
2008-02-29 02:54:35benjamin.petersonsetnosy: + benjamin.peterson
messages: + msg63121
2008-02-29 02:43:15agateriversetnosy: - agateriver
2008-02-29 02:42:30agateriversetmessages: + msg63120
2008-02-29 02:39:58agaterivercreate