Re: hash_string broken

From: Robert Collins <robert.collins@dont-contact.us>
Date: Mon, 4 Jun 2001 23:09:01 +1000

----- Original Message -----
From: "Adrian Chadd" <adrian@creative.net.au>
To: "Robert Collins" <robert.collins@itdomain.com.au>
Cc: <squid-dev@squid-cache.org>
Sent: Monday, June 04, 2001 11:04 PM
Subject: Re: hash_string broken

> On Mon, Jun 04, 2001, 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.
> >
> > 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.
> >
> > On the other hand hash_string behaving non-deterministically is also
> > rather unlikely... any pointers?
>
> How about logging data/size and then n/j/i/i%size when you call
> hash_string?
>
> You might get some interesting results (eg the size might be changing
> and you're including a terminating NULL or missing the last
> character.)

Thanks... thats the sort of direction we're heading in :]. It's possible
that we're stomping all over the already in-hash usernames, but as those
usernames are shared with the auth_user struct usernames, that would
lead to suspect access.log entries (which hasn't been noticed to date
:0). <shrug>.

Rob
Received on Mon Jun 04 2001 - 07:09:19 MDT

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