{"record":{"id":"a3f4e9c951b7f2c5","repo":"nodejs/node","slug":"u-unsupported-error-a3f4e9","errorCode":"U_UNSUPPORTED_ERROR","errorMessage":"genccode: match-arch file %s is too short\\n","messagePattern":"genccode: match-arch file (.+?) is too short\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/icu-small/source/tools/toolutil/pkg_genc.cpp","lineNumber":911,"sourceCode":"#   else\n#      error \"Unknown platform for CAN_GENERATE_OBJECTS.\"\n#   endif\n#else\n#   error \"Unknown platform for CAN_GENERATE_OBJECTS.\"\n#endif\n        return;\n    }\n\n    in=T_FileStream_open(filename, \"rb\");\n    if(in==nullptr) {\n        fprintf(stderr, \"genccode: unable to open match-arch file %s\\n\", filename);\n        exit(U_FILE_ACCESS_ERROR);\n    }\n    length=T_FileStream_read(in, buffer.bytes, sizeof(buffer.bytes));\n\n#ifdef U_ELF\n    if (length < static_cast<int32_t>(sizeof(Elf32_Ehdr))) {\n        fprintf(stderr, \"genccode: match-arch file %s is too short\\n\", filename);\n        exit(U_UNSUPPORTED_ERROR);\n    }\n    if(\n        buffer.header32.e_ident[0]!=ELFMAG0 ||\n        buffer.header32.e_ident[1]!=ELFMAG1 ||\n        buffer.header32.e_ident[2]!=ELFMAG2 ||\n        buffer.header32.e_ident[3]!=ELFMAG3 ||\n        buffer.header32.e_ident[EI_CLASS]<ELFCLASS32 || buffer.header32.e_ident[EI_CLASS]>ELFCLASS64\n    ) {\n        fprintf(stderr, \"genccode: match-arch file %s is not an ELF object file, or not supported\\n\", filename);\n        exit(U_UNSUPPORTED_ERROR);\n    }\n\n    *pBits= buffer.header32.e_ident[EI_CLASS]==ELFCLASS32 ? 32 : 64; /* only 32 or 64: see check above */\n#ifdef U_ELF64\n    if(*pBits!=32 && *pBits!=64) {\n        fprintf(stderr, \"genccode: currently only supports 32-bit and 64-bit ELF format\\n\");\n        exit(U_UNSUPPORTED_ERROR);","sourceCodeStart":893,"sourceCodeEnd":929,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/toolutil/pkg_genc.cpp#L893-L929","documentation":"On ELF platforms, after reading the match-arch file genccode requires at least sizeof(Elf32_Ehdr) bytes. If fewer were read the file is too short to be a valid ELF header and it exits U_UNSUPPORTED_ERROR (pkg_genc.cpp:911).","triggerScenarios":"The --match-arch file is empty, truncated, or not an ELF object (e.g. a text file) so its size is below the ELF header minimum.","commonSituations":"Pointing --match-arch at a partially-written or zero-byte object; a stale/aborted compile artifact; the wrong file passed by mistake.","solutions":["Regenerate the reference object so it is a complete ELF .o.","Confirm the file size is at least sizeof(Elf32_Ehdr) (52 bytes).","Recheck that the path actually points to a compiled object, not a source/intermediate file."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# ELF match-arch must be at least Elf32_Ehdr (52 bytes).\n[ -r \"$MATCHARCH\" ] || exit 2\nsz=$(stat -c %s \"$MATCHARCH\" 2>/dev/null || stat -f %z \"$MATCHARCH\")\n[ \"${sz:-0}\" -ge 52 ] || { echo \"match-arch too short to be ELF\"; exit 2; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use a freshly compiled, complete ELF .o as the reference.","Check file size before passing it to --match-arch.","Don't reuse stale/aborted compile artifacts."],"tags":["icu","build-tool","elf","cross-compile"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}