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

Get modules information using proc_pidinfo() on macOS #42900

Merged
merged 1 commit into from
Oct 12, 2020

Conversation

k15tfu
Copy link
Contributor

@k15tfu k15tfu commented Sep 30, 2020

Previously CreateProcessModules() parsed the output of vmmap command to get
modules addresses/paths on macOS, but on some Macs with latest macOS 10.15.6
vmmap hides full paths to some process modules (.dylibs in non-system folders),
replacing some parts with *:

__TEXT                 000000010d8bd000-000000010ddce000 [ 5188K  5188K     0K     0K] r-x/rwx SM=COW          /Users/USER/*/libcoreclr.dylib

In particular, it breaks the debugger functionality due to invalid path
/Users/USER/*/libmscordbi.dylib, and error code
CORDBG_E_DEBUG_COMPONENT_MISSING is returned.

Now we get modules information by iterating over regions using proc_pidinfo()
in CreateProcessModules().

Fixes #42888

@ghost
Copy link

ghost commented Sep 30, 2020

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

@mikem8361 mikem8361 added this to the 6.0.0 milestone Sep 30, 2020
@mikem8361
Copy link
Member

The changes look good. I'm sure the changes will fix your issues, but I don't know enough about proc_pidinfo yet to know if it will break our existing scenarios (other MacOS versions, devices etc.). I want to wait a little while to approve and merge until 5.0 is finished and out the door.

And maybe our CI tests will get more stable though you will have to rebase on the latest master to get any fixes.

Previously CreateProcessModules() parsed the output of vmmap command to get
modules addresses/paths on macOS, but on some Macs with latest macOS 10.15.6
vmmap hides full paths to some process modules (.dylibs in non-system folders),
replacing some parts with *:
```
__TEXT                 000000010d8bd000-000000010ddce000 [ 5188K  5188K     0K     0K] r-x/rwx SM=COW          /Users/USER/*/libcoreclr.dylib
```

In particular, it breaks the debugger functionality due to invalid path
`/Users/USER/*/libmscordbi.dylib`, and error code
CORDBG_E_DEBUG_COMPONENT_MISSING is returned.

Now we get modules information by iterating over regions using proc_pidinfo()
in CreateProcessModules().

Fixes dotnet#42888
@k15tfu
Copy link
Contributor Author

k15tfu commented Oct 2, 2020

@mikem8361 Hi! Glad to hear this will be included in 5.0 =) I have just rebased against TOT to see if tests pass now.

And would it also be possible to backport this to 3.1?

@mikem8361
Copy link
Member

Actually it won't make it into 5.0. It is too risky change right now (weeks before we release 5.0). We will have to see about 3.1/5.0 service releases.

@k15tfu
Copy link
Contributor Author

k15tfu commented Oct 2, 2020

@mikem8361 Oops, I misread this. 5.0.x still sounds good :)

@mikem8361 mikem8361 merged commit b099ab3 into dotnet:master Oct 12, 2020
@k15tfu k15tfu deleted the fix-issue-42888 branch October 14, 2020 10:12
@k15tfu
Copy link
Contributor Author

k15tfu commented Oct 14, 2020

Hi @mikem8361. Thanks for approving this. So how I can help to get this fixed in 3.1/5.0 service releases?

@dotnet dotnet deleted a comment from k15tfu Oct 14, 2020
@mikem8361
Copy link
Member

mikem8361 commented Oct 14, 2020 via email

@k15tfu
Copy link
Contributor Author

k15tfu commented Nov 12, 2020

@mikem8361 Kindly reminder.

@stevo-knievo
Copy link

+1
for getting this fix in 3.1/5.0 service releases, please.

@mikem8361
Copy link
Member

/backport to release/5.0

@github-actions
Copy link
Contributor

Started backporting to release/5.0: https://github.com/dotnet/runtime/actions/runs/366608110

@ghost ghost locked as resolved and limited conversation to collaborators Dec 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Debugger not working on macOS 10.15.x when vmmap hides full path to process modules
5 participants