Skip to content

fix: workaround for possible V8 bug fixes #4266#4299

Closed
skilledDeveloper wants to merge 1 commit into
nodejs:masterfrom
skilledDeveloper:patch-1
Closed

fix: workaround for possible V8 bug fixes #4266#4299
skilledDeveloper wants to merge 1 commit into
nodejs:masterfrom
skilledDeveloper:patch-1

Conversation

@skilledDeveloper

Copy link
Copy Markdown

workaround for possible V8 bug (due to the use of .ToHandleChecked() in deps/v8/src/api.cc)
Original issue: #4266
@bnoordhuis please review

workaround for possible V8 bug (due to the use of .ToHandleChecked() in deps/v8/src/api.cc)
@bnoordhuis please review
@silverwind silverwind added the v8 engine Issues and PRs related to the V8 dependency. label Dec 15, 2015
@bnoordhuis

Copy link
Copy Markdown
Member

A couple of comments:

  1. This PR should be against the v0.12-staging branch.
  2. Don't use magic constants, add a static const size_t kMaxLength = ... to e.g. ExternString.
  3. There is no point in creating the ExternString if you're not going to use it.
  4. Returning an empty string is the wrong thing to do. Returning an empty handle may be okay.
  5. Comment style: // Capitalized and punctuated.

@bnoordhuis

Copy link
Copy Markdown
Member

Forgot to mention: please add regression tests.

@skilledDeveloper

Copy link
Copy Markdown
Author

OK. I'll create a new PR for this.

@skilledDeveloper

Copy link
Copy Markdown
Author

@bnoordhuis
Does a test like this work?

@bnoordhuis

Copy link
Copy Markdown
Member

Yes, you're welcome to steal tests from the master branch. They'll probably need some adjusting though.

philippe-distributive pushed a commit to Distributive-Network/node that referenced this pull request Jun 4, 2026
On Android, ART claims SIGSEGV/SIGBUS/SIGFPE/SIGILL/SIGTRAP/SIGABRT for
implicit null-checks and stack-overflow detection, routed through
libsigchain. libuv's uv__signal_unregister_handler() resets a signal to
SIG_DFL once its last watcher is removed; on Android that clobbers ART's
handler and emits an ERROR-level libsigchain stack trace on every embedded
node::FreeEnvironment() (DCP-4748).

Gated to __ANDROID__: uv__signal_register_handler() captures the previous
disposition on the no-handler -> handler transition and
uv__signal_unregister_handler() restores it instead of forcing SIG_DFL.
bionic round-trips the sigaction flags correctly, so this is safe; it is
deliberately NOT applied to other platforms (notably macOS, which drops
SA_RESETHAND in the old action -- see upstream libuv nodejs#4299, which caused
PR nodejs#4216 to be reverted). Off Android the code path and behaviour are
unchanged. The saved table is accessed only under the global signal lock.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v8 engine Issues and PRs related to the V8 dependency.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants