{"record":{"id":"56e3d37f6055636e","repo":"nodejs/node","slug":"genccode-error-building-filename-or-entrypoint-n","errorCode":null,"errorMessage":"genccode: error building filename or entrypoint\\n","messagePattern":"genccode: error building filename or entrypoint\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/icu-small/source/tools/toolutil/pkg_genc.cpp","lineNumber":791,"sourceCode":"        /* replace '.' by '_' */\n        outFilenameBuilder.append('_', status);\n        entryNameBuilder.append('_', status);\n        ++inFilename;\n\n        /* copy suffix */\n        outFilenameBuilder.append(inFilename, status);\n        entryNameBuilder.append(inFilename, status);\n\n        if(optFilename != nullptr) {\n            outFilenameBuilder.truncate(saveOutFilenameLength);\n            outFilenameBuilder.append(optFilename, status);\n        }\n        // add \".c\"\n        outFilenameBuilder.append(newSuffix, status);\n    }\n\n    if (status.isFailure()) {\n        fprintf(stderr, \"genccode: error building filename or entrypoint\\n\");\n        exit(status.get());\n    }\n\n    if (outFilenameBuilder.length() >= outFilenameCapacity) {\n        fprintf(stderr, \"genccode: output filename too long\\n\");\n        exit(U_ILLEGAL_ARGUMENT_ERROR);\n    }\n\n    if (entryNameBuilder.length() >= entryNameCapacity) {\n        fprintf(stderr, \"genccode: entry name too long (long filename?)\\n\");\n        exit(U_ILLEGAL_ARGUMENT_ERROR);\n    }\n\n    outFilenameBuilder.extract(outFilename, outFilenameCapacity, status);\n    entryNameBuilder.extract(entryName, entryNameCapacity, status);\n}\n\n#ifdef CAN_GENERATE_OBJECTS","sourceCodeStart":773,"sourceCodeEnd":809,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/toolutil/pkg_genc.cpp#L773-L809","documentation":"Inside getOutFilename, the output filename and entry-point name are assembled with icu::UnicodeString builders carrying a UErrorCode. If status.isFailure() after the appends (e.g. U_BUFFER_OVERFLOW_ERROR from a builder, or an allocation failure), the tool prints this generic message and exits with status.get() (pkg_genc.cpp:790).","triggerScenarios":"Builder append overflows the UnicodeString's internal capacity, or memory allocation inside the builder fails; also possible with malformed/overlong filename bytes fed to append.","commonSituations":"Extremely long input filename combined with a long --filename/--entrypoint override; low-memory build environment; exotic/corrupt filename bytes.","solutions":["Shorten the input basename and any --filename/--entrypoint overrides.","Reduce overall path depth passed to genccode.","Ensure the build host has adequate memory."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# Length-check the inputs that get concatenated by the builders.\ntotal=$(( ${#INBASE} + ${#OPTNAME} + ${#SUFFIX} ))\n[ \"$total\" -lt 256 ] || { echo \"filename/entrypoint inputs too long\"; exit 2; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep --filename/--entrypoint overrides short.","Avoid very long input basenames.","Treat a non-argument exit code from genccode as a config error and fix inputs."],"tags":["icu","build-tool","codegen","filesystem"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}