Closed Bug 1723082 Opened 4 years ago Closed 3 years ago

IOUtils.read throws Uncaught DOMException error for large file

Categories

(Toolkit Graveyard :: OS.File, defect, P3)

Tracking

(firefox96 fixed)

RESOLVED FIXED
96 Branch
Tracking Status
firefox96 --- fixed

People

(Reporter: rnons, Assigned: beth)

References

Details

Attachments

(1 file)

Test code

await IOUtils.read('a_3.9GB_file')

Error

Uncaught (in promise) DOMException: Encountered an unexpected error while reading file(...path...)

It's better to document the max file size supported, and throw a more specific error like NS_ERROR_FILE_TOO_BIG.

Assignee: nobody → brennie
Severity: -- → S3
Priority: -- → P3

Previously, if you attempted to read a file greater than INT32_MAX in size, we
would either fail to read the file (on release) or crash (on debug). This is
due to the implementation of _PR_MD_READ accepting an int32_t of bytes to read
instead of a uint32_t, which nsFileStream::Read accepts and passes on.

Depends on D131160

Pushed by brennie@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/492f5ca3b592 Support reading files > INT32_MAX in IOUtils r=Gijs
Pushed by brennie@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/688444ccc86a Support reading files > INT32_MAX in IOUtils r=Gijs
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 96 Branch
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: