Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-10688

ForestDB should support endian-safe format.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • techdebt-backlog
    • 2.5.0
    • forestdb
    • Security Level: Public
    • None
    • Untriaged
    • Unknown

    Description

      The CRC checksum code in socio.cc looks like it will generate different checksums on big- and little-endian systems. Example code, at docio.cc:510:
      crc = crc32_8((void *)&doc->length, sizeof(doc->length), 0);
      doc->length is an integer so its byte layout varies by platform. It should be converted to big-endian form first before being added to the checksum.

      This could create problems for mobile use, since ARM platforms are usually big-endian while x86 is little-endian. Developers sometimes create an initial populated database on PC and install it into the mobile app, to avoid syncing so much data on first launch.

      It's also possible someone will use ForestDB as a document file format and want to transfer documents between systems of different endian-ness.

      Attachments

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

        Activity

          People

            jung-sang Jung-Sang Ahn (Inactive)
            jens Jens Alfke
            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