You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Delete and inline more Win32 wrappers from PAL - #137944
Move the IPC transport naming into debug-pal's processdescriptor, the runtime startup handshake into debugger.cpp (its only caller) and the memory probe next to isMemoryReadable in the VM.
Replace GetCurrentProcessId with getpid on Unix, PAL_GetCurrentOSThreadId with minipal_get_current_thread_id and SwitchToThread with minipal_switch_to_thread.
Call dlsym, dlclose and dlerror directly instead of PAL_GetProcAddressDirect, PAL_FreeLibraryDirect and PAL_GetLoadLibraryError, and dladdr instead of PAL_GetSymbolModuleBase. Move PAL_CopyModuleData into stresslog.cpp, its only caller.
Add minipal_flush_instruction_cache and minipal_output_debug_string[_utf16] and use them instead of the PAL's FlushInstructionCache and OutputDebugStringA/W.
Move the remaining SafeCRT functions out of the PAL into coreclr/minipal/Unix/safecrt.cpp, and delete the copies that were dead: the compiled string copy/concat functions (callers use the inline ones from safecrt.h), _wcslwr_s, _wmakepath_s, PAL_wcsnlen and the wide scanf engine.
Use plain libc in the PAL where the SafeCRT checks could not trigger.
Delete unused PAL code: GetModuleFileNameA, the strict SAL headers, imagehlp.h, the unused parts of safecrt.h and a dead QCall entry for OutputDebugStringW.
Delete the corresponding PAL declarations, DAC exports and PAL tests.
- Move the IPC transport naming into debug-pal's processdescriptor, the
runtime startup handshake into debugger.cpp (its only caller) and the
memory probe next to isMemoryReadable in the VM.
- Replace GetCurrentProcessId with getpid on Unix, PAL_GetCurrentOSThreadId
with minipal_get_current_thread_id and SwitchToThread with
minipal_switch_to_thread.
- Call dlsym, dlclose and dlerror directly instead of
PAL_GetProcAddressDirect, PAL_FreeLibraryDirect and
PAL_GetLoadLibraryError, and dladdr instead of PAL_GetSymbolModuleBase.
Move PAL_CopyModuleData into stresslog.cpp, its only caller.
- Add minipal_flush_instruction_cache and minipal_output_debug_string[_utf16]
and use them instead of the PAL's FlushInstructionCache and
OutputDebugStringA/W.
- Move the remaining SafeCRT functions out of the PAL into
coreclr/minipal/Unix/safecrt.cpp, and delete the copies that were dead:
the compiled string copy/concat functions (callers use the inline ones
from safecrt.h), _wcslwr_s, _wmakepath_s, PAL_wcsnlen and the wide scanf
engine.
- Use plain libc in the PAL where the SafeCRT checks could not trigger.
- Delete unused PAL code: GetModuleFileNameA, the strict SAL headers,
imagehlp.h, the unused parts of safecrt.h and a dead QCall entry for
OutputDebugStringW.
- Delete the corresponding PAL declarations, DAC exports and PAL tests.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Azure Pipelines:
Successfully started running 6 pipeline(s).
9 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.
HOST_WASI is not defined in the CoreCLR build, because a WASI host also
takes the Unix branch in configurecompiler.cmake.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Include dlfcn.h under HOST_UNIX: cross-DAC builds compile with
TARGET_UNIX on Windows hosts.
- Drop the in-proc crash report test's check of the PAL process ID,
since the PAL no longer provides GetCurrentProcessId.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The cross-DAC builds compile debugger.cpp on Windows hosts with
TARGET_UNIX; the handshake code is already under !DACCESS_COMPILE.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Always passing nullptr discards the application-group ID, causing sandboxed macOS debuggees and debuggers to use different FIFO locations and preventing attachment.
This PR reduces CoreCLR’s dependency on Win32-style PAL wrappers by moving shared functionality into minipal, placing specialized helpers near their callers, and using native Unix APIs directly.
Changes:
Adds minipal helpers for transport naming, instruction-cache flushing, and debugger output.
Migrates runtime and debugger callers to native APIs and relocates SafeCRT support.
Removes obsolete PAL implementations, declarations, exports, and associated tests.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Read-only probes leave pipe writes undrained, causing valid large debugger reads to fail with ERROR_INVALID_ADDRESS once the pipe fills and trigger an assertion in checked builds.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The changes regress Mono’s temporary-directory selection, potentially preventing diagnostic socket creation, and silently discard debugger message-box output on Unix when a native debugger is attached.
On Unix, DbgPrintf in debug/ee/debuggermessagebox.cpp still selects OutputDebugStringUtf8 whenever a native debugger is attached. Making that sink a no-op silently discards the title and message from MessageBoxImpl rather than using its stdout fallback. Guard DbgPrintf's debugger-output branch with #ifndef HOST_UNIX, leaving the stdout block available unconditionally on Unix.
TMP/TEMP are ignored when selecting Mono's diagnostic socket directory
src/native/eventpipe/ds-ipc-pal-socket.c:722
When Mono runs with TMP or TEMP set and TMPDIR unset, this call moves its default diagnostic socket to /tmp/ instead of the configured directory. Mono's previous hook used g_get_tmp_dir (src/mono/mono/eglib/gmisc-unix.c:113–125), whereas the minipal helper checks only TMPDIR; socket creation can now fail if /tmp/ is unavailable or unwritable. Preserve Mono's temporary-directory selection, either by retaining its runtime hook or by passing the runtime-selected directory into the shared formatter.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.