Commit Graph
44447 Commits
Author SHA1 Message Date
Matteo Collina 25d6799df6 tls: route callback exceptions through error handlers
Wrap pskCallback and ALPNCallback invocations in try-catch blocks
to route exceptions through owner.destroy() instead of letting them
become uncaught exceptions. This prevents remote attackers from
crashing TLS servers or causing resource exhaustion.

Fixes: https://hackerone.com/reports/3473882
PR-URL: https://github.com/nodejs-private/node-private/pull/782
PR-URL: https://github.com/nodejs-private/node-private/pull/796
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
CVE-ID: CVE-2026-21637
2026-01-07 16:38:34 +01:00
Matteo Collina 37509c3ff0 deps: update undici to 6.23.0
PR-URL: https://github.com/nodejs-private/node-private/pull/791
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2026-01-07 16:38:28 +01:00
Matteo Collina ddadc31f09 src: rethrow stack overflow exceptions in async_hooks
When a stack overflow exception occurs during async_hooks callbacks
(which use TryCatchScope::kFatal), detect the specific "Maximum call
stack size exceeded" RangeError and re-throw it instead of immediately
calling FatalException. This allows user code to catch the exception
with try-catch blocks instead of requiring uncaughtException handlers.

The implementation adds IsStackOverflowError() helper to detect stack
overflow RangeErrors and re-throws them in TryCatchScope destructor
instead of calling FatalException.

This fixes the issue where async_hooks would cause stack overflow
exceptions to exit with code 7 (kExceptionInFatalExceptionHandler)
instead of being catchable.

Fixes: https://github.com/nodejs/node/issues/37989
Ref: https://hackerone.com/reports/3456295
PR-URL: https://github.com/nodejs-private/node-private/pull/773
Refs: https://hackerone.com/reports/3456295
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
CVE-ID: CVE-2025-59466
2026-01-07 16:38:11 +01:00
RafaelGSS 6b4849583a lib,permission: require full read and write to symlink APIs
Refs: https://hackerone.com/reports/3417819
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
PR-URL: https://github.com/nodejs-private/node-private/pull/760
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
CVE-ID: CVE-2025-55130
2026-01-07 16:38:01 +01:00
RafaelGSS ebbf942a83 lib: disable futimes when permission model is enabled
Refs: https://hackerone.com/reports/3390084
PR-URL: https://github.com/nodejs-private/node-private/pull/748
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
CVE-ID: CVE-2025-55132
2026-01-07 16:37:53 +01:00
Antoine du Hamel c611ea6fc9 Working on v22.21.2
PR-URL: https://github.com/nodejs/node/pull/60375
2025-10-28 20:01:32 +01:00
Node.js GitHub Bot 6ac4ab19ad 2025-10-28, Version 22.21.1 'Jod' (LTS)
PR-URL: https://github.com/nodejs/node/pull/60375
v22.21.1
2025-10-23 18:26:35 +02:00
Anna Henningsen 76b4cab8fc src: bring permissions macros in line with general C/C++ standards
Specifically, avoid the hazard of unintentionally evaluating
an argument multiple times during macro expansion, and do not
assume the available of particular namespaces in the current scope.

PR-URL: https://github.com/nodejs/node/pull/60053
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2025-10-22 23:44:07 +02:00
iknoom 21970970c7 src: remove AnalyzeTemporaryDtors option from .clang-tidy
PR-URL: https://github.com/nodejs/node/pull/60008
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-10-22 23:44:05 +02:00
Haram Jeong ef67d09f50 http: improve writeEarlyHints by avoiding for-of loop
PR-URL: https://github.com/nodejs/node/pull/59958
Refs: https://github.com/nodejs/node/blob/main/doc/contributing/primordials.md#unsafe-array-iteration
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-10-22 23:44:05 +02:00
Dario Piotrowicz 40fea57fdd tools: add message on auto-fixing js lint issues in gh workflow
PR-URL: https://github.com/nodejs/node/pull/59128
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-10-22 23:44:05 +02:00
Luigi Pinca b928ea9716 test: ensure that the message event is fired
Use `common.mustCallAtLeast()` to verify that the `'message'` event is
fired.

PR-URL: https://github.com/nodejs/node/pull/59952
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
2025-10-22 23:44:04 +02:00
Antoine du Hamel aac90d351b tools: verify signatures when updating nghttp*
PR-URL: https://github.com/nodejs/node/pull/60113
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2025-10-22 23:44:04 +02:00
Gürgün Dayıoğlu 56abc4ac76 lib: optimize priority queue
PR-URL: https://github.com/nodejs/node/pull/60039
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-10-22 23:44:03 +02:00
BCD1me ea5cfd98c5 lib: implement passive listener behavior per spec
Implements the WHATWG DOM specification for passive event listeners,
ensuring that calls to `preventDefault()` are correctly ignored within
a passive listener context.

