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

buffer,doc: Throw error instead of assert when buffer too large by rayw000 · Pull Request #40243 · nodejs/node · GitHub

/ node Public

buffer,doc: Throw error instead of assert when buffer too large - #40243

Closed
rayw000 wants to merge 2 commits into
nodejs:masterfrom
rayw000:throw-error-instead-of-assert-when-buffer-too-large
Closed

buffer,doc: Throw error instead of assert when buffer too large#40243
rayw000 wants to merge 2 commits into
nodejs:masterfrom
rayw000:throw-error-instead-of-assert-when-buffer-too-large

Conversation

rayw000 commented Sep 28, 2021
edited
Loading

Copy link
Copy Markdown
Contributor

What changed

  1. Throw error instead of assertion when buffer is too large. Users can somehow reach the assertion, i.e. const buffer = v8.serialize(<huge object>). In this case, an exception would be better than assertion.
  2. Update document.

Additional: https://chromium-review.googlesource.com/c/v8/v8/+/3170411

Maybe fix: #40059

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 Sep 28, 2021
rayw000 changed the title Throw error instead of assert when buffer too large buffer+doc: Throw error instead of assert when buffer too large Sep 29, 2021
rayw000 changed the title buffer+doc: Throw error instead of assert when buffer too large buffer,doc: Throw error instead of assert when buffer too large Sep 29, 2021
Comment thread doc/api/v8.md Outdated
Comment thread doc/api/v8.md Outdated
rayw000 requested a review from tniessen October 5, 2021 01:11
Mesteery added request-ci Add this label to start a Jenkins CI on a PR. and removed needs-ci PRs that need a full CI run. labels Oct 12, 2021
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 12, 2021

Copy link
Copy Markdown
Collaborator

Mesteery added aix Issues and PRs related to the AIX platform. author ready PRs that have at least one approval, no outstanding review comments, and a CI started. and removed aix Issues and PRs related to the AIX platform. labels Oct 13, 2021

rayw000 commented Oct 13, 2021

Copy link
Copy Markdown
Contributor Author

Hi @Mesteery

I'm not sure that I fully understand the error report CI gives. Some of them are timeout and others are no test.
Perhaps a retrying could fix it?

Copy link
Copy Markdown
Contributor

I think these are flaky tests, they are not related to this PR.

Copy link
Copy Markdown
Collaborator

targos pushed a commit that referenced this pull request Oct 23, 2021
PR-URL: #40243
Fixes: #40059
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
targos pushed a commit that referenced this pull request Oct 23, 2021
PR-URL: #40243
Fixes: #40059
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>

targos commented Oct 23, 2021

Copy link
Copy Markdown
Member

Landed in c83f47f...14f6c67

targos closed this Oct 23, 2021
targos pushed a commit that referenced this pull request Oct 23, 2021
PR-URL: #40243
Fixes: #40059
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
targos pushed a commit that referenced this pull request Oct 23, 2021
PR-URL: #40243
Fixes: #40059
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
rayw000 deleted the throw-error-instead-of-assert-when-buffer-too-large branch October 23, 2021 07:19
targos mentioned this pull request Nov 8, 2021
BethGriggs pushed a commit that referenced this pull request Nov 24, 2021
PR-URL: #40243
Fixes: #40059
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
BethGriggs pushed a commit that referenced this pull request Nov 24, 2021
PR-URL: #40243
Fixes: #40059
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
BethGriggs mentioned this pull request Nov 26, 2021
1 task
kvakil added a commit to kvakil/node that referenced this pull request Jul 23, 2022
A recent pull request changed this method to throw when the buffer was
too big, but this meant that the `free` finalizer would never get
called, leading to a memory leak.

A previous version of this diff included a test provoking this behavior
with `v8.serialize`, but it unfortunately kept triggering the OOM
killer, so it was removed.

Refs: nodejs#40243
nodejs-github-bot pushed a commit that referenced this pull request Jul 24, 2022
A recent pull request changed this method to throw when the buffer was
too big, but this meant that the `free` finalizer would never get
called, leading to a memory leak.

A previous version of this diff included a test provoking this behavior
with `v8.serialize`, but it unfortunately kept triggering the OOM
killer, so it was removed.

Refs: #40243

PR-URL: #43938
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
danielleadams pushed a commit that referenced this pull request Jul 26, 2022
A recent pull request changed this method to throw when the buffer was
too big, but this meant that the `free` finalizer would never get
called, leading to a memory leak.

A previous version of this diff included a test provoking this behavior
with `v8.serialize`, but it unfortunately kept triggering the OOM
killer, so it was removed.

Refs: #40243

PR-URL: #43938
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
targos pushed a commit that referenced this pull request Jul 31, 2022
A recent pull request changed this method to throw when the buffer was
too big, but this meant that the `free` finalizer would never get
called, leading to a memory leak.

A previous version of this diff included a test provoking this behavior
with `v8.serialize`, but it unfortunately kept triggering the OOM
killer, so it was removed.

Refs: #40243

PR-URL: #43938
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
targos pushed a commit that referenced this pull request Aug 1, 2022
A recent pull request changed this method to throw when the buffer was
too big, but this meant that the `free` finalizer would never get
called, leading to a memory leak.

A previous version of this diff included a test provoking this behavior
with `v8.serialize`, but it unfortunately kept triggering the OOM
killer, so it was removed.

Refs: #40243

PR-URL: #43938
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
guangwong pushed a commit to noslate-project/node that referenced this pull request Oct 10, 2022
A recent pull request changed this method to throw when the buffer was
too big, but this meant that the `free` finalizer would never get
called, leading to a memory leak.

A previous version of this diff included a test provoking this behavior
with `v8.serialize`, but it unfortunately kept triggering the OOM
killer, so it was removed.

Refs: nodejs/node#40243

PR-URL: nodejs/node#43938
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
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

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. buffer Issues and PRs related to the buffer subsystem. c++ Issues and PRs that require attention from people who are familiar with C++.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document (or fix?) v8.deserialize' 2gb limitation for input buffer

6 participants


Back | FazBrowse Home | New Git URL