{"record":{"id":"7b0a99c1ee3c43b1","repo":"dotnet/runtime","slug":"problem-launching-createdump-may-not-have-execute-7b0a99","errorCode":null,"errorMessage":"Problem launching createdump (may not have execute permissions): execve(%s) FAILED %s (%d)\\n","messagePattern":"Problem launching createdump \\(may not have execute permissions\\): execve\\((.+?)\\) FAILED (.+?) \\((.+?)\\)\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/coreclr/pal/src/thread/process.cpp","lineNumber":1560,"sourceCode":"            // Call the statically linked createdump code\n            int argc = 0;\n            while (argv[argc] != nullptr && argc < MAX_ARGV_ENTRIES)\n            {\n                argc++;\n            }\n            callbackResult = g_createdumpCallback(argc, argv);\n            // Set the shutdown callback to nullptr and exit\n            // If we don't exit, the child's execution will continue into the diagnostic server behavior\n            // which causes all sorts of problems.\n            g_shutdownCallback = nullptr;\n            exit(callbackResult);\n        }\n        else\n        {\n            // Execute the createdump program\n            if (execve(argv[0], (char**)argv, palEnvironment) == -1)\n            {\n                fprintf(stderr, \"Problem launching createdump (may not have execute permissions): execve(%s) FAILED %s (%d)\\n\", argv[0], strerror(errno), errno);\n                exit(-1);\n            }\n        }\n    }\n    else\n    {\n        close(child_read_pipe);\n        close(child_write_pipe);\n#if HAVE_PRCTL_H && HAVE_PR_SET_PTRACER\n        // Gives the child process permission to use /proc/<pid>/mem and ptrace\n        if (prctl(PR_SET_PTRACER, childpid, 0, 0, 0) == -1)\n        {\n            // Ignore any error because on some CentOS and OpenSUSE distros, it isn't\n            // supported but createdump works just fine.\n            ERROR(\"PROCCreateCrashDump: prctl() FAILED %s (%d)\\n\", strerror(errno), errno);\n        }\n#endif // HAVE_PRCTL_H && HAVE_PR_SET_PTRACER\n        // Signal child that prctl(PR_SET_PTRACER, childpid) is done","sourceCodeStart":1542,"sourceCodeEnd":1578,"githubUrl":"https://github.com/dotnet/runtime/blob/290d5ab72cc1102813fbc0406fb186ceadabc340/src/coreclr/pal/src/thread/process.cpp#L1542-L1578","documentation":"Emitted by the forked child in PROCLaunchCreateDump (process.cpp:1560). This is the `else` branch taken only when g_createdumpCallback is nullptr (i.e. the runtime was NOT built to use a statically-linked createdump), so the child must execve(argv[0], argv, palEnvironment) an external createdump binary. Unlike the NativeAOT sibling (error 240), the PAL does NOT special-case ENOENT, so a missing binary, a non-executable binary, a noexec mount, a wrong-architecture binary, or arg-list overflow ALL surface through this single message. On failure the child exit(-1).","triggerScenarios":"The full CoreCLR runtime (not NativeAOT) is configured to write dumps on crash (DOTNET_DbgEnableMiniDump=1, or a DOTNET_DbgMiniDumpType, or invoked by the diagnostics server), g_createdumpCallback is unset, and the child's execve of the createdump path fails. The path comes from the runtime layout next to libcoreclr.so or from DOTNET_DbgCreateDumpToolPath.","commonSituations":"createdump binary missing from the installed runtime (partial/custom .NET install, docker image that stripped createdump, single-file app where createdump is not extracted); createdump present but without +x or on a noexec mount; wrong-arch createdump after a multiarch copy; SELinux/AppArmor denying execve; E2BIG from an extremely long dump name/path; binfmt misconfiguration returning ENOEXEC.","solutions":["Locate createdump for your runtime: `find / -name createdump 2>/dev/null` and verify it is in the same directory as libcoreclr.so; reinstall/restore the runtime package if absent.","Ensure the executable bit: `chmod +x <dir>/createdump` and that the owning user can traverse and execute it.","Confirm the binary matches the process architecture (file <dir>/createdump) — a wrong ELF class yields ENOEXEC.","Check for noexec on the runtime mount: `mount | grep noexec`; relocate the runtime or remount exec.","If you cannot ship an external createdump, build/use a runtime with the statically-linked createdump callback (g_createdumpCallback) so the forked child calls it in-process instead of execve, or disable minidumps and use the OS core pattern."],"exampleFix":"# before: createdump missing from a stripped base image\n$ DOTNET_DbgEnableMiniDump=1 ./app\n# Problem launching createdump: execve(/usr/share/dotnet/createdump) FAILED No such file (2)\n\n# after: restore createdump from the runtime package\n$ ls /usr/share/dotnet/createdump || cp createdump /usr/share/dotnet/ && chmod +x /usr/share/dotnet/createdump\n$ DOTNET_DbgEnableMiniDump=1 ./app","handlingStrategy":"validation","validationCode":"# Validate the external createdump binary the CoreCLR PAL will execve before enabling minidumps.\nRT=$(dirname \"$(readlink -f \"$(command -v dotnet 2>/dev/null)\")/shared\"); \nBIN=$(find / -name createdump 2>/dev/null | head -n1)\n[ -n \"$BIN\" ] || { echo 'createdump not found; reinstall the runtime package'; exit 1; }\n[ -x \"$BIN\" ] || { chmod +x \"$BIN\" || { echo \"cannot chmod $BIN\"; exit 1; }; }\nfile \"$BIN\" | grep -qi \"$(uname -m)\" || { echo 'createdump wrong arch'; exit 1; }\nexport DOTNET_DbgEnableMiniDump=1\nexec \"$@\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install the .NET runtime from intact packages; do not strip createdump when building minimal container images.","Pin DOTNET_DbgCreateDumpToolPath to a directory you control and verify `[ -x ]` before launch.","Keep createdump's ELF architecture aligned with the process (`file createdump`).","Avoid noexec mounts for the runtime directory.","If you ship a runtime with the statically-linked createdump callback, prefer it so execve is never needed."],"tags":["dotnet","coreclr","pal","createdump","crash-dump","linux","diagnostics","execve"],"analyzedSha":"290d5ab72cc1102813fbc0406fb186ceadabc340","analyzedAt":"2026-08-06T19:57:01.276Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}