-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fs.read offset and length can only be up to 0x7FFFFFFF (max int32 instead of uint32) #26563
Labels
buffer
Issues and PRs related to the buffer subsystem.
Comments
4 tasks
zbjornson
added a commit
to zbjornson/node
that referenced
this issue
Mar 18, 2019
Since v10.10.0, 'buf' can be any DataView, meaning the largest byteLength can be Float64Array.BYTES_PER_ELEMENT * kMaxLength = 17,179,869,176. 'offset' can now be up to 2**53 - 1. This makes it possible to tile reads into a large buffer. Ref nodejs#26563
zbjornson
added a commit
to zbjornson/node
that referenced
this issue
Mar 18, 2019
Since v10.10.0, 'buf' can be any DataView, meaning the largest byteLength can be Float64Array.BYTES_PER_ELEMENT * kMaxLength = 17,179,869,176. The underlying libuv functions only work with unsigned int. The underlying Linux and Windows syscalls only support up to ~2 GB and 4 GB, respectively. Ref nodejs#26563
zbjornson
added a commit
to zbjornson/node
that referenced
this issue
Mar 27, 2019
Since v10.10.0, 'buf' can be any DataView, meaning the largest byteLength can be Float64Array.BYTES_PER_ELEMENT * kMaxLength = 17,179,869,176. 'offset' can now be up to 2**53 - 1. This makes it possible to tile reads into a large buffer. This commit preserves the existing behavior as far as coercing values to numbers instead of throwing. Fixes nodejs#26563
zbjornson
added a commit
to zbjornson/node
that referenced
this issue
Mar 27, 2019
zbjornson
added a commit
to zbjornson/node
that referenced
this issue
Mar 28, 2019
Since v10.10.0, 'buf' can be any DataView, meaning the largest byteLength can be Float64Array.BYTES_PER_ELEMENT * kMaxLength = 17,179,869,176. 'offset' can now be up to 2**53 - 1. This makes it possible to tile reads into a large buffer. Breaking: now throws if read offset is not a safe int, is null or is undefined. Fixes nodejs#26563
zbjornson
added a commit
to zbjornson/node
that referenced
this issue
Mar 28, 2019
zbjornson
added a commit
to zbjornson/node
that referenced
this issue
Aug 12, 2019
Since v10.10.0, 'buf' can be any DataView, meaning the largest byteLength can be Float64Array.BYTES_PER_ELEMENT * kMaxLength = 17,179,869,176. 'offset' can now be up to 2**53 - 1. This makes it possible to tile reads into a large buffer. Breaking: now throws if read offset is not a safe int, is null or is undefined. Fixes nodejs#26563
zbjornson
added a commit
to zbjornson/node
that referenced
this issue
Aug 12, 2019
Trott
pushed a commit
that referenced
this issue
Aug 17, 2019
Ref #26563 PR-URL: #26572 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Ujjwal Sharma <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
throws
That's because
length |= 0
here converts to signed int32.Since the max TypedArray size in v8 is expanding to
MAX_SAFE_INTEGER
, switching toMath.round()
I think makes sense (vs adding>>> 0
, which would only support uint32)? Happy to open a PR if agreed.(#21994 looks slightly related, but is about bigint
position
values.)The text was updated successfully, but these errors were encountered: