pinpoint-apm / pinpoint-apm/pinpoint-cpp-agent

process-exit SIGABRT when the agent was never explicitly shut down

Open
#64 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
2
Forks
2
PR merge metrics
No merged PRs in 30d

Description

pinpoint::AgentImpl::~AgentImpl() (agent.cpp:261) lets a C++ exception escape during __cxa_finalize when the agent was never explicitly shut down. C++ then calls std::terminate() → abort() → SIGABRT.

20  dyld                            start + 2924
19  libsystem_c.dylib               exit + 44
18  libsystem_c.dylib               __cxa_finalize_ranges + 476          ← static dtors fire
17  libpinpoint_cpp.1.1.0.dylib     std::shared_ptr<AgentImpl>::~shared_ptr
16  libpinpoint_cpp.1.1.0.dylib     std::shared_ptr<AgentImpl>::~shared_ptr
15  libpinpoint_cpp.1.1.0.dylib     __shared_weak_count::__release_shared
14  libpinpoint_cpp.1.1.0.dylib     __shared_count::__release_shared
13  libpinpoint_cpp.1.1.0.dylib     __shared_ptr_emplace<AgentImpl>::__on_zero_shared
12  libpinpoint_cpp.1.1.0.dylib     __shared_ptr_emplace<AgentImpl>::__on_zero_shared_impl
11  libpinpoint_cpp.1.1.0.dylib     allocator_traits<allocator<AgentImpl>>::destroy
10  libpinpoint_cpp.1.1.0.dylib     allocator<AgentImpl>::destroy
 9  libpinpoint_cpp.1.1.0.dylib     pinpoint::AgentImpl::~AgentImpl() + 28   (agent.cpp:259)
 8  libpinpoint_cpp.1.1.0.dylib     pinpoint::AgentImpl::~AgentImpl() + 508  (agent.cpp:261)  ← throws here
 7  libc++abi.dylib                 std::terminate()
 6  libc++abi.dylib                 std::__terminate(...)
 5  libobjc.A.dylib                 _objc_terminate()
 4  libc++abi.dylib                 demangling_terminate_handler()
 3  libc++abi.dylib                 abort_message
 2  libsystem_c.dylib               abort + 128                          → SIGABRT

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in agent.cpp at AgentImpl::~AgentImpl(), especially the code around lines 259–261, and trace the cleanup path reached when the agent was never explicitly shut down. Reproduce the static-destruction scenario and verify that implicit cleanup does not let an exception escape or terminate the process with SIGABRT.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.