Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-523

OID::gen, createIndex, needs sensible error if client::initialize is not called

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: legacy-1.0.0-rc4, legacy-1.0.0
    • Component/s: API
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      #include <mongo/client/dbclient.h>
      #include <mongo/bson/oid.h>

      int main( int argc, char const* argv[] ){
      mongo::OID::gen();
      }

      Yields:

      /usr/local/include/boost/smart_ptr/scoped_ptr.hpp:99: T* boost::scoped_ptr<T>::operator->() const [with T = mongo::AtomicWord<unsigned int>]: Assertion `px != 0' failed.

      I can create a client connection and createIndex. The library then fails in the same mysterious way.

      client::initialize() was missed. Library should error out sensibly where initialize is required and forgotten.

            Assignee:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Reporter:
            stuartreynolds Stuart Reynolds
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: