Closed Bug 1797834 Opened 2 years ago Closed 2 years ago

FileSystemSyncAccessHandle::Read/Write don't function correctly with buffers over 2GB

Categories

(Core :: DOM: File, defect)

defect

Tracking

()

RESOLVED INVALID

People

(Reporter: peterv, Unassigned)

Details

While reading or writing to/from an arraybuffer we call PR_Read/PR_Write with chunks of 2GB max, but we're not incrementing the data pointer into the arraybuffer, so we're always reading or writing the same chunk:

https://searchfox.org/mozilla-central/rev/85cbcecd24554c1fa88360412452ad0f7ed48630/dom/fs/api/FileSystemSyncAccessHandle.cpp#177,239

Randell mentioned it would be nice to have a test for this, but we think it might be hard to make it function reliably.

Can't we just create an in-memory buffer > 2GB and initialize the first 2 GB with a certain value (say 1) and the remaining bytes with another value (say 2), write it out to disk and read it again ? Then we could just compare a few bytes to check if we have the expected result.

I believe this is fixed in bug 1790960.

The changes in bug 1790960 are so substantial that I'll mark this as invalid now, not a duplicate.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.