errors: handle V8 warnings in DisallowJavascriptExecutionScope by Anshikakalpana · Pull Request #63486 · nodejs/node · GitHub
Skip to content

errors: handle V8 warnings in DisallowJavascriptExecutionScope#63486

Open
Anshikakalpana wants to merge 1 commit into
nodejs:mainfrom
Anshikakalpana:fix-v8-warning-crash
Open

errors: handle V8 warnings in DisallowJavascriptExecutionScope#63486
Anshikakalpana wants to merge 1 commit into
nodejs:mainfrom
Anshikakalpana:fix-v8-warning-crash

Conversation

@Anshikakalpana

Copy link
Copy Markdown
Contributor

Fixes: #63473

Fix crash when V8 emits warning inside DisallowJavascriptExecutionScope.

When asm.js code is evaluated in the REPL with previews enabled, V8 emits a deprecation warning inside DisallowJavascriptExecutionScope. Node's warning handler tried to call process.emit() which is JS, causing a fatal crash.

Fix:
check can_call_into_js() before calling ProcessEmitWarningGeneric. If JS is not safe, print the warning directly to stderr instead.

@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 May 22, 2026
@codecov

codecov Bot commented May 22, 2026

Copy link
Copy Markdown

@codeCraft-Ritik codeCraft-Ritik left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice fix! Falling back to stderr when JS execution is disallowed seems like a safe and practical solution.

Fixes: nodejs#63473
Signed-off-by: Anshikakalpana <anshikajain196872@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

V8 warnings crash process within DisallowJavascriptExecutionScope

3 participants