An internal `kInPassiveListener` state is added to the Event object
to track when a passive listener is executing. The `preventDefault()`
method and the `returnValue` setter are modified to check this state,
as well as the event's `cancelable` property. This state is reliably
cleaned up within a `finally` block to prevent state pollution in
case a listener throws an error.

This resolves previously failing Web Platform Tests (WPT) in
`AddEventListenerOptions-passive.any.js`.

Refs: https://dom.spec.whatwg.org/#dom-event-preventdefault
PR-URL: https://github.com/nodejs/node/pull/59995
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Mattias Buelens <mattias@buelens.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2025-10-22 23:44:01 +02:00
Shima Ryuhei c2dd6eed2f process: fix wrong asyncContext under unhandled-rejections=strict
Fixes: https://github.com/nodejs/node/issues/60034
PR-URL: https://github.com/nodejs/node/pull/60103
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2025-10-22 23:44:01 +02:00
Chengzhong Wu e4b95a5158 test: replace diagnostics_channel stackframe in output snapshots
PR-URL: https://github.com/nodejs/node/pull/60024
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-10-22 23:44:01 +02:00
Moonki Choi 609c063e81 src: remove unused variables from report
PR-URL: https://github.com/nodejs/node/pull/60047
Reviewed-By: theanarkh <theratliter@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-10-22 23:44:01 +02:00
Richard Lau 81a3055710 process: fix default env for process.execve
The `env` parameter for `process.execve` is documented to default
to `process.env`.

PR-URL: https://github.com/nodejs/node/pull/60029
Refs: https://github.com/nodejs/build/pull/4156
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-10-22 23:44:01 +02:00
SRAVANI GUNDEPALLI 4206406694 test: mark test-web-locks skip on IBM i
PR-URL: https://github.com/nodejs/node/pull/59996
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Abdirahim Musse <abdirahim.musse@ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-10-22 23:44:00 +02:00
Anna Henningsen 987841a773 src: avoid unnecessary string allocations in SPrintF impl
If we can use a `std::string_view` instead of a `std::string`, let's
just do that instead.

PR-URL: https://github.com/nodejs/node/pull/60052
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2025-10-22 23:43:59 +02:00
Anna Henningsen 6e386c0632 src: make ToLower/ToUpper input args more flexible
In particular, this enables passing `std::string_view` instead.

PR-URL: https://github.com/nodejs/node/pull/60052
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2025-10-22 23:43:59 +02:00
Rafael Gonzaga 9fae03c7d9 tools: use dependabot cooldown and move tools/doc
Refs: https://github.com/nodejs/node/issues/59911
PR-URL: https://github.com/nodejs/node/pull/59978
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2025-10-22 23:43:59 +02:00
Anna Henningsen c3be1226c7 src: allow std::string_view arguments to SPrintF() and friends
Modernize the code so there is no need to work with raw C strings
anymore.

PR-URL: https://github.com/nodejs/node/pull/60058
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-10-22 23:43:59 +02:00
Anna Henningsen 764d35647d src: remove unnecessary std::string error messages
If we can just use the classic `THROW_...()` methods directly,
without needing to allocate an `std::string` for the message/format
parameter, let's just do so.

PR-URL: https://github.com/nodejs/node/pull/60057
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-10-22 23:43:59 +02:00
Anna Henningsen 1289ef89ec src: remove unnecessary shadowed functions on Utf8Value & BufferValue
Both of these are already implemented on the superclass.

PR-URL: https://github.com/nodejs/node/pull/60056
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-10-22 23:43:58 +02:00
Anna Henningsen d1fb8a538d src: avoid unnecessary string -> char* -> string round trips
In these places we can just generate `std::string` directly, so
there's no need to convert to an intermediate C string.

PR-URL: https://github.com/nodejs/node/pull/60055
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-10-22 23:43:58 +02:00
Ruben Bridgewater df72dc96e9 console,util: improve array inspection performance
There is no need to do the own property check, since the descriptor
is needed right afterwards anyway.

PR-URL: https://github.com/nodejs/node/pull/60037
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
2025-10-22 23:43:57 +02:00
Diango Gavidia 26394cd5bf test: expand tls-check-server-identity coverage
PR-URL: https://github.com/nodejs/node/pull/60002
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2025-10-22 23:43:56 +02:00
Deokjin Kim b58df47995 test: fix typo of test-benchmark-readline.js
"bechmark" -> "benchmark" in test-benchmark-readline.js.
And fix test name in test-benchmark-validators.js.

