Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-4662

Possible overflow parsing Decimal128 in extJSON with very large exponents

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.24.3
    • Affects Version/s: None
    • Component/s: Extended JSON, libbson
    • None

      DRIVER-2651 recently added new BSON corpus tests for Decimal128 where the degenerate_extjson representation uses very large exponent values.

      POC-ing these tests with PHPC resulted in several failures converting the degenerate extJSON to Canonical BSON. The code path in PHPC's test runner directly utilizes libbson's bson_new_from_json() function.

      The spec tests and details of the PHPC failures can be found in mongodb/specifications#1432. matt.dale@mongodb.com's assessment from this #dbx-devs thread is as follows:

      As far as the failures, the ones that failed with

      -180000001364000000000000000000000000000000fe5f00
      +180000001364000000000000000000000000000000000000
      

      were expecting 0E+6111 but got 0E-6176.

      The ones that failed with

      -180000001364000000000000000000000000000000008000
      +180000001364000000000000000000000000000000fedf00
      

      were expecting 0E-6176 but got 0E+6111.

      Seems like it could be some kind of exponent overflow/underflow problem.

            Assignee:
            josh.siegel@mongodb.com Josh Siegel
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: