[ python-Bugs-1054139 ] serious string hashing error in 2.4b1
SourceForge.net
noreply at sourceforge.net
Tue Oct 26 00:32:06 CEST 2004
Bugs item #1054139, was opened at 2004-10-25 15:32
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1054139&group_id=5470
Category: Python Interpreter Core
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Bob Halley (rthalley)
Assigned to: Nobody/Anonymous (nobody)
Summary: serious string hashing error in 2.4b1
Initial Comment:
There is a serious hashing error in 2.4b1. I don't know if the
error is confined to 64-bit systems, or is a general problem.
The program attached to this report produces, as expected,
this output when run with python 2.3.3:
Python: 20303f0
System: Linux localhost 2.6.8-1.521 #1 Mon Aug 16 09:01:00
EDT 2004 x86
_64 x86_64 x86_64 GNU/Linux
hash("DNSSEC") == -7602892900506903802
hash("D") == 8704026181
hash("DN") == 8704052292078464
hash("DNS") == -2784798555566127274
hash("DNSS") == 5809125768486327656
hash("DNSSE") == 5232635463381381892
hash("DNSSEC") == -7602892900506903802
When run with 2.4b1, I get the following output:
Python: 20400b1
System: Linux localhost 2.6.8-1.521 #1 Mon Aug 16 09:01:00
EDT 2004 x86
_64 x86_64 x86_64 GNU/Linux
hash("DNSSEC") == -7602892900506903802
hash("D") == 8704026181
hash("DN") == 8704052292078464
hash("DNS") == 8704052292078464
hash("DNSS") == 8704052292078464
hash("DNSSE") == 8704052292078464
hash("DNSSEC") == 8704052292078464
Traceback (most recent call last):
File "foo.py", line 22, in ?
assert hb == ha, 'hashes do not match!'
AssertionError: hashes do not match!
The way I discovered this was that dnspython's regression
suite started failing because the string 'DNSSEC' constructed
character-by-character was not being found in a dictionary
which had a 'DNSSEC' key.
I have not yet found the underlying bug; I was focussing on
getting the info needed to demonstrate the bug first, since
it's so serious. If I make any progress fixing it, I'll send a
patch.
/Bob
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1054139&group_id=5470
More information about the Python-bugs-list
mailing list