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
- Verify the input file exists and is readable: ls -l <path> && test -r <path>.
- Run genccode from the correct working directory or pass an absolute path.
- Check the make/configure log for where the input was expected to be generated.
- 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
- Pass absolute input paths to genccode to avoid working-directory issues.
- Add a 'test -r <input>' preflight in the build recipe.
- Ensure prerequisite build steps that generate the input succeeded.
- Keep inputs on local disk during generation.
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
- couldn't open file %s
- Error writing package dat file.
- Unable to remove old dat file: %s
- Error creating symbolic links of the data library file.
- Error creating symbolic links. Failed command: %s\n
AI-assisted analysis of nodejs/node@1b2de5e052 (2026-08-13).
Data as JSON: /api/errors/33b49ec355e832dc.
Report an issue: GitHub.