dotnet/runtime · critical

Error: Fail to PAL_Initialize\n

Error message

Error: Fail to PAL_Initialize\n

What it means

The main superpmi replay/comparison tool calls PAL_Initialize(argc,argv) on unix at the start of main. A non-zero return means the PAL could not be brought up, so the tool prints this and returns SpmiResult::GeneralFailure (-1) without touching any method-context files. It is the top-level fatal for the superpmi CLI.

Source

Thrown at src/coreclr/tools/superpmi/superpmi/superpmi.cpp:236

#include "jitmetadatalist.h"

    fw.Print("\n");
}

// Run superpmi. The return value is as follows:
// 0    : success
// -1   : general fatal error (e.g., failed to initialize, failed to read files)
// -2   : JIT failed to initialize
// 1    : there were compilation failures
// 2    : there were asm diffs
// 3    : there were missing values in method context
int __cdecl main(int argc, char* argv[])
{
#ifdef TARGET_UNIX
    if (0 != PAL_Initialize(argc, argv))
    {
        fprintf(stderr, "Error: Fail to PAL_Initialize\n");
        return (int)SpmiResult::GeneralFailure;
    }
#endif // TARGET_UNIX

    Logger::Initialize();

    SimpleTimer st1;
    SimpleTimer st2;
    SimpleTimer st3;
    SimpleTimer st4;
    st2.Start();
    JitInstance* jit = nullptr;
    JitInstance* jit2 = nullptr;
    MethodStatsEmitter* methodStatsEmitter = nullptr;

#ifdef SuperPMI_ChewMemory
    // Chew up the base 2gb of memory on x86... helpful in finding any places where classhandles etc are de-ref'd
    SYSTEM_INFO sSysInfo;

View on GitHub (pinned to 60108ba66e)

Solutions

  1. Run superpmi from its artifacts/bin/<arch>.<flavor> directory so PAL/runtime files resolve.
  2. Rebuild for the exact target OS/arch and keep the artifacts tree intact.
  3. Install/fix locales and verify /proc is mounted.
  4. strace -f superpmi ... to capture the first failing PAL syscall (usually an open/mmap of a runtime module).
Defensive patterns

Strategy: validation

Validate before calling

#!/usr/bin/env bash
set -euo pipefail
BIN="${1:?superpmi path required}"
ldd "$BIN" 2>/dev/null | grep -q 'not found' && exit 1
file "$BIN" | grep -qi "$(uname -m)" || exit 1
locale -a >/dev/null 2>&1 || echo "warning: locales missing"

Prevention

When it happens

Trigger: Running the superpmi binary on unix where PAL_Initialize fails: PAL/runtime sibling libraries missing next to the binary, arch mismatch, locale/proc issues, or signal registration blocked. Equivalent root cause to the mcs/mcs.cpp variant but in the superpmi orchestrator.

Common situations: Invoking superpmi from outside its artifacts/bin directory; using a binary built for another OS/arch; minimal containers lacking locale or /proc; branch-switched build trees with partial artifacts.

Related errors


AI-assisted analysis of dotnet/runtime@60108ba66e (2026-08-10). Data as JSON: /api/errors/d0ee487151e4381b. Report an issue: GitHub.