-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: 3.0.3
-
Component/s: Portability
-
None
-
Environment:Windows 7, 32 bit binary, 64 bit OS
Basically, if I try to use the simple mongo client data structure listed in the tutorial, I get a hard crash in Windows 7.
This is my fully-contained working example that demonstrates the issue:
```
#include <cstdint>
#include <iostream>
#include <vector>
#include <bsoncxx/json.hpp>
#include <mongocxx/client.hpp>
#include <mongocxx/stdx.hpp>
#include <mongocxx/uri.hpp>
using bsoncxx::builder::stream::close_array;
using bsoncxx::builder::stream::close_document;
using bsoncxx::builder::stream::document;
using bsoncxx::builder::stream::finalize;
using bsoncxx::builder::stream::open_array;
using bsoncxx::builder::stream::open_document;
int main(void)
{
try {
mongocxx::uri uri("mongodb://localhost:27017");
// this is what's failing
mongocxx::client client
;
}
catch (std::exception err)
return 0;
}
```
It seems like it's an issue deep in the Mongo callstack:
> libmongoc-1.0.dll!_InterlockedExchangeAdd64(volatile __int64 * Addend, __int64 Value) Line 5603 C
Namely, this line here:
```
do
while (InterlockedCompareExchange64(Addend,
Old + Value,
Old) != Old);
```
I installed the mongo-cxx-driver using vcpkg as well.