Uploaded image for project: 'Couchbase C client library libcouchbase'
  1. Couchbase C client library libcouchbase
  2. CCBC-208

libvbucket CRC32 hashing function returns wrong hashes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Blocker
    • None
    • 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6
    • library
    • Security Level: Public
    • None
    • Windows & Linux (debian)

    Description

      It seems that the CRC32 hashing function in libvbucket (hash_crc32()) returns an invalid hash.

      For instance, hashing the key '1234567890' returns 9757 (0x261D), while it should return 639479525 (0x261DAEE5).

      Every key I tried (on both win and linux) returns a 16bit hash.

      The problem seems to be on line 85 in crc32.c.

      Changing the return expression to 'return crc ^ ~0;' fixes the problem and computes the correct hash.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ingenthr Matt Ingenthron
            Orfeas Zafeiris Orfeas Zafeiris
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty