未验证 提交 a30a2510 编写于 作者: N Noah Falk 提交者: GitHub

Fix jit attach hang at Shutdown (#67166)

Fixes #66715

We are seeing exceptions thrown at shutdown turn into hangs because the debugger
lock suspends threads at that point. We are mitigating that problem by disabling the
jit attach setup work and allowing WatsonLastChance to continue.
上级 0713627a
...@@ -6946,6 +6946,18 @@ BOOL Debugger::PreJitAttach(BOOL willSendManagedEvent, BOOL willLaunchDebugger, ...@@ -6946,6 +6946,18 @@ BOOL Debugger::PreJitAttach(BOOL willSendManagedEvent, BOOL willLaunchDebugger,
LOG( (LF_CORDB, LL_INFO10000, "D::PreJA: Entering\n") ); LOG( (LF_CORDB, LL_INFO10000, "D::PreJA: Entering\n") );
if (m_fShutdownMode)
{
// Trying to JitAttach because of some failure at shutdown is likely to block because we
// would suspend any thread that isn't the finalizer or debugger helper thread when it tries to
// take the debugger lock below. By bailing out here we won't do the JitAttach as we normally
// would, but at least the app should exit with an unhandled exception or FailFast rather
// entering a hung state. We believe this is very rare scenario so mitigating the problem in
// this way is sufficient.
LOG( (LF_CORDB, LL_INFO10000, "D::PreJA: Leaving - shutdown case\n") );
return FALSE;
}
// Multiple threads may be calling this, so need to take the lock. // Multiple threads may be calling this, so need to take the lock.
if(!m_jitAttachInProgress) if(!m_jitAttachInProgress)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册