Skip to content

Abort while destroying std::thread inside WindowsNativeAdapter::~WindowsNativeAdapter #1065

@sentry

Description

@sentry

Sentry Issue: BINARYNINJA-3Q

STATUS_FATAL_APP_EXIT / 0x7ff690ec3f86: Fatal Error: STATUS_FATAL_APP_EXIT / 0x7ff690ec3f86
  File "crashpad_client_win.cc", line 230, in crashpad::`anonymous namespace'::HandleAbortSignal
  File "thread", line 95, in std::thread::{dtor}
  File "windowsnativeadapter.cpp", line 114, in BinaryNinjaDebugger::WindowsNativeAdapter::~WindowsNativeAdapter
  File "debuggerstate.cpp", line 1372, in BinaryNinjaDebugger::DebuggerState::~DebuggerState
  File "debuggercontroller.cpp", line 55, in BinaryNinjaDebugger::DebuggerController::~DebuggerController
...
(37 additional frame(s) were not displayed)

@bdash says:

This looks like it happens because m_debugThread was still joinable at destruction. This presumably means m_activelyDebugging was false and so the WindowsNativeAdapter destructor skipped attempting to join it. Destroying a std::thread with an associated thread (i.e., joinable() == true) is a fatal error.

I'm not sure if this is indicative of a logic error elsewhere, or if the destructor should explicitly check whether m_debugThread is joinable and join it if so.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions