-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Service Arch
-
ALL
-
v8.0
-
Workload Scheduling 2024-06-10
Different smart pointers managing same raw pointer
This may cause a crash, as different smart pointers may try to delete the raw pointer twice. Same raw pointer is used to initialize or reset two or more different smart pointers.
/src/mongo/executor/connection_pool.cpp:907: MULTIPLE_INIT_SMART_PTRS 155063 Function "shared_ptr" assigns "conn" with "std::move(iter->second)".
/src/mongo/executor/connection_pool.cpp:922: MULTIPLE_INIT_SMART_PTRS 155063 Function "get" returns a pointer managed by "conn".
/src/mongo/executor/connection_pool.cpp:922: MULTIPLE_INIT_SMART_PTRS 155063 Assigning: "<temporary>" = "conn.get()".
/src/mongo/executor/connection_pool.cpp:923: MULTIPLE_INIT_SMART_PTRS 155063 Function "operator =" assigns "mappedConn" with "std::move(conn)".
/src/mongo/executor/connection_pool.cpp:927: MULTIPLE_INIT_SMART_PTRS 155063 Function "get" returns a pointer managed by "mappedConn".
- related to
-
SERVER-89315 Coverity analysis defect 147940: Different smart pointers managing same raw pointer
- Closed