Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Fix dotnet-dump/createdump launch failure (#25562)
Browse files Browse the repository at this point in the history
On CentOS or OpenSUSE dotnet-dump collect fails but a
valid coredump is generated. The "prctl()" call is failing
that gives the child createdump process permission to ptrace
to the runtime process. On CentOS/OpenSUSE the PR_SET_PTRACER
option isn't supported and not needed.

Issue: dotnet/diagnostics#334
  • Loading branch information
mikem8361 authored and jkotas committed Jul 4, 2019
1 parent a985dda commit 036e426
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pal/src/thread/process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3337,8 +3337,9 @@ PROCCreateCrashDump(char** argv)
// Gives the child process permission to use /proc/<pid>/mem and ptrace
if (prctl(PR_SET_PTRACER, childpid, 0, 0, 0) == -1)
{
// Ignore any error because on some CentOS and OpenSUSE distros, it isn't
// supported but createdump works just fine.
ERROR("PPROCCreateCrashDump: prctl() FAILED %d (%s)\n", errno, strerror(errno));
return false;
}
// Parent waits until the child process is done
int wstatus = 0;
Expand Down

0 comments on commit 036e426

Please sign in to comment.