Skip to content

src: fix JSONParser leaking internal V8 scopes - #50688

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
kvakil:refactor-json-parser
Nov 14, 2023
Merged

src: fix JSONParser leaking internal V8 scopes#50688
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
kvakil:refactor-json-parser

Conversation

@kvakil

@kvakil kvakil commented Nov 12, 2023

Copy link
Copy Markdown
Contributor

JSONParser uses V8's JSON.parse (for now), meaning that its uses handles
and contexts. JSONParser was leaking its internal HandleScope and
Context::Scope.

Move the scope construction to the member functions to prevent those
scopes from leaking.

Refs: #50680 (comment)

@kvakil
kvakil requested a review from bnoordhuis November 12, 2023 16:08
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Nov 12, 2023
Comment thread src/json_parser.cc Outdated
JSONParser uses V8's JSON.parse (for now), meaning that its uses handles
and contexts. JSONParser was leaking its internal HandleScope and
Context::Scope.

Move the scope construction to the member functions to prevent those
scopes from leaking.

Refs: nodejs#50680 (comment)
@kvakil
kvakil force-pushed the refactor-json-parser branch from 8eabb5b to bc466e6 Compare November 12, 2023 17:10
@kvakil
kvakil requested a review from legendecas November 12, 2023 17:11
@kvakil kvakil added the request-ci Add this label to start a Jenkins CI on a PR. label Nov 12, 2023
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Nov 12, 2023
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@bnoordhuis bnoordhuis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@kvakil kvakil added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Nov 12, 2023
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@kvakil kvakil added commit-queue-squash PRs the Commit Queue should land as one squashed commit. commit-queue PRs queued for automated landing through the Commit Queue. labels Nov 14, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 14, 2023
@nodejs-github-bot
nodejs-github-bot merged commit 09f4aa9 into nodejs:main Nov 14, 2023
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 09f4aa9

targos pushed a commit that referenced this pull request Nov 23, 2023
JSONParser uses V8's JSON.parse (for now), meaning that its uses handles
and contexts. JSONParser was leaking its internal HandleScope and
Context::Scope.

Move the scope construction to the member functions to prevent those
scopes from leaking.

Refs: #50680 (comment)
PR-URL: #50688
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
@RafaelGSS RafaelGSS mentioned this pull request Nov 28, 2023
UlisesGascon pushed a commit that referenced this pull request Dec 11, 2023
JSONParser uses V8's JSON.parse (for now), meaning that its uses handles
and contexts. JSONParser was leaking its internal HandleScope and
Context::Scope.

Move the scope construction to the member functions to prevent those
scopes from leaking.

Refs: #50680 (comment)
PR-URL: #50688
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
@UlisesGascon UlisesGascon mentioned this pull request Dec 12, 2023
UlisesGascon pushed a commit that referenced this pull request Dec 19, 2023
JSONParser uses V8's JSON.parse (for now), meaning that its uses handles
and contexts. JSONParser was leaking its internal HandleScope and
Context::Scope.

Move the scope construction to the member functions to prevent those
scopes from leaking.

Refs: #50680 (comment)
PR-URL: #50688
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-squash PRs the Commit Queue should land as one squashed commit. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants