{"record":{"id":"566ae40a6bfbead2","repo":"dotnet/runtime","slug":"fail-s","errorCode":null,"errorMessage":"Fail: %s\n","messagePattern":"Fail: %s\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/coreclr/hosts/corerun/corerun.cpp","lineNumber":985,"sourceCode":"            pal::ensure_trailing_delimiter(path);\n            THROW_IF_FALSE(path.back() == pal::dir_delim || path.length() == 1);\n            path = W(\"/\");\n            pal::ensure_trailing_delimiter(path);\n            THROW_IF_FALSE(path.back() == pal::dir_delim || path.length() == 1);\n        }\n        {\n            THROW_IF_FALSE(!pal::string_ends_with(W(\"\"), W(\".cd\")));\n            THROW_IF_FALSE(pal::string_ends_with(W(\"ab.cd\"), W(\".cd\")));\n            THROW_IF_FALSE(!pal::string_ends_with(W(\"ab.cd\"), W(\".cde\")));\n            THROW_IF_FALSE(!pal::string_ends_with(W(\"ab.cd\"), W(\"ab.cde\")));\n        }\n        {\n            dotenv::self_test();\n        }\n    }\n    catch (const char_t msg[])\n    {\n        pal::fprintf(stderr, W(\"Fail: %s\\n\"), msg);\n        return EXIT_FAILURE;\n    }\n\n    pal::fprintf(stdout, W(\"Self-test passed.\\n\"));\n    return EXIT_SUCCESS;\n}\n","sourceCodeStart":967,"sourceCodeEnd":992,"githubUrl":"https://github.com/dotnet/runtime/blob/60108ba66eb7d1d12f595480091b4ad80a24b172/src/coreclr/hosts/corerun/corerun.cpp#L967-L992","documentation":"Printed at src/coreclr/hosts/corerun/corerun.cpp:985 inside the self_test() function when any THROW_IF_FALSE/THROW_IF_TRUE macro throws a literal string. It signals that corerun's built-in self-test (argument parsing, path helpers, dotenv) detected a regression.","triggerScenarios":"Triggered only when corerun is launched with `-st` (self-test mode) and one of the assertions in self_test() fails. The thrown string is the failing condition text from the THROW_IF_* macro.","commonSituations":"Developers running `corerun -st` after building to verify the host; a failure means a recent change broke argument parsing, path handling, or dotenv loading.","solutions":["Inspect the message text (%s) to see which assertion failed.","Run the self-test under a debugger (`corerun -d -st`) to locate the failing macro.","Revert recent changes to parse_args / pal helpers / dotenv and retest."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Self-test is invoked by humans; no caller API. Before committing host changes, run:\n//   corerun -st\n// and assert the process exits 0.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run `corerun -st` after every host change.","Read the thrown assertion string to find the failing check.","Add THROW_IF_* macros for new parse_args branches."],"tags":["coreclr","corerun","self-test","diagnostics"],"backgroundTag":null,"analyzedSha":"60108ba66eb7d1d12f595480091b4ad80a24b172","analyzedAt":"2026-08-10T18:54:11.478Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}