You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Files larger than 128 GiB cannot be unpacked into an ext4 image #921
MaxBlocksPerExtent is 0x8000, so one extent covers 32768 × 4 KiB = 128 MiB.
writeExtents supports an inline root of 4 extents, or one extent-tree level with 4 index entries.
Each leaf block holds 340 extents, so the maximum is 4 × 340 = 1360 extents.
1360 extents × 128 MiB is about 170 GiB, and MaxFileSize is set lower, at 128 GiB.
A proper fix would be adding a depth-2 extent tree to writeExtents or we could uplift the current limit from 128.Gib upto max 170 Gib. Let me know how I should proceed with it
Activity
siddh34 commentedon Oct 12, 2026
Hi @dkovba I'm investigating this I post my investigation here before actually starting a pull request for this issue
could you please assign this issue to me?
siddh34 commentedon Oct 19, 2026
@dkovba I investigated the issue
Container flow
https://github.com/apple/container/blob/31e3a98e471e7626ec646618a149cb82bd0d7634/Sources/ContainerCommands/Image/ImageLoad.swift#L109 calls image.unpack(platform: nil, ...) after the load finishes.
https://github.com/apple/container/blob/31e3a98e471e7626ec646618a149cb82bd0d7634/Sources/Services/ContainerAPIService/Client/ClientImage.swift#L419 sends this over XPC
https://github.com/apple/container/blob/31e3a98e471e7626ec646618a149cb82bd0d7634/Sources/Services/ContainerImagesService/Server/ImagesService.swift#L359 calls snapshotStore.unpack(...)
https://github.com/apple/container/blob/31e3a98e471e7626ec646618a149cb82bd0d7634/Sources/Services/ContainerImagesService/Server/SnapshotStore.swift#L49 picks the unpacker. For Linux images it builds an EXT4Unpacker with a capacity of 512 GiB, or 512 MiB for the init image
https://github.com/apple/container/blob/31e3a98e471e7626ec646618a149cb82bd0d7634/Sources/Services/ContainerImagesService/Server/SnapshotStore.swift#L125 calls unpacker.unpack(image, for: platform, ...)
Containerization flow
containerization/Sources/Containerization/Image/Unpacker/EXT4Unpacker.swift
Line 91 in 6adea56
containerization/Sources/ContainerizationEXT4/Formatter+Unpack.swift
Line 59 in 6adea56
If we read unpackEntries it calls create of EXT4Formatter
containerization/Sources/ContainerizationEXT4/Formatter+Unpack.swift
Line 152 in 6adea56
containerization/Sources/ContainerizationEXT4/Formatter+Unpack.swift
Line 139 in 6adea56
containerization/Sources/ContainerizationEXT4/Formatter+Unpack.swift
Line 134 in 6adea56
Create has limit of 128Gib see:
containerization/Sources/ContainerizationEXT4/EXT4+Formatter.swift
Line 597 in 6adea56
Even if we uplift the max file size error limit from 128Gib it could only go upto 170Gib
The real limit lies in writeExtends see:
containerization/Sources/ContainerizationEXT4/EXT4+Formatter.swift
Line 1229 in 6adea56
writes extents in writeExtents. With 4 KiB blocks
A proper fix would be adding a depth-2 extent tree to writeExtents or we could uplift the current limit from 128.Gib upto max 170 Gib. Let me know how I should proceed with it