Re: hash_string broken

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Tue, 05 Jun 2001 09:44:13 +0200

Robert Collins wrote:
>
> I've logged a bugzilla entry on this, but we seem to have found a fault
> with hash_string:
>
> The string
> "cif_bm\\raffagli" in a hash of size 7921, sometimes gets inserted at
> 7482, and sometimes at 6475.

7482 appears to be the correct one.

> There is a possibility that bucket 7482 is the correct one, and we're
> overwriting a correctly inserted key for a different user, multiple
> times, all coincidentally when the bucket is 6475.

> All our crashes are with this username, which could imply a problem with
> our code related to bucket 7482, but as the auth code doesn't see the
> bucket number, that is rather unlikely.

Or it could be something else stomping on bucket 7482..

> On the other hand hash_string behaving non-deterministically is also
> rather unlikely... any pointers?

One approach is using some smart breakpoints to detect if there is
memory corruption. At least Intel processors supports hardware data
watches, not having any impact on the execution until hit.
  watch *(type *)0xADDRESS

Note: you have to use a fixed address, not an expression. Expressions
are evaluated runtime and thus not allowing for hardware watchpoints to
be used..

--
Henrik
Received on Tue Jun 05 2001 - 02:19:44 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:03 MST