Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-6014

BSON incorrectly deserializes floats on Big endian systems

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Critical - P2 Critical - P2
    • bson-6.5.0
    • Affects Version/s: bson-6.4.0
    • Component/s: None
    • 2
    • Not Needed
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      Use Case

      As a Node.js BSON library user
      I want decode 64 bit floats on big-endian machines
      So that I obtain the correct data from BSON

      Regression introduced in: https://github.com/mongodb/js-bson/pull/649

      User Impact

      • Big-endian systems will parse the bytes in reverse order

      Dependencies

      • NumberUtils.get/setFloat64LE

      Unknowns

      • Can we enable testing easily?

      Acceptance Criteria

      Implementation Requirements

      • Detect endianness and flip the offset logic inside the float parsing and serializing methods

      Testing Requirements

      • Manual testing if adding a new evergreen host proves difficult. Follow up with adding CI testing.

      Documentation Requirements

      • None

      Follow Up Requirements

      • None

            Assignee:
            neal.beeken@mongodb.com Neal Beeken
            Reporter:
            neal.beeken@mongodb.com Neal Beeken
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: