The call to mongoc_client_new segfaults some/most of the time. It occasionally works, but there seems to be no pattern as to when it segfaults and when it succeeds. The same code was compiled against versions 1.3.6 and 1.5.0 of the Mongo C driver, and in both cases the behavior is similar.
See the attachment for the output when the example program is compiled, the source code for the example program, and the LLDB output, and the compile command.
NOTE: This also affects the C++ driver because the C++ driver calls the C driver internally.
- links to