Launchpad has imported 3 comments from the remote bug at
http://sourceware.org/bugzilla/show_bug.cgi?id=6966.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.

------------------------------------------------------------------------
On 2008-10-19T01:29:34+00:00 Bugzilla-t wrote:

hsearch references Kunth vol. 3 6.4 on "open addressing" but the code does
implement the algorithm from Knuth.  Instead of generating the second hash from
the first, the code generates the second hash from the first index.  Because
this hash is then used to step the index, the result is that the first index
generated is (almost) always the same.

This partly defeats the purpose of using a secondary hash.

I say "almost" because it happens for all but 2 of the possible index values in
any given table.  For example, in a table of size 11, all secondary probes will
start at index 10 unless the inital hash produced 9 or 10.

This was reported on news:comp.lang.c by James Dow Allen and I decided to check
on it.  I have a simple patch but I am not sure of the procedure for posting
patches to glibc.

Reply at: https://bugs.launchpad.net/glibc/+bug/367537/comments/0

------------------------------------------------------------------------
On 2008-10-19T01:33:40+00:00 Bugzilla-t wrote:

Created attachment 3006
Suggested fix.

The patch suggests two related changes.  First, that idx be set from hval
without reducing havl % htab->size.  hval2 can now be derived from hval without
generating the same probe sequence all the time.  Secondly, a new variable must
be used to detect the wrap-around, since hval no longer contains the initial
value of idx.

Reply at: https://bugs.launchpad.net/glibc/+bug/367537/comments/1

------------------------------------------------------------------------
On 2008-11-01T15:37:54+00:00 Drepper-fsp wrote:

Applied to cvs.

Reply at: https://bugs.launchpad.net/glibc/+bug/367537/comments/2


** Changed in: glibc
   Importance: Unknown => Low

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/367537

Title:
  [jaunty] Segmentation fault in hsearch_r of glibc-2.9

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to