dotnet/runtime · error
Fail
Error message
Fail: %s
What it means
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.
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.
Defensive patterns
Strategy: validation
Validate before calling
// Self-test is invoked by humans; no caller API. Before committing host changes, run: // corerun -st // and assert the process exits 0.
Prevention
- 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.
When it happens
Trigger: 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.
Common situations: Developers running `corerun -st` after building to verify the host; a failure means a recent change broke argument parsing, path handling, or dotenv loading.
Related errors
- BEGIN: coreclr_execute_assembly failed - Error: 0x%08x
- BEGIN: coreclr_initialize failed - Error: 0x%08x
- coreclr_shutdown_2 failed - Error: 0x%08x
- END: coreclr_execute_assembly failed - Error: 0x%08x
- END: coreclr_initialize failed - Error: 0x%08x
AI-assisted analysis of dotnet/runtime@60108ba66e (2026-08-10).
Data as JSON: /api/errors/566ae40a6bfbead2.
Report an issue: GitHub.
Appendix: source
Thrown at src/coreclr/hosts/corerun/corerun.cpp:985
pal::ensure_trailing_delimiter(path);
THROW_IF_FALSE(path.back() == pal::dir_delim || path.length() == 1);
path = W("/");
pal::ensure_trailing_delimiter(path);
THROW_IF_FALSE(path.back() == pal::dir_delim || path.length() == 1);
}
{
THROW_IF_FALSE(!pal::string_ends_with(W(""), W(".cd")));
THROW_IF_FALSE(pal::string_ends_with(W("ab.cd"), W(".cd")));
THROW_IF_FALSE(!pal::string_ends_with(W("ab.cd"), W(".cde")));
THROW_IF_FALSE(!pal::string_ends_with(W("ab.cd"), W("ab.cde")));
}
{
dotenv::self_test();
}
}
catch (const char_t msg[])
{
pal::fprintf(stderr, W("Fail: %s\n"), msg);
return EXIT_FAILURE;
}
pal::fprintf(stdout, W("Self-test passed.\n"));
return EXIT_SUCCESS;
}
View on GitHub (pinned to 60108ba66e)