[CDRIVER-1202] driver crashes for unfortunate query Created: 18/Apr/16  Updated: 03/May/17  Resolved: 18/Apr/16

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Jeroen Ooms [X] Assignee: A. Jesse Jiryu Davis
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to CDRIVER-697 Turn on basic err checking in release... Closed
is related to CDRIVER-1123 Defective JSON string lets API bson_j... Closed

 Description   

I was debugging a problem when I accidentally ran this query:

{"$oid":"57146936ba7cb24509006ac1"}

This query is obviously invalid because it misses the

 {"_id": ... }

part. However I did not expect it to crash my client:


> bson/bson.c:1405 bson_append_oid(): precondition failed: key
Abort trap: 6

Is it expected that certain invalid queries will make

 mongoc_collection_find

exit the client?



 Comments   
Comment by A. Jesse Jiryu Davis [ 19/Apr/16 ]

Right. 1.4 will be out in a month or two.

On Tue, Apr 19, 2016 at 4:38 AM, Jeroen Ooms (JIRA) <jira@mongodb.org>

Comment by Jeroen Ooms [X] [ 19/Apr/16 ]

OK that makes sense. So I have to wait for the 1.4 release later this year for this to be fixed?

Comment by A. Jesse Jiryu Davis [ 18/Apr/16 ]

I think this is a symptom of CDRIVER-1123.

Comment by Jeroen Ooms [X] [ 18/Apr/16 ]

I'm using the latest stable, 1.3.5

Comment by A. Jesse Jiryu Davis [ 18/Apr/16 ]

What libbson and libmongoc versions are you using? Is bson_as_json or other json functions in your code path?

I suspect you're seeing CDRIVER-1123.

Generated at Wed Feb 07 21:11:52 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.