{"record":{"id":"34005abeef67c641","repo":"egametang/ET","slug":"too-fig-file","errorCode":null,"errorMessage":"too fig file","messagePattern":"too fig file","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"Packages/cn.etetet.hybridclr/Scripts/Editor/Share/3rds/UnityFS/BundleFileReader.cs","lineNumber":164,"sourceCode":"                        flags = blocksInfoReader.ReadUInt32(),\n                        path = blocksInfoReader.ReadStringToNull(),\n                    };\n                }\n            }\n            if (m_Header.flags.HasFlag(ArchiveFlags.BlockInfoNeedPaddingAtStart))\n            {\n                reader.AlignStream(16);\n            }\n        }\n\n\n        private Stream CreateBlocksStream()\n        {\n            Stream blocksStream;\n            var uncompressedSizeSum = m_BlocksInfo.Sum(x => x.uncompressedSize);\n            if (uncompressedSizeSum >= int.MaxValue)\n            {\n                throw new Exception($\"too fig file\");\n            }\n            else\n            {\n                blocksStream = new MemoryStream((int)uncompressedSizeSum);\n            }\n            return blocksStream;\n        }\n\n        public void ReadFiles(Stream blocksStream)\n        {\n            fileList = new StreamFile[m_DirectoryInfo.Length];\n            for (int i = 0; i < m_DirectoryInfo.Length; i++)\n            {\n                var node = m_DirectoryInfo[i];\n                var file = new StreamFile();\n                fileList[i] = file;\n                file.path = node.path;\n                file.fileName = Path.GetFileName(node.path);","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/egametang/ET/blob/5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f/Packages/cn.etetet.hybridclr/Scripts/Editor/Share/3rds/UnityFS/BundleFileReader.cs#L146-L182","documentation":"CreateBlocksStream (line 164) throws 'too fig file' (typo for 'too big') when the sum of all StorageBlock.uncompressedSize across the bundle reaches or exceeds int.MaxValue (~2 GiB). The reader allocates a single MemoryStream with an int capacity, so it cannot hold more than ~2 GiB of decompressed block data.","triggerScenarios":"Loading a UnityFS asset bundle whose total decompressed block size is >= 2 GiB - a very large bundle, or a bundle whose blocksInfo were parsed from a corrupted header yielding a huge spurious uncompressedSize.","commonSituations":"Shipping a giant monolithic asset bundle, a corrupted blocksInfo array inflating sizes, or an asset collection that grew past the 2 GiB single-stream ceiling.","solutions":["Split the oversized bundle into smaller bundles (< 2 GiB decompressed).","Verify the blocksInfo were parsed correctly (a corrupted header can fabricate huge sizes).","If a legitimately large asset set is needed, package it across multiple bundles.","Long term, switch CreateBlocksStream to a stream that supports >2 GiB (and fix the message typo)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"ulong total = (ulong)m_BlocksInfo.Sum(x => (long)x.uncompressedSize);\nif (total >= int.MaxValue) throw new InvalidDataException($\"bundle decompressed size {total} exceeds 2GiB single-stream limit\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep individual bundles under ~2 GiB decompressed.","Validate parsed blocksInfo sizes before allocating.","Split large asset sets across multiple bundles."],"tags":["unity","assetbundle","io","editor","size-limit"],"backgroundTag":null,"analyzedSha":"5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f","analyzedAt":"2026-08-13T21:10:40.377Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}