Skip to content

.NET Debugging services crash in ASP.NET project that raises exceptions #115668

@gregg-miskelly

Description

@gregg-miskelly
Contributor

Description

When debugging an ASP.NET project that raises exceptions, the debugger will crash while attempting to unwind the call stack.

The debugger process crashes with the following stack. The issue is that Rsp is 0.

libmscordaccore.so!MemoryRead64(PULONG64 addr) Line 30
libmscordaccore.so!OOPStackUnwinderAMD64::UnwindPrologue(ULONG64 ImageBase, ULONG64 ImageBase@entry, ULONG64 ControlPc, ULONG64 ControlPc@entry, ULONG64 FrameBase, _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry, _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry@entry, PCONTEXT ContextRecord, PCONTEXT ContextRecord@entry, PKNONVOLATILE_CONTEXT_POINTERS ContextPointers, PKNONVOLATILE_CONTEXT_POINTERS ContextPointers@entry, _PIMAGE_RUNTIME_FUNCTION_ENTRY * FinalFunctionEntry) Line 754    
libmscordaccore.so!OOPStackUnwinderAMD64::VirtualUnwind(DWORD HandlerType, DWORD HandlerType@entry, ULONG64 ImageBase, ULONG64 ControlPc, ULONG64 ControlPc@entry, _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry, _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry@entry, PCONTEXT ContextRecord, PCONTEXT ContextRecord@entry, PVOID * HandlerData, PVOID * HandlerData@entry, PULONG64 EstablisherFrame, PKNONVOLATILE_CONTEXT_POINTERS ContextPointers, PEXCEPTION_ROUTINE * HandlerRoutine) Line 1617   
libmscordaccore.so!OOPStackUnwinderAMD64::Unwind(CONTEXT * pContext) Line 255    
libmscordaccore.so!DacUnwindStackFrame(CONTEXT * pContext, KNONVOLATILE_CONTEXT_POINTERS * pContextPointers) Line 207    
libmscordaccore.so!Thread::VirtualUnwindCallFrame(CONTEXT * pContext, KNONVOLATILE_CONTEXT_POINTERS * pContextPointers, EECodeInfo * pCodeInfo) Line 637    
libmscordaccore.so!EECodeManager::EnsureCallerContextIsValid(PREGDISPLAY pRD, EECodeInfo * pCodeInfo, unsigned int flags) Line 1033   
libmscordaccore.so!StackFrameIterator::ResetRegDisp(StackFrameIterator * this, PREGDISPLAY pRegDisp, bool fIsFirst) Line 1301
libmscordaccore.so!DacDbiInterfaceImpl::SetStackWalkCurrentContext(DacDbiInterfaceImpl * this, IDacDbiInterface::StackWalkHandle pSFIHandle, CorDebugSetContextFlag flag, DT_CONTEXT * pContext) Line 193   
libmscordbi.so!CordbStackWalk::SetContextWorker(CordbStackWalk * this, CordbStackWalk * this@entry, CorDebugSetContextFlag flag, CorDebugSetContextFlag flag@entry, ULONG32 contextSize, ULONG32 contextSize@entry, BYTE * context, BYTE * context@entry) Line 401
libmscordbi.so!CordbStackWalk::SetContext(CordbStackWalk * this, CorDebugSetContextFlag flag, ULONG32 contextSize, BYTE * context) Line 355 
libmscordbi.so!ShimStackWalk::CheckInternalFrame(ICorDebugFrame * pNextStackFrame, ShimStackWalk::StackWalkInfo * pStackWalkInfo, ShimStackWalk::StackWalkInfo * pStackWalkInfo@entry, ICorDebugThread3 * pThread3, ICorDebugStackWalk * pSW) Line 1220
libmscordbi.so!ShimStackWalk::Populate(ShimStackWalk * this, ShimStackWalk * this@entry) Line 265 
libmscordbi.so!ShimStackWalk::ShimStackWalk(ShimStackWalk * this, ShimProcess * pProcess, ICorDebugThread * pThread) Line 33   
libmscordbi.so!ShimProcess::LookupOrCreateShimStackWalk(ShimProcess * this, ICorDebugThread * pThread) Line 1498
libmscordbi.so!CordbThread::FindFrame(CordbThread * this, ICorDebugFrame ** ppFrame, FramePointer fp) Line 1402 
libmscordbi.so!UpdateFrame(ICorDebugThread * pThread, ICorDebugThread * pThread@entry, ICorDebugFrame * pOldFrame) Line 106  
libmscordbi.so!ShimProxyCallback::Exception(ICorDebugAppDomain*, ICorDebugThread*, ICorDebugFrame*, unsigned int, CorDebugExceptionCallbackType, unsigned int)::ExceptionEvent::Dispatch(ManagedEvent::DispatchArgs)(ExceptionEvent * this, ManagedEvent::DispatchArgs args) Line 1184  
libmscordbi.so!CordbProcess::DispatchRCEvent(CordbProcess * this, CordbProcess * this@entry) Line 4763   
libmscordbi.so!CordbRCEventThread::FlushQueuedEvents(CordbRCEventThread * this, CordbRCEventThread * this@entry, CordbProcess * process, CordbProcess * process@entry) Line 10349
libmscordbi.so!CordbRCEventThread::ThreadProc(CordbRCEventThread * this) Line 10607
libmscordbi.so!CordbRCEventThread::ThreadProc(LPVOID parameter) Line 10673  
libmscordaccore.so!CorUnix::CPalThread::ThreadEntry(void * pvParam) Line 1744  
libc.so.6!start_thread(void * arg) Line 447
libc.so.6!clone3() Line 78

Reproduction Steps

  1. Extract the following project: WebApplication6.zip
  2. Run it on Linux -- Docker, WSL, or natively should all work
  3. After the web server is started, hit the '/weatherforecast/` endpoint

Expected behavior

Debugger process should not crash

Actual behavior

Debugger process crashes

Regression?

Regression from .NET 8

Known Workarounds

None known

Configuration

I have seen this in 9.0.4 Linux x64. I didn't try this in any other configuration.

Other information

No response

Activity

dotnet-policy-service

dotnet-policy-service commented on May 16, 2025

@dotnet-policy-service
Contributor

Tagging subscribers to this area: @tommcdon
See info in area-owners.md if you want to be subscribed.

added this to the 10.0.0 milestone on May 16, 2025
apatozi

apatozi commented on May 16, 2025

@apatozi

Will be following this one for any updates

self-assigned this
on May 16, 2025
removed
untriagedNew issue has not been triaged by the area owner
on May 16, 2025
jkotas

jkotas commented on Jun 14, 2025

@jkotas
Member

Reopening for more complete fix - see discussion in #116617 (comment)

reopened this on Jun 14, 2025
locked and limited conversation to collaborators on Jul 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

    Participants

    @jkotas@gregg-miskelly@tommcdon@apatozi

    Issue actions

      .NET Debugging services crash in ASP.NET project that raises exceptions · Issue #115668 · dotnet/runtime