{"record":{"id":"5077132d74ade703","repo":"nodejs/node","slug":"udata-openswapperforinputdata-pool-bundle-s-fail","errorCode":null,"errorMessage":"udata_openSwapperForInputData(pool bundle %s) failed: %s","messagePattern":"udata_openSwapperForInputData\\(pool bundle (.+?)\\) failed: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/icu-small/source/tools/genrb/genrb.cpp","lineNumber":403,"sourceCode":"            return U_MEMORY_ALLOCATION_ERROR;\n        }\n\n        UDataSwapper *ds;\n        const DataHeader *header;\n        int32_t bytesRead = T_FileStream_read(poolFile, poolBundle.fBytes, poolFileSize);\n        if (bytesRead != poolFileSize) {\n            fprintf(stderr, \"unable to read the pool bundle file %s\\n\", poolFileName.data());\n            return 1;\n        }\n        /*\n         * Swap the pool bundle so that a single checked-in file can be used.\n         * The swapper functions also test that the data looks like\n         * a well-formed .res file.\n         */\n        ds = udata_openSwapperForInputData(poolBundle.fBytes, bytesRead,\n                                           U_IS_BIG_ENDIAN, U_CHARSET_FAMILY, &status);\n        if (U_FAILURE(status)) {\n            fprintf(stderr, \"udata_openSwapperForInputData(pool bundle %s) failed: %s\\n\",\n                    poolFileName.data(), u_errorName(status));\n            return status;\n        }\n        ures_swap(ds, poolBundle.fBytes, bytesRead, poolBundle.fBytes, &status);\n        udata_closeSwapper(ds);\n        if (U_FAILURE(status)) {\n            fprintf(stderr, \"ures_swap(pool bundle %s) failed: %s\\n\",\n                    poolFileName.data(), u_errorName(status));\n            return status;\n        }\n        header = reinterpret_cast<const DataHeader*>(poolBundle.fBytes);\n        if (header->info.formatVersion[0] < 2) {\n            fprintf(stderr, \"invalid format of pool bundle file %s\\n\", poolFileName.data());\n            return U_INVALID_FORMAT_ERROR;\n        }\n        const int32_t* pRoot = reinterpret_cast<const int32_t*>(\n                reinterpret_cast<const char*>(header) + header->dataHeader.headerSize);\n        poolBundle.fIndexes = pRoot + 1;","sourceCodeStart":385,"sourceCodeEnd":421,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/genrb/genrb.cpp#L385-L421","documentation":"udata_openSwapperForInputData() failed on the pool bundle bytes. The swapper normalizes endianness and charset family so a single checked-in pool.res can be consumed on any platform; failure means the bytes do not look like a valid ICU data file, the magic/header is wrong, or the requested U_IS_BIG_ENDIAN / U_CHARSET_FAMILY combination is unsupported. The actual error code is printed via u_errorName.","triggerScenarios":"Feeding a non-.res file as pool.res; a pool.res built by an incompatible ICU version whose data header the swapper rejects; bit-rot or truncation that breaks the header.","commonSituations":"Cross-building ICU data on one endianness/charset and consuming on another with an incompatible pool.res; reusing a pool.res from a different ICU major version.","solutions":["Regenerate pool.res using the same ICU version (and same endianness/charset target) as the consuming genrb.","Inspect the printed u_errorName (e.g. U_INVALID_FORMAT_ERROR) to confirm the file is malformed.","Do not mix pool.res files across ICU major versions."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# Validate pool.res is a real ICU data file before using it\nif command -v icupkg >/dev/null 2>&1; then\n  icupkg -l \"$POOL_DIR/pool.res\" >/dev/null || { echo \"pool.res is not a valid ICU data file\" >&2; exit 2; }\nfi","typeGuard":null,"tryCatchPattern":"genrb --usePoolBundle \"$POOL_DIR\" \"$@\" 2>err.log || {\n  grep -q 'udata_openSwapperForInputData' err.log && \\\n    echo \"pool.res rejected by swapper; regenerate with matching ICU version/endian\" >&2\n  exit 1\n}","preventionTips":["Never reuse pool.res across ICU major versions.","When cross-compiling, generate pool.res for the target endianness/charset."],"tags":["icu","genrb","pool-bundle","data-swap","invalid-format"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}