[CDRIVER-2688] Crash from swift driver calling bson_init_from_json Created: 06/Jun/18 Updated: 27/Oct/23 Resolved: 11/Jun/18 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | json, libbson |
| Affects Version/s: | 1.10.1 |
| Fix Version/s: | 1.12.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Kevin Albertson | Assignee: | Kevin Albertson |
| Resolution: | Gone away | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
A test in the Swift driver kaitlin.mahar wrote crashes with a null pointer access in bson_init_from_json:
Kaitlin is able to reproduce this using 1.10 but not in 1.9 on macOS. This seems like an issue with the C driver. I couldn't reproduce the crash on Linux, nor from calling bson_init_from_json with the same arguments directly in the C driver. But I have not yet tested the Swift test on macOS yet. |
| Comments |
| Comment by Kevin Albertson [ 11/Jun/18 ] |
|
Fixed with commit to |
| Comment by Kaitlin Mahar [ 11/Jun/18 ] |
|
Sorry, missed your previous comment - we don't call bson_destroy_with_steal anywhere. I just built the C driver from master, and the test no longer fails. So yes, it seems that fixed it! Thanks. |
| Comment by A. Jesse Jiryu Davis [ 11/Jun/18 ] |
|
Kevin points out that my |
| Comment by A. Jesse Jiryu Davis [ 08/Jun/18 ] |
|
Could you check if Swift calls bson_destroy_with_steal? |