From: Mike McLaughlin Date: Thu, 4 Jul 2019 14:07:51 +0000 (-0700) Subject: Fix dotnet-dump/createdump launch failure (#25562) X-Git-Tag: accepted/tizen/unified/20191011.080124~150^2~63 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=036e426e7fffa6b10c2347c61a030d3ed8eb428e;p=platform%2Fupstream%2Fcoreclr.git Fix dotnet-dump/createdump launch failure (#25562) 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: https://github.com/dotnet/diagnostics/issues/334 --- diff --git a/src/pal/src/thread/process.cpp b/src/pal/src/thread/process.cpp index 428cc2a..1ce2cda 100644 --- a/src/pal/src/thread/process.cpp +++ b/src/pal/src/thread/process.cpp @@ -3337,8 +3337,9 @@ PROCCreateCrashDump(char** argv) // Gives the child process permission to use /proc//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;