dotnet/runtime · critical

Error: Fail to PAL_InitializeDLL\n

Error message

Error: Fail to PAL_InitializeDLL\n

What it means

The SuperPMI shim-simple is the minimal JIT-replay shim that replays a previously captured .mcb/.mcl corpus against a real JIT. On unix, DllMain DLL_PROCESS_ATTACH runs PAL_InitializeDLL and, on non-zero return, prints this message and exit(1). The host process dies at the moment the JIT DLL is loaded.

Source

Thrown at src/coreclr/tools/superpmi/superpmi-shim-simple/superpmi-shim-simple.cpp:80

    {
        g_realJitPath = GetEnvWithDefault("SuperPMIShimPath", g_DefaultRealJitPath.c_str());
    }
}

extern "C"
#ifdef HOST_UNIX
    DLLEXPORT // For Win32 PAL LoadLibrary emulation
#endif
        BOOL
        DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
    switch (ul_reason_for_call)
    {
        case DLL_PROCESS_ATTACH:
#ifdef HOST_UNIX
            if (0 != PAL_InitializeDLL())
            {
                fprintf(stderr, "Error: Fail to PAL_InitializeDLL\n");
                exit(1);
            }
#endif // HOST_UNIX
            break;

        case DLL_PROCESS_DETACH:
        case DLL_THREAD_ATTACH:
        case DLL_THREAD_DETACH:
            break;
    }
    return TRUE;
}

extern "C" DLLEXPORT void jitStartup(ICorJitHost* host)
{
    SetDefaultPaths();
    SetLibName();
    SetDebugDumpVariables();

View on GitHub (pinned to 60108ba66e)

Solutions

  1. Run replay from the build output directory so the shim and its PAL/runtime siblings load together.
  2. Rebuild the simple shim against the runtime you intend to replay against.
  3. Validate locale (/usr/lib/locale) and /proc availability in the host environment.
  4. strace -f the host to find the first PAL syscall that fails during DLL_PROCESS_ATTACH.
Defensive patterns

Strategy: validation

Validate before calling

#!/usr/bin/env bash
set -euo pipefail
DIR="$(dirname "${DOTNET_JITPATH:-superpmi-shim-simple.so}")"
file "$DIR/superpmi-shim-simple.so" | grep -qi "$(uname -m)" || exit 1
ldd "$DIR/superpmi-shim-simple.so" 2>/dev/null | grep -q 'not found' && exit 1

Prevention

When it happens

Trigger: Loading superpmi-shim-simple on unix when PAL setup fails: the shim and its PAL/runtime siblings are not co-located, the shim was built against a different CoreCLR, arch mismatch, or PAL cannot register signals/map its modules.

Common situations: Running replay from a stale artifacts tree after switching branches; pointing SuperPMIShimPath at a directory missing libcoreclrpal; minimal containers that strip locale/proc; mixing x64 and arm64 artifacts.

Related errors


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