Skip to content

ISOSDacInterface::GetMethodDescName use proper path separator in cross-dac scenarios #116981

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

Merged
merged 1 commit into from
Jun 25, 2025

Conversation

max-charlamb
Copy link
Contributor

Found this bug while verifying the cDAC on ARM.

The existing DIRECTORY_SEPARATOR_CHAR_W defined in the PAL depends on the HOST_* not the TARGET_*. In this case, the path stored on the module is a unix style path and the directory structure isn't stripped correctly.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue in ISOSDacInterface::GetMethodDescName where the wrong directory separator was used for cross-DAC scenarios, causing Unix-style paths to be parsed incorrectly on non-Unix hosts.

  • Introduce a directorySeparatorChar based on the target platform instead of using the host’s DIRECTORY_SEPARATOR_CHAR_W.
  • Replace direct comparison against DIRECTORY_SEPARATOR_CHAR_W with the new directorySeparatorChar variable.
Comments suppressed due to low confidence (1)

src/coreclr/debug/daccess/request.cpp:1500

  • Consider adding or updating unit tests for cross-DAC path parsing on non-Windows targets to verify that forward-slash separators are handled correctly.
                    while ((pFile >= path) && (*pFile != directorySeparatorChar))

Copy link
Contributor

Tagging subscribers to this area: @steveisok, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

@max-charlamb max-charlamb merged commit aeee892 into dotnet:main Jun 25, 2025
96 checks passed
@max-charlamb max-charlamb deleted the crossdac-path-sep branch June 25, 2025 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants