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

MONGO_INITIALIZER_GENERAL in src/mongo/bson/oid.cpp won't execute

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical - P2 Critical - P2
    • None
    • legacy-1.0.0
    • Implementation

    Description

      MONGO_INITIALIZER_GENERAL in src/mongo/bson/oid.cpp fails to execute and makes

      src/mongo/bson/oid.cpp

      boost::scoped_ptr<AtomicUInt32> counter;
      

      a null pointer.

      This leads failure to call:

      src/mongo/bson/oid.cpp

      OID::Increment OID::Increment::next()
      

      Running the binary compiled from

      test.cc

      //  scons --variant-dir=build   --disable-warnings-as-errors  --c++11=on --opt=off   --sharedclient  --ssl
      //  g++ test.cc -lmongoclient -std=c++0x && ./a.out
       
      #include <mongo/bson/bson.h>
       
      int main() {
        mongo::OID::gen();
      }
      

      ends to:

      a.out: /usr/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.
      Aborted
      

      Attachments

        1. test.cc
          0.2 kB

        Activity

          People

            adam.midvidy Adam Midvidy
            mapx Peng Xie
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: