Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugger fails to stop on entry due to stack walk failure #5464

Closed
gregg-miskelly opened this issue Mar 30, 2016 · 1 comment
Closed

Debugger fails to stop on entry due to stack walk failure #5464

gregg-miskelly opened this issue Mar 30, 2016 · 1 comment

Comments

@gregg-miskelly
Copy link
Contributor

Repro steps:

  1. Create hello world using dotnet new + dotnet restore + dotnet build
  2. Try to debug it on OSX/Linux
    Result:
    There is a good chance that the debugger will fail to stop on entry point. libmscordbi.so!CordbThread::GetActiveFrame is returning CORDBG_E_READVIRTUAL_FAILURE.

I don't yet know if there is something special about entry point, or if this will happen in general. I had trouble debugging this with release bits, so I switched to debug. Using debug bits, I get an assert in the same method which is therefore probably the problem, but I can't say for certain. Here is the assert --

Assert failure(PID 17345 [0x000043c1], Thread: 17517 [0x446d]): memoryRange.Size() <= 0xffffffff
File: /home/greggm/coreclr/src/debug/daccess/dacdbiimpl.cpp Line: 4110

Here is memoryRange:

  •   m_pStartAddress {...}   const PTR_VOID
    
  •   base    {...}   __TPtrBase
    m_addr  0xffffffff  TADDR
    m_cbBytes   0x63722d312e302e00  const SIZE_T
    

Which comes from this loop:
for (int i = 0; i < Debugger::kMaxHijackFunctions; i++)
{
InitTargetBufferFromMemoryRange(pDebugger->m_rgHijackFunction[i], &m_pCachedHijackFunction[i] );

i is 2, which I believe is this hijack --
GetMemoryRangeForFunction(RedirectedHandledJITCaseForDbgThreadControl_Stub,
RedirectedHandledJITCaseForDbgThreadControl_StubEnd)

libmscordaccore.so!InitTargetBufferFromMemoryRange(const MemoryRange memoryRange, TargetBuffer * pTargetBuffer) Line 4110   C++
libmscordaccore.so!DacDbiInterfaceImpl::IsRuntimeUnwindableStub(DacDbiInterfaceImpl * this, PCODE targetControlPC) Line 4958    C++
libmscordaccore.so!DacDbiInterfaceImpl::GetStackWalkCurrentFrameInfo(DacDbiInterfaceImpl * this, IDacDbiInterface::StackWalkHandle pSFIHandle, DebuggerIPCE_STRData * pFrameData) Line 383  C++
libmscordaccore.so!non-virtual thunk to DacDbiInterfaceImpl::GetStackWalkCurrentFrameInfo(void**, DebuggerIPCE_STRData*)() Line 405 C++
libmscordbi.so!CordbStackWalk::GetFrameWorker(CordbStackWalk * this, ICorDebugFrame ** ppFrame) Line 582    C++
libmscordbi.so!CordbStackWalk::GetFrame(CordbStackWalk * this, ICorDebugFrame ** ppFrame) Line 523  C++
libmscordbi.so!non-virtual thunk to CordbStackWalk::GetFrame(ICorDebugFrame**)() Line 539   C++
libmscordbi.so!ShimStackWalk::Populate(ShimStackWalk * this) Line 229   C++
libmscordbi.so!ShimStackWalk::ShimStackWalk(ShimStackWalk * this, ShimProcess * pProcess, ICorDebugThread * pThread) Line 34    C++
libmscordbi.so!ShimProcess::LookupOrCreateShimStackWalk(ShimProcess * this, ICorDebugThread * pThread) Line 1636    C++
libmscordbi.so!CordbThread::GetActiveFrame(CordbThread * this, ICorDebugFrame ** ppFrame) Line 1089 C++
libmscordbi.so!non-virtual thunk to CordbThread::GetActiveFrame(ICorDebugFrame**)() Line 1107   C++
libvsdebugeng.impl.so!ManagedDM::CV2InstrBreakpoint::Fire(ManagedDM::CV2InstrBreakpoint * this, Microsoft::VisualStudio::Debugger::DkmThread * pDkmThread, ICorDebugThread * pCorThread) Line 237   C++
libvsdebugeng.impl.so!ManagedDM::CV2DbiCallback::DoBreakpoint(ManagedDM::CV2DbiCallback * this, ICorDebugAppDomain * pCorAppDomain, ICorDebugThread * pCorThread, ICorDebugBreakpoint * pCorBreakpoint) Line 1553   C++
libvsdebugeng.impl.so!ManagedDM::CDbiCallback::DoDebugEvents(ManagedDM::CDbiCallback * this, ATL::CAtlList<CComObjectPtr<ManagedDM::CManagedDebugEvent>, ATL::CElementTraits<CComObjectPtr<ManagedDM::CManagedDebugEvent> > > * pEvents) Line 2247  C++
libvsdebugeng.impl.so!ManagedDM::CV2DbiCallback::ProcessStoppingDebugEvents(ManagedDM::CV2DbiCallback * this) Line 1324 C++
libvsdebugeng.impl.so!ManagedDM::CV2DbiCallback::DoStoppingDebugEvents(ManagedDM::CV2DbiCallback * this) Line 1289  C++
libvsdebugeng.impl.so!ManagedDM::CV2EventThread::MessageLoop(ManagedDM::CV2EventThread * this, ManagedDM::CV2Process * pDMProcess) Line 269 C++
libvsdebugeng.impl.so!ManagedDM::CV2EventThread::ManagedDMEventThreadFunc(void * pvMessage) Line 218    C++
libvsbaseservices.so!CorUnix::CPalThread::ThreadEntry(void * pvParam) Line 1620 C++
@mikem8361 mikem8361 self-assigned this Mar 30, 2016
mikem8361 referenced this issue in mikem8361/coreclr Mar 30, 2016
…failure"

By initializing m_rgHijackFunction to NULL.
mikem8361 referenced this issue in mikem8361/coreclr Mar 30, 2016
…failure"

By initializing m_rgHijackFunction to NULL.
mikem8361 referenced this issue in mikem8361/coreclr Mar 31, 2016
…failure"

By initializing m_rgHijackFunction to NULL.
@mikem8361
Copy link
Member

PR dotnet/coreclr#4010

joshfree referenced this issue in dotnet/coreclr Mar 31, 2016
Fixed issue #3987 "Debugger fails to stop on entry due to stack walk failure"
mikem8361 referenced this issue in mikem8361/coreclr Mar 31, 2016
…failure"

By initializing m_rgHijackFunction to NULL.
mikem8361 referenced this issue in dotnet/coreclr Mar 31, 2016
Fixed issue #3987 "Debugger fails to stop on entry due to stack walk failure"
@msftgits msftgits transferred this issue from dotnet/coreclr Jan 30, 2020
@msftgits msftgits added this to the 1.0.0-rc2 milestone Jan 30, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Jan 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants