Commit Graph
48857 Commits
Author SHA1 Message Date
Filip Skokan f4d2742594 test: run node-bench tools test sequentially
The test and its benchmark subprocesses allocate large histograms.
Run it sequentially to reduce memory pressure on constrained CI hosts.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66338
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2026-10-04 07:30:28 +00:00
Trivikram Kamat 04904eb4ca ffi: fix exportArrayBuffer type check
Use isArrayBuffer() instead of comparing Object.prototype.toString()
output. The old check depended on Symbol.toStringTag, so a real
ArrayBuffer with a custom tag was rejected, and a plain object tagged
'ArrayBuffer' passed and failed later in native code with a misleading
error.

Signed-off-by: Trivikram Kamat <16024985+trivikr@users.noreply.github.com>
Assisted-by: claude:opus-5.5
PR-URL: https://github.com/nodejs/node/pull/66455
Fixes: https://github.com/nodejs/node/issues/66454
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2026-10-04 03:56:13 +00:00
Daniel Pinto 0a3c7f18a9 doc: add missing return types in cluster.md
`worker.isConnected()` and `worker.isDead()` described their boolean
result only in prose, so the documentation tooling had no return type
for them.

Signed-off-by: Daniel Pinto <1619617+Cayan@users.noreply.github.com>
Assisted-by: a frontier reasoning model
PR-URL: https://github.com/nodejs/node/pull/66453
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-10-04 02:37:42 +00:00
Rafael Gonzaga c60762cbd5 test: remove duplicated cases in permission fs-read fixture
The fs.createReadStream(blockedFile) and fs.lstatSync(bufferBlockedFile)
assertions were each present twice in the same block with identical
arguments and expectations, so the second copy added no coverage.

Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
PR-URL: https://github.com/nodejs/node/pull/66450
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-10-03 21:43:02 +00:00
dependabot[bot] 7ba8a73796 tools: bump the eslint group in /tools/eslint with 5 updates
Bumps the eslint group in /tools/eslint with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) | `8.0.5` | `8.0.6` |
| [@babel/eslint-parser](https://github.com/babel/babel/tree/HEAD/eslint/babel-eslint-parser) | `8.0.5` | `8.0.6` |
| [eslint](https://github.com/eslint/eslint) | `10.10.0` | `10.11.0` |
| [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) | `64.3.10` | `64.5.4` |
| [eslint-plugin-regexp](https://github.com/ota-meshi/eslint-plugin-regexp) | `3.3.0` | `3.3.1` |

Updates `@babel/core` from 8.0.5 to 8.0.6
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v8.0.6/packages/babel-core)

Updates `@babel/eslint-parser` from 8.0.5 to 8.0.6
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v8.0.6/eslint/babel-eslint-parser)

Updates `eslint` from 10.10.0 to 10.11.0
- [Release notes](https://github.com/eslint/eslint/releases)
- [Commits](https://github.com/eslint/eslint/compare/v10.10.0...v10.11.0)

Updates `eslint-plugin-jsdoc` from 64.3.10 to 64.5.4
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v64.3.10...v64.5.4)

Updates `eslint-plugin-regexp` from 3.3.0 to 3.3.1
- [Release notes](https://github.com/ota-meshi/eslint-plugin-regexp/releases)
- [Changelog](https://github.com/ota-meshi/eslint-plugin-regexp/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ota-meshi/eslint-plugin-regexp/compare/v3.3.0...v3.3.1)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-version: 8.0.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: eslint
- dependency-name: "@babel/eslint-parser"
  dependency-version: 8.0.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: eslint
- dependency-name: eslint
  dependency-version: 10.11.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: eslint
- dependency-name: eslint-plugin-jsdoc
  dependency-version: 64.5.4
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: eslint
- dependency-name: eslint-plugin-regexp
  dependency-version: 3.3.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: eslint
...

Signed-off-by: dependabot[bot] <support@github.com>
PR-URL: https://github.com/nodejs/node/pull/66445
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2026-10-03 19:34:40 +00:00
dependabot[bot] 001d644b93 meta: bump codecov/codecov-action from 7.1.0 to 7.1.1
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 7.1.0 to 7.1.1.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/0b35c9ecc4f0529d0eb674914510c22f85b196b4...303a32d7a59b442fa8d48b6a1cc6825c09c847a5)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-version: 7.1.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
PR-URL: https://github.com/nodejs/node/pull/66448
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-10-03 19:34:29 +00:00
Filip Skokan 2152942d52 test: run instantiateStreaming-bad-imports WPT
This test was skipped after hangs with V8 11.2. The associated compiler
shutdown deadlock involved NodePlatform::DrainTasks waiting for worker
tasks that needed garbage collection on the blocked main thread.

Since 5fb879c458, DrainTasks only waits for user-blocking tasks, which
excludes ordinary background compilation. Remove the obsolete skip.

Refs: https://github.com/nodejs/node/issues/47297
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Claude, Codex
PR-URL: https://github.com/nodejs/node/pull/66322
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
2026-10-03 16:24:38 +00:00
Filip Skokan 0ded159ee1 test: honor allowed WPT promise rejections
Honor allow_uncaught_exception for unhandled promise rejections in both
WPT worker paths. Apply setup settings before nested callbacks, preserve
settings after results start, and apply promise_setup settings when its
callback runs. Keep rejection failures in single_test mode.

Cover both runner backends and Web Workers, and remove the flaky
expectation for the Web Locks test that deliberately rejects.

Refs: https://github.com/nodejs/node/issues/59142
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Claude, Codex
PR-URL: https://github.com/nodejs/node/pull/66322
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
2026-10-03 16:24:37 +00:00
Filip Skokan 3f2450f630 test: scope Blob WPT failures to big-endian
The typed array Blob constructor tests expect little-endian byte order.
Mark them as expected failures only on big-endian platforms, so failures
on little-endian platforms remain visible.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Claude, Codex
PR-URL: https://github.com/nodejs/node/pull/66322
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
2026-10-03 16:24:35 +00:00
Filip Skokan c6d52f52c1 tools: share CI and benchmark build configuration
Benchmark builds kept Temporal enabled on macOS after the Nix default
changed, while shared-library CI disabled it. This forced benchmarks
to rebuild V8 instead of reusing the cached derivation.

Define the common build defaults in a Nix shell used by CI, benchmark
builds, and the V8 cache job to keep their configurations aligned.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/66351
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2026-10-03 14:08:27 +00:00
Matteo CollinaandClaude Fable 5.1 9067cc4771 tools: wait for test processes instead of polling
RunProcess polled the child with an exponential backoff that capped at
100 ms, so every test longer than roughly 300 ms paid 30-75 ms of
latency after it had already exited. Across the parallel suite that
adds up to about 160 thread-seconds.

Block in wait() instead and let a timer thread deliver the kill when
the timeout is crossed. Set the shutdown flag from the SIGINT handler
so a worker whose child died from the same ctrl-c does not report it
as a failure before the main thread aborts the run.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UH48w8TCtYmHd4P2UE6HEY
Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/66432
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2026-10-03 11:03:14 +00:00
Donghoon Kang 617e082ff2 ffi: accept safe integer numbers for 64-bit arguments
Allow safe integer numbers as int64 and uint64 arguments alongside
bigint values. Reject negative numbers for uint64 and numbers outside
the safe integer range. Keep 64-bit return values as bigint.

Apply validation and conversion across the Fast API, shared-buffer,
and generic argument conversion paths.

Add coverage for Number and BigInt boundaries, invalid inputs, and
single-argument calls before and after optimization.

Signed-off-by: HoonDongKang <d159123@naver.com>
Assisted-by: Codex:Astra-medium
PR-URL: https://github.com/nodejs/node/pull/66197
Fixes: https://github.com/nodejs/node/issues/66198
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2026-10-03 09:51:13 +00:00
Trivikram Kamat e21f81228d src: fix --process-timeout message when exit waits
process.exit(), uncaught exceptions and unhandled rejections exit
through Environment::Exit(), which never calls OnEnvironmentStopping().
If a Worker blocked in a synchronous native call held up that exit past
the deadline, the watchdog blamed the main thread.

Check Environment::is_stopping() and report that the process did not
finish exiting instead.

Signed-off-by: Trivikram Kamat <16024985+trivikr@users.noreply.github.com>
Assisted-by: claude:opus-5.5
PR-URL: https://github.com/nodejs/node/pull/66361
Fixes: https://github.com/nodejs/node/issues/66360
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-10-03 09:51:01 +00:00
Yuya Inoue a72712b6fd tools: avoid repeated subtree scans in must-call-assert
Match the promise call chain before checking for a descendant return
statement, preserving the existing lint checks.

Assisted-by: Codex
Signed-off-by: inoway46 <inoueyuya416@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66408
Refs: https://github.com/nodejs/node/issues/64972
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-10-03 09:50:49 +00:00
Matteo Collina 40933d58ae benchmark: add implicit-framing case to http/set-header
The existing `setHeader` and `setHeaderWH` cases set `Content-Length`
explicitly, and `normal` passes every header to `writeHead()`. The very
common handler shape `res.setHeader(...)` + `res.end(body)`, where
`end()` derives the framing, exercises a different path and was not
covered.

Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/66420
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2026-10-03 09:50:37 +00:00
Matteo Collina b933d20c3f http: avoid dictionary-mode objects in responses
`setHeader()` stored headers in a `{ __proto__: null }` literal and
`OutgoingMessage` let EventEmitter create the same literal for its
listener table. V8 creates null-prototype literals in dictionary mode,
so every response paid for a hash table allocation on the first
`setHeader()`/`on()` call and for dictionary lookups on every header
access, including the `for...in` in `_storeHeader()`.

Use a fast-mode object with an empty null-prototype chain for the
headers, and preset the listener table with the common events, as
streams already do.

Hello-world server (`res.setHeader()` + `res.end()`), one core:
40.9k -> 50.0k req/s (+22%); CPU 24.4 -> 20.0 us/req; 4374 -> 3905 B
of young-gen allocation per request. Responses are byte-identical.

Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/66420
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2026-10-03 09:50:37 +00:00
Miodrag Obradovic 1ee5d29c75 util: fix inspect indentation of detached DataView
formatExtraProperties() raised ctx.indentationLvl before reading the
property. The getters of a detached DataView throw, so the level was
never lowered again, and the DataView and everything inspected after it
in the same call ended up indented too far. Read the value first.

Signed-off-by: Miodrag Obradovic <mck097@gmail.com>
Assisted-by: a closed-source coding agent
PR-URL: https://github.com/nodejs/node/pull/66421
Refs: https://github.com/nodejs/node/pull/60131
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-10-03 09:50:25 +00:00
Antoine du Hamel 253ebd2429 tools: add cache to lint-js-and-md
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66412
Refs: https://github.com/nodejs/node/issues/64972
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Mike McCready <66998419+MikeMcC399@users.noreply.github.com>
2026-10-03 11:27:00 +02:00
Mert Can Altin 52b68e01a0 crypto: improve random synchronous number generation performance
Instead of creating a RandomBytesJob object, it calls CSPRNG()
directly now.

Assisted-by: Claude Code
Signed-off-by: Mert Can Altin <mertgold60@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66348
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-10-03 08:32:22 +00:00
dependabot[bot] 32caf9c4bd tools: bump brace-expansion in /tools/clang-format
Bumps [brace-expansion](https://github.com/juliangruber/brace-expansion) from 1.1.18 to 1.1.21.
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](https://github.com/juliangruber/brace-expansion/compare/v1.1.18...v1.1.21)

---
updated-dependencies:
- dependency-name: brace-expansion
  dependency-version: 1.1.21
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
PR-URL: https://github.com/nodejs/node/pull/66418
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-10-03 09:52:14 +02:00
Filip Skokan 53eeed2e90 test: wait for ZIP source streams to close
A destroyed read stream can still have a pending open or close. Wait for
closure before removing the temporary files, so cleanup cannot race a
pending open and cause ENOENT in test-zlib-zip-files.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/66429
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2026-10-03 07:35:17 +00:00
Matteo Collina 984aa0c25e async_hooks: remove legacy AsyncLocalStorage implementation
Remove the async_hooks-based AsyncLocalStorage fallback and the
--no-async-context-frame flag, making AsyncContextFrame the sole
implementation.

Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/63641
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2026-10-03 06:41:28 +00:00
Filip Skokan 6ecfd6587d test: mark worker init failure flaky on SmartOS
Track the descriptor-dependent V8 entropy failure until the libuv update
in #66282 removes the dependency on opening /dev/urandom.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/66428
Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-10-03 06:40:59 +00:00
Filip Skokan c1e6d0cbde test: deflake process timeout report cleanup
The grandchild can briefly outlive the timed-out process while it waits
to detect its parent's exit. Give it a working directory outside the
test's temporary directory so it does not block cleanup on Windows.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/66428
Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-10-03 06:40:58 +00:00
Filip Skokan 993d0044ec test: split process timeout report coverage
Move the blocked Worker case into its own test.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/66428
Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-10-03 06:40:58 +00:00
Trivikram Kamat 2bcc5dd2ee ffi: remove permission checks from dlclose and dlsym
The docs describe `ffi.dlclose(handle)` and `ffi.dlsym(handle, symbol)`
as equivalent to `handle.close()` and `handle.getSymbol(symbol)`, but
only the functions called `checkFFIPermission()`. After
`process.permission.drop('ffi')`, `ffi.dlclose(lib)` threw
`ERR_ACCESS_DENIED` while `lib.close()` succeeded.

Remove the checks so the functions defer to the handle. Permission is
already checked when the `DynamicLibrary` is constructed, and dropping
a permission does not revoke resources that are already open.

Signed-off-by: Trivikram Kamat <16024985+trivikr@users.noreply.github.com>
Assisted-by: claude:opus-5.5
PR-URL: https://github.com/nodejs/node/pull/66426
Fixes: https://github.com/nodejs/node/issues/66425
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2026-10-03 05:29:33 +00:00
Christian Aurich Zanettini Martins 7fab6566c0 fs: keep timestamps of files skipped by cpSync
With `force: false` and `preserveTimestamps: true`, the native
directory copy used by `cpSync()` left existing destination files in
place but still copied the source timestamps onto them. The JavaScript
walk, used by `cpSync()` with a `filter` and by `fs.cp()`, leaves
those files untouched.

Only copy the timestamps of files that were actually copied, as is
already done for their mode.

Signed-off-by: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66305
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2026-10-02 22:33:38 +00:00
dependabot[bot] d880e7474c tools: bump brace-expansion from 5.0.9 to 5.0.12 in /tools/eslint
Bumps [brace-expansion](https://github.com/juliangruber/brace-expansion) from 5.0.9 to 5.0.12.
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](https://github.com/juliangruber/brace-expansion/compare/v5.0.9...v5.0.12)

---
updated-dependencies:
- dependency-name: brace-expansion
  dependency-version: 5.0.12
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
PR-URL: https://github.com/nodejs/node/pull/66417
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-10-02 21:22:17 +00:00
Jungwon Sohn 4791219541 module: centralize builtin exposure policies
Keep scheme-only and option-gated builtin exposure rules in the
JavaScript loader. Leave option registration and code-cache
categorization with their native owners.

Assisted-by: Codex
Signed-off-by: sjungwon03 <sjungwon03@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66292
Refs: https://github.com/nodejs/node/pull/65418
Refs: https://github.com/nodejs/node/pull/65964
Refs: https://github.com/nodejs/node/pull/65920
Refs: https://github.com/nodejs/node/pull/65840
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
2026-10-02 17:29:27 +00:00
Joyee Cheung cfb6aa1749 test: do not hardcode V8 serialization header
The header changes when V8 is updated. Do not hardcode it to
avoid breaking V8 updates. The update should only surface in
test/parallel/test-v8-serdes.js

Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66442
Refs: https://github.com/nodejs/node/pull/65161
Reviewed-By: Shelley Vohr <shelley.vohr@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
2026-10-02 16:56:58 +00:00
Node.js GitHub Bot 90d71c113a deps: update timezone to 2026e
PR-URL: https://github.com/nodejs/node/pull/66419
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2026-10-02 16:00:41 +00:00
Matteo Collina 4486dce709 process: use a class for nextTick resources
The resource created for each `process.nextTick()` call was an object
literal with three computed symbol keys. V8 builds such literals from a
boilerplate that only covers the static keys, so the symbol-keyed
properties end up in a separate property array allocated per tick, and
each computed-key store goes through the runtime.

Construct the resource through a class instead, so that every tick
object shares one map with all five fields in-object.

process/next-tick-breadth-args.js: ~1.58M -> ~1.95M ops/s (+23%).

Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/66415
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2026-10-02 14:45:34 +00:00
Trivikram Kamat 463711aa55 ffi: validate pointer ranges in optimized calls
On x64 SysV and arm64, a Fast API signature with two or more
arguments that uses only pointer and float types got no JS wrapper.
V8 then truncated pointer BigInts silently. With `-1n` or
`2n ** 64n + 5n`, cold calls threw ERR_INVALID_ARG_VALUE, while
optimized calls passed 0xffffffffffffffff or 5 to native code.

Use the argument wrapper for any signature with a pointer argument.

Signed-off-by: Trivikram Kamat <16024985+trivikr@users.noreply.github.com>
Assisted-by: claude:opus-5.5
PR-URL: https://github.com/nodejs/node/pull/66371
Fixes: https://github.com/nodejs/node/issues/66370
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2026-10-02 07:35:11 +00:00
Trivikram Kamat de073c56fa ffi: throw on allocation failure in toArrayBuffer()
The copy path of toArrayBuffer() allocated its backing store with
V8's default failure mode, so a large length aborted the process
with a fatal out-of-memory error. toBuffer() throws a catchable
ERR_MEMORY_ALLOCATION_FAILED for the same input.

Allocate with kReturnNull and throw ERR_MEMORY_ALLOCATION_FAILED
when the allocation fails. The memory is left uninitialized because
memcpy() fills it right after.

Signed-off-by: Trivikram Kamat <16024985+trivikr@users.noreply.github.com>
Assisted-by: claude:opus-5.5
PR-URL: https://github.com/nodejs/node/pull/66406
Fixes: https://github.com/nodejs/node/issues/66405
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2026-10-02 07:34:55 +00:00
Aviv Keller a7a978415c deps: V8: cherry-pick c795f5948568
Original commit message:

    [immutable-array-buffer] Fix check order in TypedArray.prototype.set

    According to the spec, TypedArray.prototype.set checks
    IsImmutableBuffer(target.[[ViewedArrayBuffer]]) before converting
    the offset argument to integer and before reading from the source
    object.

    Additionally, when setting from a TypedArray source, reading from an
    immutable source TypedArray is permitted, so the source array should
    be validated using TypedArrayAccessMode::kRead rather than kWrite.

    Drive-By: Add a fast case for Smi indices where the steps are not
              observable and we can fold all checks.

    TAG=agy
    CONV=94aa3be8-9990-41fe-a565-c62e3daa9a42

    Bug: 450237486
    Change-Id: I21790be90cde9a96ba7c1f573f034016d9c29850
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8252528
    Reviewed-by: Igor Sheludko <ishell@chromium.org>
    Commit-Queue: Igor Sheludko <ishell@chromium.org>
    Auto-Submit: Olivier Flückiger <olivf@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#109366}

Refs: https://github.com/v8/v8/commit/c795f5948568dc7c5cce585928b9a6acb307ca82
PR-URL: https://github.com/nodejs/node/pull/66380
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2026-10-02 02:56:48 +00:00
René fbbf534de7 src: remove orphaned js_udp_wrap test binding
Signed-off-by: Renegade334 <contact.9a5d6388@renegade334.me.uk>
PR-URL: https://github.com/nodejs/node/pull/66399
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
2026-10-01 23:16:46 +00:00
René adcd028c0e tools: keep OpenSSL update PRs in draft until arch configs committed
Signed-off-by: Renegade334 <contact.9a5d6388@renegade334.me.uk>
PR-URL: https://github.com/nodejs/node/pull/66398
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
2026-10-01 15:48:02 +00:00
Node.js GitHub Bot 79f73b939d tools: update gyp-next to 0.22.3
PR-URL: https://github.com/nodejs/node/pull/66397
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-10-01 15:37:03 +00:00
Node.js GitHub Bot ad61975a8e deps: update archs files for openssl-3.5.9
PR-URL: https://github.com/nodejs/node/pull/66396
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
2026-10-01 14:29:53 +00:00
Node.js GitHub Bot 5bfa451438 deps: upgrade openssl sources to openssl-3.5.9
PR-URL: https://github.com/nodejs/node/pull/66396
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
2026-10-01 14:29:51 +00:00
Muhammad Faizan Uddin 21090da0cf test_runner: do not crash on stdout that mimics a v8 frame
The child test process sends framed report messages and raw user stdout
over one pipe, using the bytes FF 0F to mark the start of a frame. User
output can contain those same bytes, so #processRawBuffer could read a
plausible size from stray stdout and hand the bytes to the v8
deserializer. The deserializer then threw. Because the call had no error
handling, the exception aborted the whole test run.

Read the frame before advancing the buffer and wrap the deserialize in a
try/catch. When the read fails, leave the buffer untouched and stop
parsing frames so #drainRawBuffer emits the stray byte as stdout and
rescans for the next real header. This turns a fatal crash into
recoverable stdout and preserves any real frames that follow the stray
bytes.

Fixes: https://github.com/nodejs/node/issues/66164
Signed-off-by: Muhammad Faizan Uddin <faizan.uddin94@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66273
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-10-01 13:48:15 +00:00
Trivikram Kamat cede7e6740 ffi: do not abort when a Worker stops in a callback
Stopping a Worker while it is running an FFI callback aborted the whole
process with "Callbacks cannot throw an exception". This happened on
worker.terminate(), on process.exit() inside the callback, and when the
main thread exited while the Worker was in a callback, since exit
terminates all Workers.

All three stop the Worker by terminating execution, and InvokeCallback
treated the termination as a thrown exception. Check HasTerminated()
first and return a zeroed result so the native caller can unwind.
Callbacks that throw still abort.

Signed-off-by: Trivikram Kamat <16024985+trivikr@users.noreply.github.com>
Assisted-by: claude:opus-5.5
PR-URL: https://github.com/nodejs/node/pull/66389
Fixes: https://github.com/nodejs/node/issues/66388
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-10-01 05:53:52 +00:00
Guilherme Araújo 5ebe0ebf65 sqlite: restore connection state on reopen
close() destroys the connection but keeps the DatabaseSync object, and
open() did not replay the state held on it.

An authorizer set with setAuthorizer() was not reinstalled, silently
dropping a deny-all policy. Limits written through db.limits.* reverted
to the constructor values. Extension loading was re-enabled from the
constructor ceiling rather than the current setting, so the connection
flag contradicted a previous enableLoadExtension(false), though
loadExtension() itself stayed blocked by its own check.

Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
Assisted-by: Claude Code
PR-URL: https://github.com/nodejs/node/pull/66042
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2026-10-01 05:39:07 +00:00
Antoine du Hamel 5e3bbc4ac4 tools: fix Nix diff tools when pushing more than 1 commit
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66383
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-09-30 22:38:19 +00:00
Joyee Cheung d7ea02dd5d test: make histogram external memory test less overfitting
The test assumes too much about V8 GC's internal mechanisms and
thresholds that is no longer true on newer V8 versions and break
future V8 updates. Update it to only detect the occurence of
major GC to make it more future-proof and unblock V8 updates.

Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66416
Refs: https://github.com/nodejs/node/pull/65161
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
2026-09-30 17:49:14 +00:00
Antoine du Hamel a3219b6e07 tools: reduce bundle size of benchmarkTools.nix (#65388)
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65388
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-09-30 17:01:37 +02:00
Richard Lau 9c67491706 doc: update Node.js 27 official binary toolchains
Update `BUILDING.md` to reflect that official non-musl Linux binaries
are now built on RHEL 9.

Signed-off-by: Richard Lau <richard.lau@ibm.com>
PR-URL: https://github.com/nodejs/node/pull/66377
Refs: https://github.com/nodejs/build/issues/4431
Reviewed-By: Mike McCready <66998419+MikeMcC399@users.noreply.github.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Stewart X Addison <sxa@redhat.com>
2026-09-30 14:27:42 +00:00
Shelley Vohr bd83a5cd7a child_process: build the default env block in one native pass
When spawn()/spawnSync() are called without options.env,
normalizeSpawnArguments() copied process.env with a spread and then
walked the copy to build the KEY=value array uv_spawn() takes.
Spreading the process.env proxy costs one enumerator callback plus a
query and a getter interceptor per variable, each doing a linear
getenv() scan and allocating; with a couple of hundred variables that
was the single largest JS-side cost of spawning a process.

Add KVStore::Pairs() (Enumerate() + Get() by default, one
uv_os_environ() pass for the real environment, skipping hidden
variables on Windows exactly like Enumerate() does), expose it as
process_wrap.getEnvPairs(), and use it for the default-environment
case. A user supplied options.env and the permission model case keep
the existing code. On Windows the same sort/first-wins-case-insensitive
filter is applied to the pairs. The variables copyProcessEnvToEnv()
propagates are part of the real environment by definition, and its
entries cannot contain null bytes, so those steps only remain on the
options.env path.

Signed-off-by: Shelley Vohr <shelley.vohr@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65325
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-09-30 13:30:42 +00:00
Kyungrae Kang d782ae67b6 sqlite: use cached strings for property keys
Signed-off-by: Kyungrae Kang <kyungrae2002@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/65902
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2026-09-30 13:30:27 +00:00
Christian Aurich Zanettini Martins b9bb1bd36c ffi: reject unsafe integers as length or offset
GetValidatedSize() checks the value against
static_cast<double>(SIZE_MAX), which rounds up to 2^64 on 64-bit
platforms. A length or offset of 2 ** 64 gets through, and the cast to
size_t after it is undefined behavior. With GCC on x64 it gives 0, so
ffi.setUint8(ptr, 2 ** 64, 42) writes to ptr instead of throwing.

Anything above Number.MAX_SAFE_INTEGER may already have been rounded
by the time it gets here, so reject those values too. The export*()
helpers already cap their length there, and so does setInt64() for
number values. SIZE_MAX is still the limit on 32-bit platforms.

When buffer.constants.MAX_LENGTH is Number.MAX_SAFE_INTEGER, as on
64-bit builds without the V8 sandbox, toBuffer() and toArrayBuffer()
now throw ERR_OUT_OF_RANGE for MAX_LENGTH + 1 instead of
ERR_BUFFER_TOO_LARGE.

Signed-off-by: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66216
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
2026-09-30 13:30:12 +00:00