Zhoutall / stasis

Automatically exported from code.google.com/p/stasis
Other
0 stars 0 forks source link

Unexpected return value from linear hash table with variable-length keys #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Compile the attached hashtest.c file as follows:

gcc hashtest.c -lstasis -lpthread -lm

Running ./a.out yields the following:

ashok@ashok-desktop:~$ ./a.out 
found = 41
a.out: hashtest.c:80: main: Assertion `found == -1' failed.
Aborted

The assertion failure occurs because I do a hash-table lookup of a key that
was never inserted and expect a return value of -1.  However, I get a bogus
return value of '41'.

Original issue reported on code.google.com by ashok.su...@gmail.com on 20 May 2009 at 11:16

Attachments:

GoogleCodeExporter commented 9 years ago
Fixed in r1195.  pageOrientedList was treating prefixes of existing keys 
incorrectly.

Committed hashtest.c as check_linearHashNTA.c:lookupPrefix().

Original comment by sears.ru...@gmail.com on 21 May 2009 at 4:16