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

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Critical - P2
    • None
    • Affects Version/s: legacy-1.0.0
    • Component/s: Implementation
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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
      

        1. test.cc
          0.2 kB

            Assignee:
            Adam Midvidy (Inactive)
            Reporter:
            Peng Xie
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: