Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
Regression bug: AbortSignal.any() causing memory leak on long lived parent signal | GoodFirstPicks

Regression bug: AbortSignal.any() causing memory leak on long lived parent signal

nodejs/node 2 comments 10d ago
View on GitHub
mediumopenScope: somewhat clearSkill match: maybeTest focusedNode.jsJavaScript

Why this is a good first issue

Regression bug causing memory leak in AbortSignal.any() with long-lived parent signal.

AI Summary

The issue involves a regression bug in Node.js where AbortSignal.any() causes a memory leak when used with a long-lived parent signal. The bug was previously fixed but has resurfaced. The fix requires understanding the internals of AbortSignal and memory management.

Issue Description

Version

v24.13.1, v25.8.1

Platform

Linux KContainer 5.10.0-12-amd64 #1 SMP Debian 5.10.103-1 (2022-03-07) x86_64 x86_64 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

Hi,

I would like to report a potential regression bug in Node. It can be reproduced by running the following snippet:

const ac = new AbortController();

let i = 0;
function run() {
  // This is the operation that causes the leak: repeatedly creating
  // a combined signal from the same long-lived parent signal.
  AbortSignal.any([ac.signal]);

  if (++i % 100_000 === 0) {
    const mem = process.memoryUsage().rss / 1024 / 1024;
    const kDependantSignals = Object.getOwnPropertySymbols(ac.signal).filter(
      (s) => s.toString() === 'Symbol(kDependantSignals)'
    )[0];
    const signals = ac.signal[kDependantSignals];
    console.log(`${i} - ${mem.toFixed(2)} MiB - ${signals?.size} signals`);
  }

  setImmediate(run);
}

run();

How often does it reproduce? Is there a required condition?

No specific condition

What is the expected behavior? Why is that the expected behavior?

This issue was previously reported in #55351 and fixed in v22.12.0 'Jod' (https://github.com/nodejs/node/pull/55354)

root@KContainer:~/temp/55351# node -v
v22.12.0
root@KContainer:~/temp/55351# node test-any-leak.cjs
100000 - 84.80 MiB - 19191 signals
200000 - 95.71 MiB - 32634 signals
300000 - 98.24 MiB - 41438 signals
400000 - 95.88 MiB - 4510 signals
500000 - 96.83 MiB - 13195 signals
600000 - 97.34 MiB - 21910 signals
700000 - 97.34 MiB - 30580 signals
800000 - 98.64 MiB - 39250 signals
900000 - 96.63 MiB - 2309 signals
1000000 - 96.99 MiB - 11092 signals
1100000 - 97.77 MiB - 19777 signals
1200000 - 97.59 MiB - 28490 signals
1300000 - 99.08 MiB - 37238 signals
1400000 - 96.63 MiB - 329 signals
1500000 - 97.71 MiB - 9057 signals
1600000 - 98.16 MiB - 17778 signals
1700000 - 98.16 MiB - 26520 signals
1800000 - 99.60 MiB - 35267 si

GitHub Labels

abortcontroller

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 20 points when you complete it!

Risk Flags

  • memory leak
  • regression
Loading labels...

Details

Points20 pts
Difficultymedium
Scopesomewhat clear
Skill Matchmaybe
Test Focusedyes