Skip to content
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

buffer: buffer.constants.MAX_LENGTH is larger than expected #38093

Closed
Ayase-252 opened this issue Apr 5, 2021 · 1 comment
Closed

buffer: buffer.constants.MAX_LENGTH is larger than expected #38093

Ayase-252 opened this issue Apr 5, 2021 · 1 comment
Labels
buffer Issues and PRs related to the buffer subsystem. doc Issues and PRs related to the documentations.

Comments

@Ayase-252
Copy link
Member

Ayase-252 commented Apr 5, 2021

  • Version: v15.12.0
  • Platform: Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64
  • Subsystem: buffer

What steps will reproduce the bug?

Run node, then

const buffer = require("buffer")
buffer.constants.MAX_LENGTH

It shows buffer.constants.MAX_LENGTH is 4294967296. (2 ** 32)

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior?

buffer.constants.MAX_LENGTH should be 2147483647. As relevent docs say

What do you see instead?

buffer.constants.MAX_LENGTH is 4294967296

Additional information

Maybe related to #38090
Possibily the impact of Bump TypedArray max length to 2**32-1 elements in v8

@Ayase-252 Ayase-252 added the buffer Issues and PRs related to the buffer subsystem. label Apr 5, 2021
@Ayase-252 Ayase-252 changed the title buffer: buffer.constants.MAX_LENGTH is larger than docs says buffer: buffer.constants.MAX_LENGTH is larger than expected Apr 5, 2021
@bricss
Copy link

bricss commented Apr 5, 2021

IMO, it depends on the bitness of the system, aka 32-bit vs 64-bit integer 👾

Ayase-252 added a commit to Ayase-252/node that referenced this issue Apr 6, 2021
@RaisinTen RaisinTen added the doc Issues and PRs related to the documentations. label Apr 6, 2021
juanarbol pushed a commit to juanarbol/node that referenced this issue Apr 13, 2021
Fixes: nodejs#38093

PR-URL: nodejs#38109
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
juanarbol pushed a commit to juanarbol/node that referenced this issue Apr 13, 2021
Fixes: nodejs#38093

PR-URL: nodejs#38109
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

Backport-PR-URL: nodejs#38232
juanarbol pushed a commit to juanarbol/node that referenced this issue Apr 13, 2021
Fixes: nodejs#38093

PR-URL: nodejs#38109
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

Backport-PR-URL: nodejs#38232
BethGriggs pushed a commit that referenced this issue Apr 15, 2021
Fixes: #38093

PR-URL: #38109
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
juanarbol pushed a commit to juanarbol/node that referenced this issue Apr 20, 2021
Fixes: nodejs#38093

PR-URL: nodejs#38109
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

Backport-PR-URL: nodejs#38232
targos pushed a commit that referenced this issue Apr 24, 2021
Fixes: #38093

PR-URL: #38109
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

Backport-PR-URL: #38232
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
buffer Issues and PRs related to the buffer subsystem. doc Issues and PRs related to the documentations.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants