==2254== Memcheck, a memory error detector ==2254== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al. ==2254== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info ==2254== Command: ./tutorial ==2254== Parent PID: 2253 ==2254== ==2254== ==2254== HEAP SUMMARY: ==2254== in use at exit: 744 bytes in 19 blocks ==2254== total heap usage: 483 allocs, 464 frees, 137,635 bytes allocated ==2254== ==2254== 8 bytes in 1 blocks are still reachable in loss record 1 of 19 ==2254== at 0x4A075BC: operator new(unsigned long) (vg_replace_malloc.c:298) ==2254== by 0x4795C2: __gnu_cxx::new_allocator::allocate(unsigned long, void const*) (new_allocator.h:89) ==2254== by 0x4789DA: std::_Vector_base >::_M_allocate(unsigned long) (stl_vector.h:140) ==2254== by 0x477322: std::vector >::_M_insert_aux(__gnu_cxx::__normal_iterator > >, mongo::PeriodicTask* const&) (vector.tcc:322) ==2254== by 0x475509: std::vector >::push_back(mongo::PeriodicTask* const&) (stl_vector.h:741) ==2254== by 0x471F34: mongo::PeriodicTask::Runner::add(mongo::PeriodicTask*) (background.cpp:145) ==2254== by 0x471E7D: mongo::PeriodicTask::PeriodicTask() (background.cpp:136) ==2254== by 0x499A82: mongo::DBConnectionPool::DBConnectionPool() (connpool.cpp:176) ==2254== by 0x49C07B: __static_initialization_and_destruction_0(int, int) (connpool.cpp:171) ==2254== by 0x49C0B1: global constructors keyed to mongo::PoolForHost::~PoolForHost() (connpool.cpp:499) ==2254== by 0x4ABDF5: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== by 0x40ADF2: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== ==2254== 16 bytes in 1 blocks are still reachable in loss record 2 of 19 ==2254== at 0x4A075BC: operator new(unsigned long) (vg_replace_malloc.c:298) ==2254== by 0x499B0E: mongo::DBConnectionPool::DBConnectionPool() (connpool.cpp:176) ==2254== by 0x49C07B: __static_initialization_and_destruction_0(int, int) (connpool.cpp:171) ==2254== by 0x49C0B1: global constructors keyed to mongo::PoolForHost::~PoolForHost() (connpool.cpp:499) ==2254== by 0x4ABDF5: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== by 0x40ADF2: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== ==2254== 16 bytes in 1 blocks are still reachable in loss record 3 of 19 ==2254== at 0x4A075BC: operator new(unsigned long) (vg_replace_malloc.c:298) ==2254== by 0x4983F4: __static_initialization_and_destruction_0(int, int) (clientAndShell.cpp:37) ==2254== by 0x49844D: global constructors keyed to mongo::cmdLine (clientAndShell.cpp:85) ==2254== by 0x4ABDF5: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== by 0x40ADF2: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== ==2254== 16 bytes in 1 blocks are still reachable in loss record 4 of 19 ==2254== at 0x4A075BC: operator new(unsigned long) (vg_replace_malloc.c:298) ==2254== by 0x48711F: __static_initialization_and_destruction_0(int, int) (sock.cpp:338) ==2254== by 0x487176: global constructors keyed to mongo::throwSockExcep (sock.cpp:777) ==2254== by 0x4ABDF5: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== by 0x40ADF2: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== ==2254== 24 bytes in 1 blocks are still reachable in loss record 5 of 19 ==2254== at 0x4A075BC: operator new(unsigned long) (vg_replace_malloc.c:298) ==2254== by 0x4923E2: mongo::Status::getOKInfo() (status.cpp:24) ==2254== by 0x44D0F5: mongo::Status::OK() (status.h:52) ==2254== by 0x48BA10: mongo::InitializerDependencyGraph::addInitializer(std::string const&, boost::function const&, std::vector > const&, std::vector > const&) (initializer_dependency_graph.cpp:49) ==2254== by 0x48B6B7: mongo::GlobalInitializerRegisterer::GlobalInitializerRegisterer(std::string const&, boost::function const&, std::vector > const&, std::vector > const&) (global_initializer_registerer.cpp:33) ==2254== by 0x4A5C90: __static_initialization_and_destruction_0(int, int) (fail_point_service.cpp:20) ==2254== by 0x4A60B2: global constructors keyed to mongo::dummy (fail_point_service.cpp:37) ==2254== by 0x4ABDF5: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== by 0x40ADF2: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== ==2254== 24 bytes in 1 blocks are still reachable in loss record 6 of 19 ==2254== at 0x4A075BC: operator new(unsigned long) (vg_replace_malloc.c:298) ==2254== by 0x479353: boost::detail::shared_count::shared_count(mongo::BackgroundJob::JobStatus*) (shared_count.hpp:130) ==2254== by 0x478489: void boost::detail::sp_pointer_construct(boost::shared_ptr*, mongo::BackgroundJob::JobStatus*, boost::detail::shared_count&) (shared_ptr.hpp:276) ==2254== by 0x476F14: boost::shared_ptr::shared_ptr(mongo::BackgroundJob::JobStatus*) (shared_ptr.hpp:354) ==2254== by 0x4750C8: void boost::shared_ptr::reset(mongo::BackgroundJob::JobStatus*) (shared_ptr.hpp:625) ==2254== by 0x471388: mongo::BackgroundJob::BackgroundJob(bool) (background.cpp:48) ==2254== by 0x47416D: mongo::PeriodicTask::Runner::Runner() (background.h:128) ==2254== by 0x471E3F: mongo::PeriodicTask::PeriodicTask() (background.cpp:135) ==2254== by 0x499A82: mongo::DBConnectionPool::DBConnectionPool() (connpool.cpp:176) ==2254== by 0x49C07B: __static_initialization_and_destruction_0(int, int) (connpool.cpp:171) ==2254== by 0x49C0B1: global constructors keyed to mongo::PoolForHost::~PoolForHost() (connpool.cpp:499) ==2254== by 0x4ABDF5: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== ==2254== 40 bytes in 1 blocks are still reachable in loss record 7 of 19 ==2254== at 0x4A075BC: operator new(unsigned long) (vg_replace_malloc.c:298) ==2254== by 0x4204ED: mongo::mutex::mutex(char const*) (mutex.h:70) ==2254== by 0x4A3888: mongo::FailPoint::FailPoint() (fail_point.cpp:29) ==2254== by 0x4A5BB8: __static_initialization_and_destruction_0(int, int) (fail_point_service.cpp:20) ==2254== by 0x4A60B2: global constructors keyed to mongo::dummy (fail_point_service.cpp:37) ==2254== by 0x4ABDF5: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== by 0x40ADF2: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== ==2254== 40 bytes in 1 blocks are still reachable in loss record 8 of 19 ==2254== at 0x4A075BC: operator new(unsigned long) (vg_replace_malloc.c:298) ==2254== by 0x4204ED: mongo::mutex::mutex(char const*) (mutex.h:70) ==2254== by 0x473F8E: mongo::BackgroundJob::JobStatus::JobStatus(bool) (background.cpp:38) ==2254== by 0x47135A: mongo::BackgroundJob::BackgroundJob(bool) (background.cpp:48) ==2254== by 0x47416D: mongo::PeriodicTask::Runner::Runner() (background.h:128) ==2254== by 0x471E3F: mongo::PeriodicTask::PeriodicTask() (background.cpp:135) ==2254== by 0x499A82: mongo::DBConnectionPool::DBConnectionPool() (connpool.cpp:176) ==2254== by 0x49C07B: __static_initialization_and_destruction_0(int, int) (connpool.cpp:171) ==2254== by 0x49C0B1: global constructors keyed to mongo::PoolForHost::~PoolForHost() (connpool.cpp:499) ==2254== by 0x4ABDF5: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== by 0x40ADF2: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== ==2254== 40 bytes in 1 blocks are still reachable in loss record 9 of 19 ==2254== at 0x4A075BC: operator new(unsigned long) (vg_replace_malloc.c:298) ==2254== by 0x4204ED: mongo::mutex::mutex(char const*) (mutex.h:70) ==2254== by 0x499AA2: mongo::DBConnectionPool::DBConnectionPool() (connpool.cpp:176) ==2254== by 0x49C07B: __static_initialization_and_destruction_0(int, int) (connpool.cpp:171) ==2254== by 0x49C0B1: global constructors keyed to mongo::PoolForHost::~PoolForHost() (connpool.cpp:499) ==2254== by 0x4ABDF5: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== by 0x40ADF2: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== ==2254== 40 bytes in 1 blocks are still reachable in loss record 10 of 19 ==2254== at 0x4A075BC: operator new(unsigned long) (vg_replace_malloc.c:298) ==2254== by 0x4204ED: mongo::mutex::mutex(char const*) (mutex.h:70) ==2254== by 0x498407: __static_initialization_and_destruction_0(int, int) (clientAndShell.cpp:37) ==2254== by 0x49844D: global constructors keyed to mongo::cmdLine (clientAndShell.cpp:85) ==2254== by 0x4ABDF5: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== by 0x40ADF2: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== ==2254== 40 bytes in 1 blocks are still reachable in loss record 11 of 19 ==2254== at 0x4A075BC: operator new(unsigned long) (vg_replace_malloc.c:298) ==2254== by 0x4204ED: mongo::mutex::mutex(char const*) (mutex.h:70) ==2254== by 0x4A3888: mongo::FailPoint::FailPoint() (fail_point.cpp:29) ==2254== by 0x486F76: __static_initialization_and_destruction_0(int, int) (sock.cpp:48) ==2254== by 0x487176: global constructors keyed to mongo::throwSockExcep (sock.cpp:777) ==2254== by 0x4ABDF5: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== by 0x40ADF2: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== ==2254== 40 bytes in 1 blocks are still reachable in loss record 12 of 19 ==2254== at 0x4A075BC: operator new(unsigned long) (vg_replace_malloc.c:298) ==2254== by 0x4204ED: mongo::mutex::mutex(char const*) (mutex.h:70) ==2254== by 0x4819C3: mongo::Ports::Ports() (message_port.cpp:100) ==2254== by 0x481398: __static_initialization_and_destruction_0(int, int) (message_port.cpp:121) ==2254== by 0x4813DE: global constructors keyed to mongo::AbstractMessagingPort::setConnectionId(long long) (message_port.cpp:300) ==2254== by 0x4ABDF5: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== by 0x40ADF2: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== ==2254== 40 bytes in 1 blocks are still reachable in loss record 13 of 19 ==2254== at 0x4A075BC: operator new(unsigned long) (vg_replace_malloc.c:298) ==2254== by 0x4204ED: mongo::mutex::mutex(char const*) (mutex.h:70) ==2254== by 0x47CF1D: __static_initialization_and_destruction_0(int, int) (log.cpp:62) ==2254== by 0x47CFC5: global constructors keyed to mongo::Logstream::registerExtraLogContextFn(void (*)(mongo::_BufBuilder&)) (log.cpp:459) ==2254== by 0x4ABDF5: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== by 0x40ADF2: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== ==2254== 40 bytes in 1 blocks are still reachable in loss record 14 of 19 ==2254== at 0x4A075BC: operator new(unsigned long) (vg_replace_malloc.c:298) ==2254== by 0x4204ED: mongo::mutex::mutex(char const*) (mutex.h:70) ==2254== by 0x43E581: __static_initialization_and_destruction_0(int, int) (dbclient_rs.cpp:58) ==2254== by 0x43E67D: global constructors keyed to mongo::ReplicaSetMonitor::_setsLock (dbclient_rs.cpp:2191) ==2254== by 0x4ABDF5: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== by 0x40ADF2: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== ==2254== 40 bytes in 1 blocks are still reachable in loss record 15 of 19 ==2254== at 0x4A075BC: operator new(unsigned long) (vg_replace_malloc.c:298) ==2254== by 0x4204ED: mongo::mutex::mutex(char const*) (mutex.h:70) ==2254== by 0x4410FB: mongo::ReplicaSetMonitorWatcher::ReplicaSetMonitorWatcher() (dbclient_rs.cpp:65) ==2254== by 0x43E5E4: __static_initialization_and_destruction_0(int, int) (dbclient_rs.cpp:103) ==2254== by 0x43E67D: global constructors keyed to mongo::ReplicaSetMonitor::_setsLock (dbclient_rs.cpp:2191) ==2254== by 0x4ABDF5: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== by 0x40ADF2: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== ==2254== 40 bytes in 1 blocks are definitely lost in loss record 16 of 19 ==2254== at 0x4A075BC: operator new(unsigned long) (vg_replace_malloc.c:298) ==2254== by 0x4204ED: mongo::mutex::mutex(char const*) (mutex.h:70) ==2254== by 0x473F8E: mongo::BackgroundJob::JobStatus::JobStatus(bool) (background.cpp:38) ==2254== by 0x47135A: mongo::BackgroundJob::BackgroundJob(bool) (background.cpp:48) ==2254== by 0x4410DB: mongo::ReplicaSetMonitorWatcher::ReplicaSetMonitorWatcher() (dbclient_rs.cpp:65) ==2254== by 0x43E5E4: __static_initialization_and_destruction_0(int, int) (dbclient_rs.cpp:103) ==2254== by 0x43E67D: global constructors keyed to mongo::ReplicaSetMonitor::_setsLock (dbclient_rs.cpp:2191) ==2254== by 0x4ABDF5: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== by 0x40ADF2: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== ==2254== 56 bytes in 1 blocks are still reachable in loss record 17 of 19 ==2254== at 0x4A075BC: operator new(unsigned long) (vg_replace_malloc.c:298) ==2254== by 0x471E1B: mongo::PeriodicTask::PeriodicTask() (background.cpp:135) ==2254== by 0x499A82: mongo::DBConnectionPool::DBConnectionPool() (connpool.cpp:176) ==2254== by 0x49C07B: __static_initialization_and_destruction_0(int, int) (connpool.cpp:171) ==2254== by 0x49C0B1: global constructors keyed to mongo::PoolForHost::~PoolForHost() (connpool.cpp:499) ==2254== by 0x4ABDF5: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== by 0x40ADF2: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== ==2254== 64 bytes in 1 blocks are still reachable in loss record 18 of 19 ==2254== at 0x4A075BC: operator new(unsigned long) (vg_replace_malloc.c:298) ==2254== by 0x48138A: __static_initialization_and_destruction_0(int, int) (message_port.cpp:121) ==2254== by 0x4813DE: global constructors keyed to mongo::AbstractMessagingPort::setConnectionId(long long) (message_port.cpp:300) ==2254== by 0x4ABDF5: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== by 0x40ADF2: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== ==2254== 120 bytes in 1 blocks are still reachable in loss record 19 of 19 ==2254== at 0x4A075BC: operator new(unsigned long) (vg_replace_malloc.c:298) ==2254== by 0x471346: mongo::BackgroundJob::BackgroundJob(bool) (background.cpp:48) ==2254== by 0x47416D: mongo::PeriodicTask::Runner::Runner() (background.h:128) ==2254== by 0x471E3F: mongo::PeriodicTask::PeriodicTask() (background.cpp:135) ==2254== by 0x499A82: mongo::DBConnectionPool::DBConnectionPool() (connpool.cpp:176) ==2254== by 0x49C07B: __static_initialization_and_destruction_0(int, int) (connpool.cpp:171) ==2254== by 0x49C0B1: global constructors keyed to mongo::PoolForHost::~PoolForHost() (connpool.cpp:499) ==2254== by 0x4ABDF5: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== by 0x40ADF2: ??? (in /root/mongo-cxx-driver-v2.4/src/mongo/client/examples/tutorial) ==2254== ==2254== LEAK SUMMARY: ==2254== definitely lost: 40 bytes in 1 blocks ==2254== indirectly lost: 0 bytes in 0 blocks ==2254== possibly lost: 0 bytes in 0 blocks ==2254== still reachable: 704 bytes in 18 blocks ==2254== suppressed: 0 bytes in 0 blocks ==2254== ==2254== For counts of detected and suppressed errors, rerun with: -v ==2254== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 6 from 6)