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.

Fixes: nodejs#63473
Signed-off-by: Anshikakalpana <anshikajain196872@gmail.com>
@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
Copy link
Copy Markdown

codecov Bot commented May 22, 2026

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.09%. Comparing base (7eab492) to head (ec60a09).
⚠️ Report is 189 commits behind head on main.

Files with missing lines Patch % Lines
src/node_errors.cc 0.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #63486      +/-   ##
==========================================
+ Coverage   89.67%   90.09%   +0.41%     
==========================================
  Files         712      716       +4     
  Lines      221256   226652    +5396     
  Branches    42394    42598     +204     
==========================================
+ Hits       198420   204196    +5776     
+ Misses      14684    14314     -370     
+ Partials     8152     8142      -10     
Files with missing lines Coverage Δ
src/node_errors.cc 63.68% <0.00%> (-0.22%) ⬇️

... and 228 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

2 participants