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

Improve the dotnet-dump error message: Core dump generation FAILED 0x80004005 #54521

Closed
mikem8361 opened this issue Jan 8, 2020 · 8 comments
Closed
Assignees
Milestone

Comments

@mikem8361
Copy link
Member

The failures from createdump are pretty much pass/fail so the error code in the message doesn't give any useful information.

The simplest solution (and it is still some work) is to stream over the diagnostics output sent to stderr in the createdump process to the dotnet-dump process.

@mikem8361 mikem8361 self-assigned this Jan 8, 2020
@andreesteve
Copy link

@mikem8361 - not sure if related with this issue or not, but it seems that whenever I get 0x80004005 because of missing execute permissions for 'createdump', it also creates a fork of the original process that is being dumped, and the forks are not killed after the dump fails.

@mikem8361
Copy link
Member Author

Basically 0x80004005 (E_FAIL) is returned to dotnet-dump by the runtime for every error which I hope to improve when I get to this issue but it will take runtime work/coordination.

If the runtime or SDK is installed with our installers or even from a downloaded zip, createdump should have the execute permission. What is the exact install scenario are you using to end up without execute perms?

And yes, it does look like we don't clean up the fork with the execve. Could you create an issue in the runtime repo? Thanks.

@andreesteve
Copy link

I wanted to analyze the memory consumption of a large powershell script, this meant dumping the pwsh process that was running the script. Pwsh is installed through my distro's package manager and it came without execute permissions on powershell's createdump binary.

I wonder if it the pwsh package for my distro should have been shipped with exec permissions on createdump.

Is createdump specific per binary? i.e. should each donet core binary ship with its own?

I can see pwsh seems to be installed with its own:

[andre@scout ~]$ ll /opt/microsoft/powershell/7/createdump 
-rwxr-xr-x 1 root root 109656 Oct  2 19:44 /opt/microsoft/powershell/7/createdump

and the dotnet runtime with its own as well:

[andre@scout ~]$ find /usr/share/dotnet | grep createdump
/usr/share/dotnet/shared/Microsoft.NETCore.App/2.1.15/createdump
/usr/share/dotnet/shared/Microsoft.NETCore.App/2.2.7/createdump
/usr/share/dotnet/shared/Microsoft.NETCore.App/3.1.8/createdump

It worked for me after I gave execute permissions to the pwsh's createdump binary. I wonder if the right approach is to just give the dotnet one the execute permissions instead. Do you have a recommendation? Thank you.

@mikem8361
Copy link
Member Author

It looks like pwsh is a self-contained .NET app which includes all the runtime binaries (including createdump). It looks like in this self-contained app case, createdump doesn't get execute perms when the app is expanded/installed. That looks like an issue in the self-contained app support.

I assume the ones installed under /usr/share/dotnet had execute permission.

@tommcdon tommcdon transferred this issue from dotnet/diagnostics Jun 21, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added area-Diagnostics-coreclr untriaged New issue has not been triaged by the area owner labels Jun 21, 2021
@ghost
Copy link

ghost commented Jun 21, 2021

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

Issue Details

The failures from createdump are pretty much pass/fail so the error code in the message doesn't give any useful information.

The simplest solution (and it is still some work) is to stream over the diagnostics output sent to stderr in the createdump process to the dotnet-dump process.

Author: mikem8361
Assignees: mikem8361
Labels:

area-Diagnostics-coreclr, untriaged

Milestone: -

@tommcdon tommcdon removed the untriaged New issue has not been triaged by the area owner label Jun 21, 2021
@tommcdon tommcdon added this to the 7.0.0 milestone Jun 21, 2021
@tommcdon tommcdon added the enhancement Product code improvement that does NOT require public API changes/additions label Jun 21, 2021
@mikem8361
Copy link
Member Author

Related issue: #64069

@mikem8361
Copy link
Member Author

We should also fix the error when dotnet-dump collect on a single-file app:

WriteDump failed - HRESULT: 0x00000000

@mikem8361
Copy link
Member Author

On MacOS, improve this error message:

[createdump] task_for_pid(2485) FAILED 5 (os/kern) failure

@mikem8361 mikem8361 removed the enhancement Product code improvement that does NOT require public API changes/additions label May 21, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jun 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants