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

@kvakilkvakil 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)

@nodejs-github-botnodejs-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 threadsrc/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)
@kvakilkvakil added the request-ci Add this label to start a Jenkins CI on a PR. label Nov 12, 2023
@github-actionsgithub-actionsBot 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

@bnoordhuisbnoordhuis 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.

👍

@kvakilkvakil added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Nov 12, 2023
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@kvakilkvakil added commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. commit-queue Add this label to land a pull request using GitHub Actions. labels Nov 14, 2023
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Nov 14, 2023
@nodejs-github-bot
nodejs-github-bot merged commit 09f4aa9 into nodejs:mainNov 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>
@RafaelGSSRafaelGSS 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>
@UlisesGasconUlisesGascon 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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.c++Issues and PRs that require attention from people who are familiar with C++.commit-queue-squashAdd this label to instruct the Commit Queue to squash all the PR commits into the first one.needs-ciPRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@kvakil@nodejs-github-bot@bnoordhuis@jasnell@legendecas