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

  1. Inspect the message text (%s) to see which assertion failed.
  2. Run the self-test under a debugger (`corerun -d -st`) to locate the failing macro.
  3. 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

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


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)