-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Networking & Observability
-
ALL
-
Networking & Obs 2025-01-20
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.
/data/bazel_cache/1de52aaeb35278243ca29a4785ce7969/execroot/_main_/src/mongo/executor/connection_pool.cpp:1017: MULTIPLE_INIT_SMART_PTRS 162325 Function "shared_ptr" assigns "conn" with "std::move(iter->second)".
/data/bazel_cache/1de52aaeb35278243ca29a4785ce7969/execroot/_main_/src/mongo/executor/connection_pool.cpp:1032: MULTIPLE_INIT_SMART_PTRS 162325 Function "get" returns a pointer managed by "conn".
/data/bazel_cache/1de52aaeb35278243ca29a4785ce7969/execroot/_main_/src/mongo/executor/connection_pool.cpp:1032: MULTIPLE_INIT_SMART_PTRS 162325 Assigning: "<temporary>" = "conn.get()".
/data/bazel_cache/1de52aaeb35278243ca29a4785ce7969/execroot/_main_/src/mongo/executor/connection_pool.cpp:1033: MULTIPLE_INIT_SMART_PTRS 162325 Function "operator =" assigns "mappedConn" with "std::move(conn)".
/data/bazel_cache/1de52aaeb35278243ca29a4785ce7969/execroot/_main_/src/mongo/executor/connection_pool.cpp:1037: MULTIPLE_INIT_SMART_PTRS 162325 Function "get" returns a pointer managed by "mappedConn".
- is related to
-
SERVER-89315 Coverity analysis defect 147940: Different smart pointers managing same raw pointer
- Closed