You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use bson::doc;use mongo_driver::client::{ClientPool,Uri};fnmain(){let mongo_uri = Uri::new("mongodb://127.0.0.1:27017").unwrap();let pool = ClientPool::new(mongo_uri,None);let ping = doc!{"ping": 1};
pool.pop().get_database("admin").command_simple(ping,None).unwrap();}
Run it with:
RUSTFLAGS="$RUSTFLAGS -Zsanitizer=address" cargo +nightly run --target=x86_64-unknown-linux-gnu
Possible reason
In database::command_simple(), when the bson_t is created the flags are set to 1, but after the bindings::mongoc_database_command_simple() the flags are set to 2. This means BSON_FLAG_STATIC which leads to skipping the free() in bson_destroy().
Not sure how this works internally, but this is my best guess...
The text was updated successfully, but these errors were encountered:
This is really strange
Reproduction
Run it with:
Possible reason
In
database::command_simple()
, when the bson_t is created the flags are set to 1, but after thebindings::mongoc_database_command_simple()
the flags are set to 2. This meansBSON_FLAG_STATIC
which leads to skipping thefree()
inbson_destroy()
.Not sure how this works internally, but this is my best guess...
The text was updated successfully, but these errors were encountered: