Skip to content

Mac process throws NSUncaughtSystemExceptionException with debugger attached #123799

@idigra

Description

@idigra

Description

In a specific machine, when I try to attach debugger, the attached Mac process throws an exception and stuck after debugger paused and continued.

I'll be happy to provide the details required to investigate this issue. The issue is a serious blocker for us as it doesn't allow us debugging our developed app in some of our most usable development machines.

Reproduction Steps

Unfortunately I can't provide exact repro steps as I'm failing to understand what is special in that machine setup.

In case it helps, it's a sandboxed native process that hosts the .NET CLR and loads managed binaries we build. Followed is the output -f uname -a in case that helps:
Darwin <Scrubbed machine name>.local 25.2.0 Darwin Kernel Version 25.2.0: Tue Nov 18 21:09:56 PST 2025; root:xnu-12377.61.12~1/RELEASE_ARM64_T6041 arm64
The dylibs are thin binaries that are matching the architecture of the machine (arm64), and I tried to delete ~/.vs-debugger before reattaching.

The steps I'm doing:

  • Start the native process.
  • load the CLR with managed dlls.
  • Attach a remote VS debugger from win machine.
  • Wait for debugger to be loaded.
  • Pause the app. Everything seems fine, symbols loaded, etc.
  • Resume the app to observe the failure.
  • Usually it exception throws here, but rarely sometimes another step should be done in the debugged app to repro the exception.

Expected behavior

Process should keep functioning and debugging should remain effective.

Actual behavior

Process shows the below message in terminal and gets stuck (only "Force quit" is possible).

*** Terminating app due to uncaught exception 'NSUncaughtSystemExceptionException', reason: 'Uncaught system exception: signal 5'
*** First throw call stack:
(
	0   CoreFoundation                      0x00000001a00cd8ec __exceptionPreprocess + 176
	1   libobjc.A.dylib                     0x000000019fba6418 objc_exception_throw + 88
	2   CoreFoundation                      0x00000001a00e8ec4 _CFBundleGetValueForInfoKey + 0
	3   ExceptionHandling                   0x00000001c973cfcc NSExceptionHandlerUncaughtSignalHandler + 44
	4   libsystem_platform.dylib            0x000000019ffeb744 _sigtramp + 56
	5   libcoreclr.dylib                    0x00000003dc404c04 CallDescrWorkerInternal + 132
	6   libcoreclr.dylib                    0x00000003dc282988 _Z18DispatchCallSimplePmjyj + 268
	7   libcoreclr.dylib                    0x00000003dc294c6c _ZN12ThreadNative20KickOffThread_WorkerEPv + 148
	8   libcoreclr.dylib                    0x00000003dc255fa8 _ZL31ManagedThreadBase_DispatchOuterP22ManagedThreadCallState + 248
	9   libcoreclr.dylib                    0x00000003dc25645c _ZN17ManagedThreadBase7KickOffEPFvPvES0_ + 32
	10  libcoreclr.dylib                    0x00000003dc294d44 _ZN12ThreadNative13KickOffThreadEPv + 172
	11  libcoreclr.dylib                    0x00000003dc1720fc _ZN7CorUnix10CPalThread11ThreadEntryEPv + 364
	12  libclang_rt.asan_osx_dynamic.dylib  0x000000015e9123f8 _ZL17asan_thread_startPv + 80
	13  libsystem_pthread.dylib             0x000000019ffe1c08 _pthread_start + 136
	14  libsystem_pthread.dylib             0x000000019ffdcba8 thread_start + 8
)

Regression?

I don't have enough info to determine if it's a regression.

Known Workarounds

No response

Configuration

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions