[CDRIVER-4662] Possible overflow parsing Decimal128 in extJSON with very large exponents Created: 15/Jun/23 Updated: 28/Oct/23 Resolved: 24/Jul/23 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | Extended JSON, libbson |
| Affects Version/s: | None |
| Fix Version/s: | 1.24.3 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Jeremy Mikola | Assignee: | Josh Siegel (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Description |
|
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:
|
| Comments |
| Comment by Githook User [ 24/Jul/23 ] |
|
Author: {'name': 'Joshua Siegel', 'email': '39130209+joshbsiegel@users.noreply.github.com', 'username': 'joshbsiegel'}Message: |
| Comment by Githook User [ 24/Jul/23 ] |
|
Author: {'name': 'Joshua Siegel', 'email': '39130209+joshbsiegel@users.noreply.github.com', 'username': 'joshbsiegel'}Message: |
| Comment by Jeremy Mikola [ 13/Jul/23 ] |
|
When I originally reported this issue, the corpus tests were using "999999999999" as an exponent. Looking at what was ultimately merged in mongodb/specificatiosn@c09f979, the corpus tests now use "2147483647". I can confirm that the current tests pass in PHPC. I've left a comment on the original PR in mongodb/specifications#1432. I'll defer to you to decide if the original tests with "999999999999" should have passed, as matt.dale@mongodb.com did suggest it was an overflow/underflow error. |
| Comment by Josh Siegel (Inactive) [ 13/Jul/23 ] |
|
Hi jmikola@mongodb.com - we tried both running the spec tests here and writing some of our own tests here and were unable to reproduce the error in the C Driver. Is there anything additional that you are doing in the PHPC test runner? |