nodejs/node · error

U_FILE_ACCESS_ERROR

U_FILE_ACCESS_ERROR

Error message

genccode: unable to open input file %s

What it means

Thrown by genccode's writeAssemblyCode when T_FileStream_open(filename,"rb") returns nullptr. The input binary file that genccode is supposed to turn into assembly cannot be opened for reading.

Source

Thrown at deps/icu-small/source/tools/toolutil/pkg_genc.cpp:337

writeAssemblyCode(
        const char *filename,
        const char *destdir,
        const char *optEntryPoint,
        const char *optFilename,
        char *outFilePath,
        size_t outFilePathCapacity) {
    uint32_t column = MAX_COLUMN;
    char entry[96];
    union {
        uint32_t uint32s[1024];
        char chars[4096];
    } buffer;
    FileStream *in, *out;
    size_t i, length, count;

    in=T_FileStream_open(filename, "rb");
    if(in==nullptr) {
        fprintf(stderr, "genccode: unable to open input file %s\n", filename);
        exit(U_FILE_ACCESS_ERROR);
    }

    const char* newSuffix = nullptr;

    if (uprv_strcmp(assemblyHeader[assemblyHeaderIndex].name, "masm") == 0) {
        newSuffix = ".masm";
    }
    else if (uprv_strcmp(assemblyHeader[assemblyHeaderIndex].name, "nasm") == 0) {
        newSuffix = ".asm";
    } else {
        newSuffix = ".S";
    }

    getOutFilename(
        filename,
        destdir,
        buffer.chars,

View on GitHub (pinned to 1b2de5e052)

Solutions

  1. Verify the input file exists and is readable: ls -l <path> && test -r <path>.
  2. Run genccode from the correct working directory or pass an absolute path.
  3. Check the make/configure log for where the input was expected to be generated.
  4. Restore the file from a clean checkout if it was accidentally removed.

Example fix

# before
genccode -d out/ relative/path/data.bin  # file not found

# after
genccode -d out/ /abs/path/to/data.bin
Defensive patterns

Strategy: validation

Validate before calling

// Before invoking genccode, confirm the input file is openable for reading.
#include <cstdio>
#include <cstring>
#include <cerrno>
bool inputReadable(const char* path) {
    FILE* f = std::fopen(path, "rb");
    if (!f) { std::fprintf(stderr, "cannot read %s: %s\n", path, std::strerror(errno)); return false; }
    std::fclose(f);
    return true;
}

Prevention

When it happens

Trigger: At the top of writeAssemblyCode (pkg_genc.cpp:337), in=T_FileStream_open(filename,"rb"); nullptr triggers the message and exit(U_FILE_ACCESS_ERROR).

Common situations: Wrong working directory when invoking genccode; misspelled input path; input file deleted between configure and make; permission denied; NFS hiccup; the path points to a directory instead of a file.

Related errors


AI-assisted analysis of nodejs/node@1b2de5e052 (2026-08-13). Data as JSON: /api/errors/33b49ec355e832dc. Report an issue: GitHub.