Skip to content

Windows: File Attributes / Resource Values crashes on files > 2GB #5258

@gregcotten

Description

@gregcotten

Stubbing this for now, but will try to make an easy repro project soon.

Windows Swift 6.1.2 release, x64

As described in title, using FileManager or URL to get or set "resource values" like modification date, creation date, file size, or even "is directory" on a file larger than 2GB will cause a crash. Anything 2GB or less works without issue.

Here's an example where I simply want to enumerate a directory, pre-caching the property "isDirectory"

enumerator(at: directoryURL, includingPropertiesForKeys: [.isDirectoryKey], options: [])

If a file in that directory is > 2GB, instant crash with:

0x0000009e1511b3, Main.dll!
0x00000073753dc6, ntdll.dll!RtlWow64GetCurrentCpuArea
0x00000073754326, ntdll.dll!RtlWow64GetCurrentCpuArea
0x0000007384692e, ntdll.dll!KiUserExceptionDispatcher
0x00000086e38f64, Foundation.dll!type metadata accessor for (extension in Foundation):FoundationEssentials.FileManager.DirectoryEnumerator
0x00000086e33f36, Foundation.dll!(extension in Foundation):FoundationEssentials.FileManager.getRelationship(_: Swift.UnsafeMutablePointer<FoundationEssentials.FileManager.URLRelationship>, of: FoundationEssentials.FileManager.SearchPathDirectory, in: FoundationEssentials.FileManager.SearchPathDomainMask, toItemAt: FoundationEssentials.URL) throws -> ()
0x00000086f354ed, Foundation.dll!Foundation.NSURL.resolvingSymlinksInPath.getter : Swift.Optional<FoundationEssentials.URL>
0x00000086f36e80, Foundation.dll!type metadata accessor for Foundation.NSURL
0x00000086f327b2, Foundation.dll!Foundation.NSURL.__allocating_init() -> Foundation.NSURL
0x00000086f31e27, Foundation.dll!Foundation.NSURL.resourceValues(forKeys: Swift.Array<Foundation.URLResourceKey>) throws -> Swift.Dictionary<Foundation.URLResourceKey, Any>
0x00000086fa5108, Foundation.dll!(extension in Foundation):FoundationEssentials.URL.resourceValues(forKeys: Swift.Set<Foundation.URLResourceKey>) throws -> Foundation.URLResourceValues
0x0000009e2838f6, Main.dll!(extension in Foundation):FoundationEssentials.URL.resourceValues(forKeys: Swift.Set<Foundation.URLResourceKey>) throws -> Foundation.URLResourceValues
0x0000009e28365c, Main.dll!(extension in Foundation):FoundationEssentials.URL.resourceValues(forKeys: Swift.Set<Foundation.URLResourceKey>) throws -> Foundation.URLResourceValues
0x0000009e283335, Main.dll!(extension in Foundation):FoundationEssentials.URL.resourceValues(forKeys: Swift.Set<Foundation.URLResourceKey>) throws -> Foundation.URLResourceValues

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions