From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Fri, 10 Oct 2003 16:04:31 +0400 From: Alexey Tourbin To: devel@altlinux.ru Message-ID: <20031010120431.GL1726@julia.office.altlinux.ru> Mail-Followup-To: devel@altlinux.ru Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="U2AV99o4bq1UPJQr" Content-Disposition: inline Subject: [devel] Fwd: Hash seed breaks 5.8.1 binary API; fix suggested X-BeenThere: devel@altlinux.ru X-Mailman-Version: 2.1.2 Precedence: list Reply-To: ALT Devel discussion list List-Id: ALT Devel discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Oct 2003 12:04:34 -0000 Archived-At: List-Archive: List-Post: --U2AV99o4bq1UPJQr Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit Не знаю пока что делать. :( ----- Forwarded message from Chip Salzenberg ----- Date: Thu, 9 Oct 2003 22:41:34 -0400 From: Chip Salzenberg Subject: Hash seed breaks 5.8.1 binary API; fix suggested To: Perl 5 Porters Cc: debian-perl@lists.debian.org User-Agent: Mutt/1.5.4i I've found (with Walt Mankowski's help[*]) the probable explanation for why some modules -- most notably HTML::Parser -- break when Perl is upgraded from 5.8.0 to 5.8.1. The hash seeding implementation has broken the binary API. (Walt had the presence of mind to test with PERL_HASH_SEED=0 and found that it fixed the breakage.) Note that I say 5.8.1 broke the *binary* API. The *source* API is compatible, which is why rebuilding HTML::Parser fixes the problems. The problem originates in the placement of the code to add the seed to the hash. The traditional (unchanged) hash value should have been passed as always to the functions that expect it (e.g. hv_fetch_ent()), but instead it was made a part of the PERL_HASH() macro. Essentially the binary API changed - functions that used to expect a hash based on a string now expect a hash based on a string plus a global variable that didn't even exist before 5.8.1. I suggest we fix this problem in 5.8.2 (which should be released quickly) in the following fashion: 1. Decree that PL_hash_seed should forever and ever be zero. This will make 5.8.0 and 5.8.1 PERL_HASH() calculate the same value at all times. 2. Create a new variable PL_new_hash_seed which is initialized with the methods currently used for PL_hash_seed. 3. Add (or xor or whatever) PL_new_hash_seed with the user-provided hash value *inside* the functions that use hashes, *not* outside them. These changes should make 5.8.2 both source and binary compatible with both 5.8.0. and 5.8.1. -- Chip Salzenberg - a.k.a. - "I wanted to play hopscotch with the impenetrable mystery of existence, but he stepped in a wormhole and had to go in early." // MST3K ----- End forwarded message ----- --U2AV99o4bq1UPJQr Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/hqBPfBKgtDjnu0YRAr5GAJ9Lf2ZUCThPzthGjIo5CV0BhW5DuACdH7hW 0cZqdVOXpLEk/WxEOwaanJk= =YS9V -----END PGP SIGNATURE----- --U2AV99o4bq1UPJQr--