{"record":{"id":"a0a2673d3b76b184","repo":"dotnet/runtime","slug":"dotnet-dbgenableminidump-is-set-and-the-createdump","errorCode":null,"errorMessage":"DOTNET_DbgEnableMiniDump is set and the createdump binary does not exist: %s\\n","messagePattern":"DOTNET_DbgEnableMiniDump is set and the createdump binary does not exist: (.+?)\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/coreclr/nativeaot/Runtime/unix/PalCreateDump.cpp","lineNumber":273,"sourceCode":"\n        if (bytesRead != 1)\n        {\n            fprintf(stderr, \"Problem reading from createdump child_read_pipe: %s (%d)\\n\", strerror(errno), errno);\n            close(child_write_pipe);\n            exit(-1);\n        }\n\n        // Only dup the child's stderr if there is error buffer\n        if (errorMessageBuffer != nullptr)\n        {\n            dup2(child_write_pipe, STDERR_FILENO);\n        }\n        // Execute the createdump program\n        if (execv(argv[0], (char* const *)argv) == -1)\n        {\n            if (errno == ENOENT)\n            {\n                fprintf(stderr, \"DOTNET_DbgEnableMiniDump is set and the createdump binary does not exist: %s\\n\", argv[0]);\n            }\n            else\n            {\n                fprintf(stderr, \"Problem launching createdump (may not have execute permissions): execv(%s) FAILED %s (%d)\\n\", argv[0], strerror(errno), errno);\n            }\n            exit(-1);\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.","sourceCodeStart":255,"sourceCodeEnd":291,"githubUrl":"https://github.com/dotnet/runtime/blob/290d5ab72cc1102813fbc0406fb186ceadabc340/src/coreclr/nativeaot/Runtime/unix/PalCreateDump.cpp#L255-L291","documentation":"When DOTNET_DbgEnableMiniDump is set, the runtime tries to exec the createdump helper to write a crash dump. If execv fails with ENOENT (PalCreateDump.cpp:271-273), the createdump binary path in argv[0] does not exist on disk, so the child prints this and exits. No dump will be produced on the next crash.","triggerScenarios":"Mini-dump env var enabled on an install whose createdump binary was deleted, renamed, or never deployed; the runtime pointing at a relative path that no longer resolves.","commonSituations":"Trimmed/self-contained publish that excluded createdump; a custom install layout that moved the binary; DOTNET_DbgMiniDumpName pointing at a non-existent helper.","solutions":["Reinstall or re-publish the runtime so the createdump binary is present alongside the host.","Ensure the createdump path is reachable (absolute path, correct arch).","If you do not need dumps, unset DOTNET_DbgEnableMiniDump to silence this.","For self-contained apps, do not trim out the createdump asset."],"exampleFix":"# before: createdump missing from install\nexport DOTNET_DbgEnableMiniDump=1   # ... 'createdump binary does not exist'\n# after: restore the binary or disable the var\nunset DOTNET_DbgEnableMiniDump   # (or copy createdump next to the host)","handlingStrategy":"validation","validationCode":"// Ensure createdump exists before enabling minidumps.\n#include <sys/stat.h>\nstruct stat st;\nconst char* path = getenv(\"DOTNET_DbgMiniDumpName\");\nif (getenv(\"DOTNET_DbgEnableMiniDump\") && (stat(path ? path : DEFAULT_CREATEDUMP_PATH, &st) != 0)) {\n  fprintf(stderr, \"createdump not found at %s; disabling minidump\\n\", path);\n  unsetenv(\"DOTNET_DbgEnableMiniDump\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not trim createdump out of self-contained/published runtimes.","Verify the createdump binary path at deploy time.","Unset DOTNET_DbgEnableMiniDump on slim images that intentionally omit createdump."],"tags":["nativeaot","createdump","minidump","environment","diagnostics"],"analyzedSha":"290d5ab72cc1102813fbc0406fb186ceadabc340","analyzedAt":"2026-08-06T19:57:01.276Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}