FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

string_decoder: throw an error when writing a too long buffer by kylo5aby · Pull Request #52215 · nodejs/node · GitHub

/ node Public

string_decoder: throw an error when writing a too long buffer - #52215

Closed
kylo5aby wants to merge 1 commit into
nodejs:mainfrom
kylo5aby:string_decoder
Closed

string_decoder: throw an error when writing a too long buffer#52215
kylo5aby wants to merge 1 commit into
nodejs:mainfrom
kylo5aby:string_decoder

Conversation

Copy link
Copy Markdown
Contributor

Fixes: #52214

nodejs-github-bot added buffer Issues and PRs related to the buffer subsystem. c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Mar 26, 2024
mertcanaltin added the string_decoder Issues and PRs related to the string_decoder subsystem. label Mar 26, 2024
theanarkh added the request-ci Add this label to start a Jenkins CI on a PR. label Mar 27, 2024
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 27, 2024

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Contributor

The test will fail on some platforms. It looks like 2**31 is too big.

13:29:07 not ok 947 pummel/test-string-decoder-large-buffer
13:29:07   ---
13:29:07   duration_ms: 231.98500
13:29:07   severity: fail
13:29:07   exitcode: 1
13:29:07   stack: |-
13:29:07     C:\workspace\node-test-binary-windows-js-suites\node\test\pummel\test-string-decoder-large-buffer.js:24
13:29:07         throw e;
13:29:07         ^
13:29:07     
13:29:07     RangeError [ERR_OUT_OF_RANGE]: The value of "size" is out of range. It must be >= 0 && <= 2147483647. Received 2147483648
13:29:07         at Function.alloc (node:buffer:389:3)
13:29:07         at Object.<anonymous> (C:\workspace\node-test-binary-windows-js-suites\node\test\pummel\test-string-decoder-large-buffer.js:18:22)
13:29:07         at Module._compile (node:internal/modules/cjs/loader:1421:14)
13:29:07         at Module._extensions..js (node:internal/modules/cjs/loader:1499:10)
13:29:07         at Module.load (node:internal/modules/cjs/loader:1232:32)
13:29:07         at Module._load (node:internal/modules/cjs/loader:1048:12)
13:29:07         at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:187:14)
13:29:07         at node:internal/main/run_main_module:28:49 {
13:29:07       code: 'ERR_OUT_OF_RANGE'
13:29:07     }
13:29:07     

kylo5aby force-pushed the string_decoder branch 3 times, most recently from f691105 to dbb31b1 Compare March 27, 2024 13:39

kylo5aby commented Mar 27, 2024
edited
Loading

Copy link
Copy Markdown
Contributor Author

The test will fail on some platforms. It looks like 2**31 is too big.

13:29:07 not ok 947 pummel/test-string-decoder-large-buffer
13:29:07   ---
13:29:07   duration_ms: 231.98500
13:29:07   severity: fail
13:29:07   exitcode: 1
13:29:07   stack: |-
13:29:07     C:\workspace\node-test-binary-windows-js-suites\node\test\pummel\test-string-decoder-large-buffer.js:24
13:29:07         throw e;
13:29:07         ^
13:29:07     
13:29:07     RangeError [ERR_OUT_OF_RANGE]: The value of "size" is out of range. It must be >= 0 && <= 2147483647. Received 2147483648
13:29:07         at Function.alloc (node:buffer:389:3)
13:29:07         at Object.<anonymous> (C:\workspace\node-test-binary-windows-js-suites\node\test\pummel\test-string-decoder-large-buffer.js:18:22)
13:29:07         at Module._compile (node:internal/modules/cjs/loader:1421:14)
13:29:07         at Module._extensions..js (node:internal/modules/cjs/loader:1499:10)
13:29:07         at Module.load (node:internal/modules/cjs/loader:1232:32)
13:29:07         at Module._load (node:internal/modules/cjs/loader:1048:12)
13:29:07         at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:187:14)
13:29:07         at node:internal/main/run_main_module:28:49 {
13:29:07       code: 'ERR_OUT_OF_RANGE'
13:29:07     }
13:29:07     

I believe it's because of the buffer with size > INT32_MAX on x32 platform which will throw range error, I have updated and skip the test file on x32 platform

Copy link
Copy Markdown
Contributor Author

@theanarkh Could you pls retrigger CI?

theanarkh added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 24, 2024
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 24, 2024

Copy link
Copy Markdown
Collaborator

theanarkh added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 24, 2024
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 24, 2024

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

nodejs-github-bot commented May 4, 2024
edited by jasnell
Loading

Copy link
Copy Markdown
Collaborator

jasnell pushed a commit that referenced this pull request May 4, 2024
PR-URL: #52215
Fixes: #52214
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: theanarkh <theratliter@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

jasnell commented May 4, 2024

Copy link
Copy Markdown
Member

Landed in 8123be1

jasnell closed this May 4, 2024
targos pushed a commit that referenced this pull request May 8, 2024
PR-URL: #52215
Fixes: #52214
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: theanarkh <theratliter@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
marco-ippolito pushed a commit that referenced this pull request Jun 17, 2024
PR-URL: #52215
Fixes: #52214
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: theanarkh <theratliter@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
soophoo pushed a commit to soophoo/node that referenced this pull request Jun 20, 2024
PR-URL: nodejs#52215
Fixes: nodejs#52214
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: theanarkh <theratliter@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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. c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. string_decoder Issues and PRs related to the string_decoder subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

StringDecoder.write() doesn't report error when buffer length exceeds max integer value

7 participants


Back | FazBrowse Home | New Git URL