deps: uv: restore prior signal disposition on Android (DCP-4748)#4
Open
philippe-distributive wants to merge 236 commits into
Open
deps: uv: restore prior signal disposition on Android (DCP-4748)#4philippe-distributive wants to merge 236 commits into
philippe-distributive wants to merge 236 commits into
Conversation
assert: * (SEMVER-MAJOR) move assert.fail with multiple arguments to eol (James M Snell) nodejs#58532 * (SEMVER-MAJOR) move CallTracker to EOL (James M Snell) nodejs#58006 assert,util: * (SEMVER-MAJOR) fail promise comparison in deep equal checks (Ruben Bridgewater) nodejs#59448 * (SEMVER-MAJOR) handle invalid dates as equal in deep comparison (Ruben Bridgewater) nodejs#57627 async_hooks: * (SEMVER-MAJOR) move `asyncResource` property on bound function to EOL (James M Snell) nodejs#58618 buffer: * (SEMVER-MAJOR) move SlowBuffer to EOL (Filip Skokan) nodejs#58220 build: * (SEMVER-MAJOR) reset embedder string to "-node.0" (Michaël Zasso) nodejs#59805 * (SEMVER-MAJOR) bump minimum Clang version to 19 (Michaël Zasso) nodejs#59048 * (SEMVER-MAJOR) reset embedder string to "-node.0" (Michaël Zasso) nodejs#58064 * (SEMVER-MAJOR) stop distributing Corepack (Antoine du Hamel) nodejs#57617 child_process: * (SEMVER-MAJOR) move _channel to end-of-life (James M Snell) nodejs#58527 crypto: * (SEMVER-MAJOR) runtime-deprecate default shake128/256 output lengths (Filip Skokan) nodejs#59008 * (SEMVER-MAJOR) move deprecated hash and mgf1Hash options to EOL (James M Snell) nodejs#58706 * (SEMVER-MAJOR) runtime deprecate ECDH.setPublicKey() (James M Snell) nodejs#58620 deps: * (SEMVER-MAJOR) patch V8 for illumos (Dan McDonald) nodejs#59805 * (SEMVER-MAJOR) patch V8 to avoid duplicated zlib symbol (Michaël Zasso) nodejs#54077 * (SEMVER-MAJOR) update V8 to 14.1.146.11 (Michaël Zasso) nodejs#59805 * (SEMVER-MAJOR) V8: backport 1d3362c55396 (Shu-yu Guo) nodejs#58064 * (SEMVER-MAJOR) V8: cherry-pick 4f38995c8295 (Shu-yu Guo) nodejs#58064 * (SEMVER-MAJOR) V8: cherry-pick 044b9b6f589d (Rezvan Mahdavi Hezaveh) nodejs#58064 * (SEMVER-MAJOR) V8: cherry-pick d2ad518a0b57 (Joyee Cheung) nodejs#58064 * (SEMVER-MAJOR) V8: revert 6d6c1e680c7b (Michaël Zasso) nodejs#58064 * (SEMVER-MAJOR) V8: revert e3cddbedb205 (Michaël Zasso) nodejs#58064 * (SEMVER-MAJOR) use std::map in MSVC STL for EphemeronRememberedSet (Joyee Cheung) nodejs#58064 * (SEMVER-MAJOR) patch V8 for illumos (Dan McDonald) nodejs#58064 * (SEMVER-MAJOR) remove problematic comment from v8-internal (Michaël Zasso) nodejs#58064 * (SEMVER-MAJOR) define V8_PRESERVE_MOST as no-op on Windows (Stefan Stojanovic) nodejs#58064 * (SEMVER-MAJOR) fix FP16 bitcasts.h (Stefan Stojanovic) nodejs#58064 * (SEMVER-MAJOR) patch V8 to avoid duplicated zlib symbol (Michaël Zasso) nodejs#58064 * (SEMVER-MAJOR) update V8 to 13.7.152.9 (Michaël Zasso) nodejs#58064 dgram: * (SEMVER-MAJOR) move deprecated APIs to EOL (James M Snell) nodejs#58474 dns: * (SEMVER-MAJOR) move falsy hostname in lookup to end-of-life (James M Snell) nodejs#58619 doc,src,test: * (SEMVER-MAJOR) replace use of deprecated `GetIsolate` (Michaël Zasso) nodejs#59805 fs: * (SEMVER-MAJOR) move FileHandle close on GC to EOL (James M Snell) nodejs#58536 * (SEMVER-MAJOR) move rmdir recursive option to end-of-life (James M Snell) nodejs#58616 * (SEMVER-MAJOR) make `processReadResult()` and `readSyncRecursive()` private (Livia Medeiros) nodejs#58672 * (SEMVER-MAJOR) move fs stream open method to eol (James M Snell) nodejs#58529 * (SEMVER-MAJOR) remove `fs.F_OK`, `fs.R_OK`, `fs.W_OK`, `fs.X_OK` (Livia Medeiros) nodejs#55862 http: * (SEMVER-MAJOR) deprecate writeHeader (Sebastian Beltran) nodejs#59060 lib: * (SEMVER-MAJOR) use validators for argument validation (Nam Yooseong) nodejs#59416 * (SEMVER-MAJOR) expose global ErrorEvent (Richie Bendall) nodejs#58920 * (SEMVER-MAJOR) deprecate `_stream_*` modules (Dario Piotrowicz) nodejs#58337 * (SEMVER-MAJOR) deprecate _tls_common and _tls_wrap (Dario Piotrowicz) nodejs#57643 module: * (SEMVER-MAJOR) move Module._debug to end-of-life (James M Snell) nodejs#58473 node-api: * (SEMVER-MAJOR) add warning for NAPI_EXPERIMENTAL (Miguel Marcondes Filho) nodejs#58280 perf_hooks: * (SEMVER-MAJOR) move deprecated accessors to EOF (James M Snell) nodejs#58531 process: * (SEMVER-MAJOR) move multipleResolves event to EOL (James M Snell) nodejs#58707 repl: * (SEMVER-MAJOR) eol deprecate instantiating without new (Aviv Keller) nodejs#59495 src: * (SEMVER-MAJOR) update crypto.getCipherInfo() to use DictionaryTemplate (James M Snell) nodejs#60036 * (SEMVER-MAJOR) fix calls to v8::Object::wrap (Andreas Haas) nodejs#59805 * (SEMVER-MAJOR) update NODE_MODULE_VERSION to 141 (Michaël Zasso) nodejs#59805 * (SEMVER-MAJOR) improve performance of dotenv ToObject (James M Snell) nodejs#60038 * (SEMVER-MAJOR) use std::string_view from node_report (iknoom) nodejs#60006 * (SEMVER-MAJOR) unflag --experimental-webstorage by default (Daniel M Brasil) nodejs#57666 * (SEMVER-MAJOR) store `Local` for `CallbackScope` on stack (Anna Henningsen) nodejs#59705 * (SEMVER-MAJOR) remove node.h APIs to make callback without an async context (Chengzhong Wu) nodejs#58471 * (SEMVER-MAJOR) remove deprecated node::EmitBeforeExit and node::EmitExit (Chengzhong Wu) nodejs#58469 * (SEMVER-MAJOR) remove deprecated node::CreatePlatform and node::FreePlatform (Chengzhong Wu) nodejs#58470 * (SEMVER-MAJOR) remove deprecated node::InitializeNodeWithArgs (Chengzhong Wu) nodejs#58470 * (SEMVER-MAJOR) update NODE_MODULE_VERSION to 138 (Michaël Zasso) nodejs#58064 src,permission: * (SEMVER-MAJOR) add --allow-net permission (Rafael Gonzaga) nodejs#58517 test: * (SEMVER-MAJOR) update cppgc-object addon config (StefanStojanovic) nodejs#59805 * (SEMVER-MAJOR) spin longer for sequential/test-worker-prof (Michaël Zasso) nodejs#59805 * (SEMVER-MAJOR) remove `--always-turbofan` flag (Michaël Zasso) nodejs#59805 * (SEMVER-MAJOR) update snapshot for V8 14.1 (Michaël Zasso) nodejs#59805 test,win: * (SEMVER-MAJOR) split addon tests (StefanStojanovic) nodejs#59805 tls: * (SEMVER-MAJOR) move IP-address servername deprecation to eol (James M Snell) nodejs#58533 tools: * (SEMVER-MAJOR) update V8 gypfiles for 14.0 (Michaël Zasso) nodejs#59805 * (SEMVER-MAJOR) update V8 gypfiles for 13.9 (Michaël Zasso) nodejs#59805 * (SEMVER-MAJOR) update V8 gypfiles for 13.8 (Michaël Zasso) nodejs#59805 * (SEMVER-MAJOR) enable leaptiering for aix/ibmi (Abdirahim Musse) nodejs#59805 * (SEMVER-MAJOR) update V8 gypfiles for 13.7 (Michaël Zasso) nodejs#58064 url: * (SEMVER-MAJOR) move bad port deprecation in legacy url to end-of-life (James M Snell) nodejs#58617 util,console: * (SEMVER-MAJOR) colorize regexp groups, character classes, etc (Ruben Bridgewater) nodejs#59710 worker: * (SEMVER-MAJOR) move terminate callback to end-of-life (James M Snell) nodejs#58528 PR-URL: nodejs#59896 Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
PR-URL: nodejs#59896
PR-URL: nodejs#60219 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Refs: nodejs@5623194 PR-URL: nodejs#60223 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
PR-URL: nodejs#60224 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
PR-URL: nodejs#60225 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com> Co-Authored-By: RafaelGSS <rafael.nunu@hotmail.com> PR-URL: nodejs#59778 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Tim Perry <pimterry@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
This relaxes the validation in sync hooks so that it accepts the quirky nullish source returned by the default step of the async loader when the module being loaded is CommonJS. When there are no customization hooks registered, a saner synchronous default load step is used to use a property instead of a reset nullish source to signify that the module should go through the CJS monkey patching routes and reduce excessive reloading from disk. PR-URL: nodejs#59929 Fixes: nodejs#59384 Fixes: nodejs#57327 Refs: nodejs#59666 Refs: https://github.com/dygabo/load_module_test Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Jacob Smith <jacob@frende.me>
By default, the total buffered payloads are limited to 100MB, and 5MB for each single request. The oldest unused requests will be evicted first when the buffer size limit has been exceeded. PR-URL: nodejs#60236 Refs: https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-enable Reviewed-By: Ryuhei Shima <shimaryuhei@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
Original commit message:
[api] Add index-based module resolution in InstantiateModule()
Add new InstantiateModule() overload that allows embedders to identify
modules requests by index in the module requests array rather than
using specifier and import attributes. When embedders want to fetch
all the modules using information from module->GetModuleRequests()
before calling InstantiateModule() instead of having to do the fetching
inside the InstantiateModule() callback, they could just maintain a simple array of modules indexed by module request positions and
look up the fetched the module by index in the new callback.
Previously this has to be done by mapping from specifier and import
attributes to module objects cached on the embedder side, leading to an overhead to hash the specifier and import attributes for each module request.
Refs: nodejs#59396
Bug: 435317398
Change-Id: Ie017d2f3ccc605e0f58aa423504b5fa5fdbcc633
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6804466
Commit-Queue: Joyee Cheung <joyee@igalia.com>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#102613}
Refs: v8/v8@3d0f462
PR-URL: nodejs#59396
Refs: https://chromium-review.googlesource.com/c/v8/v8/+/6804466
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
PR-URL: nodejs#59396 Refs: https://chromium-review.googlesource.com/c/v8/v8/+/6804466 Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
This makes use of a new module resolution V8 API that passes in an index to the module request array to identify the module request, which simplifies the module linking process. PR-URL: nodejs#59396 Refs: https://chromium-review.googlesource.com/c/v8/v8/+/6804466 Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
PR-URL: nodejs#60261 Refs: https://chromium-review.googlesource.com/c/v8/v8/+/7017517 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Aditi Singh <aditisingh1400@gmail.com> Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
PR-URL: nodejs#60245 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
PR-URL: nodejs#60252 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
PR-URL: nodejs#60260 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Our own helper classes have the advantage of using stack storage a lot of the time, so they should always be preferred. PR-URL: nodejs#60244 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ilyas Shabi <ilyasshabi94@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com>
We should be using our own helpers for this instead. PR-URL: nodejs#60244 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ilyas Shabi <ilyasshabi94@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com>
This lays the initial groundwork for enabling the use of IsolateGroups. Every isolate in V8 is created within a group. When pointer compression is enabled, all isolates within a single group are limited to a 4 GB shared pointer cage. By default, all isolates in the process share the same group, which means that when running with pointer compression, the entire process would be limited to a single 4 GB shared pointer cage. But, we can create as many IsolateGroups as we want, limited only by the amount of virtual memory available on the machine. PR-URL: nodejs#60254 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
This makes skipping/running these tests easier to manage with a dedicated test runner that can be tweaked for SEA. PR-URL: nodejs#60250 Refs: nodejs#59553 Reviewed-By: Richard Lau <richard.lau@ibm.com> Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
It's unlikely that anyone would invest in fixing them on x64 macOS in the near future, now that x64 macOS is being phased out. Simply skip them for now. PR-URL: nodejs#60250 Refs: nodejs#59553 Reviewed-By: Richard Lau <richard.lau@ibm.com> Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
This seems to be a underdocumented but useful trick that only very few people know about. Also add a pointer to the test running guide in the test writing guide. PR-URL: nodejs#60265 Reviewed-By: Richard Lau <richard.lau@ibm.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
It seems after the recent V8 upgrade, it's no longer safe to assume there'll be 15 ticks per 1500ms. Lower it to 10 ticks. PR-URL: nodejs#60272 Refs: https://github.com/nodejs/reliability/blob/main/reports/2025-10-15.md Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
It previously re-einvented the pattern matching that's already supported by test.py, and was running the tests one by one, which can lead to time out on slower machines. This move it to sequential and use wildcard support in test.py to correctly parallelize the tests. PR-URL: nodejs#60273 Fixes: nodejs#60268 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
PR-URL: nodejs#60257 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: nodejs#60257 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: nodejs#60257 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
There can be a race from eagerly shutting down the servers and severing two pipes at the same time but for the purpose of this test, we only care about whether the requests are initiated from the client as expected, not how the upstream/proxy servers behave. Ignore EPIPE errors from them. PR-URL: nodejs#60269 Refs: nodejs#59741 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
PR-URL: nodejs#60256 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: theanarkh <theratliter@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Bryan English <bryan@bryanenglish.com>
Previously for each matching test, it would execute multiple `node -p` commands to decide the configurations of the executable. That means if there are 100 tests matched, it will run the Node.js executable 4*100 times to retrieve the same configurations repeatedly. This changes the loop order so that it only execute these commands once and reuse the results for all matching tests. PR-URL: nodejs#60266 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
NAPI_EXPERIMENTAL had to be removed because it caused a NAPI_VERSION definition conflict.
This exports V8 platform symbols in the Node shared library build.
nodejs#47557 removed the mark_arraybuffer_as_untransferable API, do it manually instead
This effectively reverts 743db02
Converting `node_api_nogc_finalize` to `napi_finalize` requires a reinterpret_cast in MSVC.
…Value` Type casting `.As<v8::Value>()` is required. See https://github.com/nodejs/node/blob/v25.2.1/deps/v8/include/v8-object.h#L519 Also nodejs@867586ce
…ng v8 with this flag
…system Crypto extensions (crc32/pmull) are a baseline feature in ARMv8.1-A, and RK3588 has Cortex-A76 (ARMv8.2-A) cores, which is new enough that these can be assumed without runtime detection.
…a bug when cross-compilation
the aligned_alloc function was not introduced to Android's C library (Bionic) until API level 28.
Refs: v8/v8@14.6.202.33...14.6.202.34 PR-URL: nodejs#62964 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Richard Lau <richard.lau@ibm.com>
Author
|
fixed upstream in libuv/libuv#5157 |
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.
208331f to
dcededb
Compare
Author
|
It seems upstream does not want any Android-specific code... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When a Node environment is torn down inside an Android app process
(
node::FreeEnvironment()→uv_close()on aUV_SIGNALhandle), libuvresets the signal's disposition to
SIG_DFL. On Android thatsigactioncall is intercepted by ART's
libsigchain, which logs an ERROR-level stacktrace on every worker stop:
ART claims SIGSEGV/SIGBUS/SIGFPE/SIGILL/SIGTRAP/SIGABRT for implicit
null-checks, stack-overflow detection, etc., so resetting one to
SIG_DFLalso clobbers ART's handler — semantically wrong, not just noisy.
Root cause
uv__signal_unregister_handler()unconditionally installsSIG_DFLonce thelast watcher for a signal is removed. libuv never recorded what was installed
before it added its multiplexer — there's a long-standing
/* XXX save old action so we can restore it later on? */TODO at the installsite.
Fix (gated to
__ANDROID__)On Android,
uv__signal_register_handler()captures the previousstruct sigaction(into a per-signum slot) on the genuine"no libuv handler → installed" transition — gated by a
saveflag so theoneshot↔regular re-registration paths never overwrite it with libuv's own
handler.
uv__signal_unregister_handler()then restores that saveddisposition instead of forcing
SIG_DFL, falling back toSIG_DFLonly whennothing was captured.
The whole save/restore path is
#ifdef __ANDROID__; off Android the codepath and behaviour are byte-for-byte unchanged. On Android the restored
handler is ART's (kept by libsigchain), so no
SIG_DFLreset — and nolibsigchain report — occurs. Zero hot-path cost (only the first register /
last unregister per signum); the saved table is touched only under the
existing global signal lock.
Why Android-only
A cross-platform version of this was tried upstream (libuv nodejs#4216) and
reverted (nodejs#4302, refs nodejs#4299) because macOS doesn't propagate
SA_RESETHANDin the old action returned bysigaction()— so the captureddisposition is wrong there. bionic (Android) round-trips the flags correctly,
so gating to
__ANDROID__keeps the fix where it's both needed and correctand leaves macOS/Linux/Windows on stock upstream behaviour. See the upstream
discussion in libuv#5157 (this change floated cross-platform) and libuv issue
nodejs#4299.
Alternatives rejected
SA_RESETHANDbug that got libuv gripe: deprecating fs.existsSync without a replacement that returns a boolean nodejs/node#4216 reverted (fix: workaround for possible V8 bug fixes #4266 nodejs/node#4299). Hence the__ANDROID__gate.rt_sigaction(SIG_DFL)syscall to bypass libsigchain — unsafe: itoverwrites libsigchain's kernel-level handler (the one ART chains behind),
silencing the log by breaking ART's signal handling.
documented "stop watching → default behaviour restored" contract.
Testing
we_get_signals_mixed— the oneshot↔regular path thesavegate guards —signal_pending_on_close,signal_close_loop_alive); non-Android compileswarning-free with stock
SIG_DFLbehaviour preserved.libnode.sofor all four Android ABIs (arm64-v8a, x86_64,armeabi-v7a, x86); the 32-bit pair via the ia32 build-host path.
libsigchain "Setting SIGSEGV to SIG_DFL"count 1 → 0, with the cleanup path confirmedexercised (
FreeEnvironmentruns,libuv loop closed cleanly).Upstreaming
The cross-platform variant is not currently acceptable upstream — it hits
the macOS
oldactbug (nodejs#4299) that reverted nodejs#4216. Tracked in libuv#5157,where an
__ANDROID__-gated version is proposed; the door reopens if asupported macOS (≥ 11) starts round-tripping the flags.
Rollout
Cut a tag (e.g.
dcp/3.2.1) → bumpnode-build'sGIT_TAG→ rebuild theAndroid
node_apizips → bump the URL/SHA indcp-native/externals/node_api/CMakeLists.txt. (The fourandroid-workerjnilibs/*.sohave already been rebuilt from this branch and validated on theemulator.)