PR-URL: https://github.com/nodejs/node/pull/59993
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
2025-10-22 23:43:56 +02:00
iknoom 54b439fb5a src: fill options_args, options_env after vectors are finalized
PR-URL: https://github.com/nodejs/node/pull/59945
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2025-10-22 23:43:55 +02:00
iknoom c7c597e2ca src: use RAII for uv_process_options_t
PR-URL: https://github.com/nodejs/node/pull/59945
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2025-10-22 23:43:54 +02:00
Bruno Rodrigues af33e8e668 benchmark: remove unused variable from util/priority-queue
PR-URL: https://github.com/nodejs/node/pull/59872
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-10-22 23:43:53 +02:00
Bruno Rodrigues 6764ce8756 benchmark: update count to n in permission startup
PR-URL: https://github.com/nodejs/node/pull/59872
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-10-22 23:43:53 +02:00
Bruno Rodrigues 4e8d99f0dc benchmark: update num to n in dgram offset-length
PR-URL: https://github.com/nodejs/node/pull/59872
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-10-22 23:43:53 +02:00
Gerhard Stöbich af3a59dba8 test: verify tracing channel doesn't swallow unhandledRejection
Add a test to verify that TracingChannel.tracePromise doesn't swallow
unhandledRejection events in case no then/catch handler is set by user.

PR-URL: https://github.com/nodejs/node/pull/59974
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2025-10-22 23:43:53 +02:00
Bruno Rodrigues af0a8ba7f8 benchmark: adjust dgram offset-length len values
PR-URL: https://github.com/nodejs/node/pull/59708
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2025-10-22 23:43:53 +02:00
Bruno Rodrigues 78efd1be4a benchmark: update num to n in dgram offset-length
PR-URL: https://github.com/nodejs/node/pull/59708
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2025-10-22 23:43:52 +02:00
Renegade334 cee362242b timers: fix binding fast call signatures
PR-URL: https://github.com/nodejs/node/pull/59600
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2025-10-22 23:43:52 +02:00
Renegade334 81548abdf6 wasi: fix WasiFunction fast call signature
PR-URL: https://github.com/nodejs/node/pull/59600
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2025-10-22 23:43:52 +02:00
Renegade334 fe492c7ace process: fix hrtime fast call signatures
PR-URL: https://github.com/nodejs/node/pull/59600
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2025-10-22 23:43:52 +02:00
Tim Perry 23468fd76b http2: fix allowHttp1+Upgrade, broken by shouldUpgradeCallback
This is required to use HTTP/1 websockets on an HTTP/2 server, which is
fairly common as websockets over HTTP/2 is much less widely supported.

This was broken by the recent shouldUpgradeCallback HTTP/1 addition,
which wasn't correctly added to the corresponding allowHttp1 part of
the HTTP/2 implementation.

PR-URL: https://github.com/nodejs/node/pull/59924
Backport-PR-URL: https://github.com/nodejs/node/pull/60341
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2025-10-22 23:41:34 +02:00
Antoine du Hamel ef9a6cd4c0 Working on v22.21.1
PR-URL: https://github.com/nodejs/node/pull/60230
2025-10-20 23:21:48 +02:00
Antoine du Hamel 54b94e13de 2025-10-20, Version 22.21.0 'Jod' (LTS)
Notable changes:

cli:
  * (SEMVER-MINOR) add `--use-env-proxy` (Joyee Cheung) https://github.com/nodejs/node/pull/59151
http:
  * (SEMVER-MINOR) support http proxy for fetch under `NODE_USE_ENV_PROXY` (Joyee Cheung) https://github.com/nodejs/node/pull/57165
  * (SEMVER-MINOR) add `shouldUpgradeCallback` to let servers control HTTP upgrades (Tim Perry) https://github.com/nodejs/node/pull/59824
http,https:
  * (SEMVER-MINOR) add built-in proxy support in `http`/`https.request` and `Agent` (Joyee Cheung) https://github.com/nodejs/node/pull/58980
src:
  * (SEMVER-MINOR) add percentage support to `--max-old-space-size` (Asaf Federman) https://github.com/nodejs/node/pull/59082

PR-URL: https://github.com/nodejs/node/pull/60230
v22.21.0
2025-10-19 00:35:43 +02:00
Joyee Cheung 1486fedea1 cli: add --use-env-proxy
This does the same as NODE_USE_ENV_PROXY. When both are set,
like other options that can be configured from both sides,
the CLI flag takes precedence.

PR-URL: https://github.com/nodejs/node/pull/59151
Fixes: https://github.com/nodejs/node/issues/59100
Reviewed-By: Ilyas Shabi <ilyasshabi94@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2025-10-18 20:35:56 +02:00
Joyee Cheung 42102594b1 http,https: add built-in proxy support in http/https.request and Agent
This patch implements proxy support for HTTP and HTTPS clients and
agents in the `http` and `https` built-ins`. When NODE_USE_ENV_PROXY
is set to 1, the default global agent would parse the
HTTP_PROXY/http_proxy, HTTPS_PROXY/https_proxy, NO_PROXY/no_proxy
settings from the environment variables, and proxy the requests
sent through the built-in http/https client accordingly.

To support this, `http.Agent` and `https.Agent` now accept a few new
options:

- `proxyEnv`: when it's an object, the agent would read and parse
  the HTTP_PROXY/http_proxy, HTTPS_PROXY/https_proxy, NO_PROXY/no_proxy
  properties from it, and apply them based on the protocol it uses
  to send requests. This option allows custom agents to
  reuse built-in proxy support by composing options. Global agents
  set this to `process.env` when NODE_USE_ENV_PROXY is 1.
- `defaultPort` and `protocol`: these allow setting of the default port
  and protocol of the agents. We also need these when configuring
  proxy settings and deciding whether a request should be proxied.

Implementation-wise, this adds a `ProxyConfig` internal class to handle
parsing and application of proxy configurations. The configuration
is parsed during agent construction. When requests are made,
the `createConnection()` methods on the agents would check whether
the request should be proxied. If yes, they either connect to the
proxy server (in the case of HTTP reqeusts) or establish a tunnel
(in the case of HTTPS requests) through either a TCP socket (if the
proxy uses HTTP) or a TLS socket (if the proxy uses HTTPS).

When proxying HTTPS requests through a tunnel, the connection listener
is invoked after the tunnel is established. Tunnel establishment uses
the timeout of the request options, if there is one. Otherwise it uses
the timeout of the agent.

If an error is encountered during tunnel establishment, an
ERR_PROXY_TUNNEL would be emitted on the returned socket. If the proxy
server sends a errored status code, the error would contain an
`statusCode` property. If the error is caused by timeout, the error
would contain a `proxyTunnelTimeout` property.

This implementation honors the built-in socket pool and socket limits.
Pooled sockets are still keyed by request endpoints, they are just
connected to the proxy server instead, and the persistence of the
connection can be maintained as long as the proxy server respects
connection/proxy-connection or persist by default (HTTP/1.1)

PR-URL: https://github.com/nodejs/node/pull/58980
Refs: https://github.com/nodejs/node/issues/57872
Refs: https://github.com/nodejs/node/issues/8381
Refs: https://github.com/nodejs/node/issues/15620
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2025-10-18 12:07:57 +02:00
Joyee Cheung ebec3ef68b test: move http proxy tests to test/client-proxy
Rewrite to ESM to use TLA.
Also add a test to make sure case precedence is honored.
Refs: https://about.gitlab.com/blog/we-need-to-talk-no-proxy

PR-URL: https://github.com/nodejs/node/pull/58980
Refs: https://github.com/nodejs/node/issues/57872
Refs: https://github.com/nodejs/node/issues/8381
Refs: https://github.com/nodejs/node/issues/15620
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2025-10-18 12:07:57 +02:00
Joyee Cheung bedaaa11fc http: support http proxy for fetch under NODE_USE_ENV_PROXY
When enabled, Node.js parses the `HTTP_PROXY`, `HTTPS_PROXY` and
`NO_PROXY` environment variables during startup, and tunnels requests
over the specified proxy.

This currently only affects requests sent over `fetch()`. Support for
other built-in `http` and `https` methods is under way.

PR-URL: https://github.com/nodejs/node/pull/57165
Refs: https://github.com/nodejs/undici/issues/1650
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2025-10-18 12:07:52 +02:00
Asaf Federman 660d57355e test,doc: skip --max-old-space-size-percentage on 32-bit platforms
PR-URL: https://github.com/nodejs/node/pull/60144
Backport-PR-URL: https://github.com/nodejs/node/pull/59631
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2025-10-17 19:01:30 +02:00
Asaf Federman 42c5544b97 src: assert memory calc for max-old-space-size-percentage
Add validation to ensure that --max-old-space-size-percentage cannot
be used when available memory cannot be calculated, preventing
undefined behavior when memory detection fails.

Also enhance test-process-constrained-memory.js to support testing
in constrained environments where memory calculation may fail.

PR-URL: https://github.com/nodejs/node/pull/59460
Backport-PR-URL: https://github.com/nodejs/node/pull/59631
Reviewed-By: theanarkh <theratliter@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2025-10-17 19:01:00 +02:00