You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
readline regression since v24.2.0 on >= 1026 lines in input #60507
To reproduce, apply the following diff to benchmarks:
diff --git a/benchmark/readline/readline-iterable.js b/benchmark/readline/readline-iterable.js
index 9be4ea1f52b..a023424edd3 100644
--- a/benchmark/readline/readline-iterable.js+++ b/benchmark/readline/readline-iterable.js@@ -20,7 +20,7 @@ Amet nisl suscipit adipiscing bibendum est ultricies integer.
Sit amet dictum sit amet justo donec enim diam.
Condimentum mattis pellentesque id nibh tortor id aliquet lectus proin.
Diam in arcu cursus euismod quis viverra nibh.
-Rest of line`;+Rest of line`.repeat(900);
function oldWay() {
const readable = new Readable({
Observed behavior:
readline/readline-iterable.js type="old" n=10: 3,372,871.300286141
node:internal/readline/interface:579
throw new ERR_USE_AFTER_CLOSE('readline');
^
Error [ERR_USE_AFTER_CLOSE]: readline was closed
at Interface.resume (node:internal/readline/interface:579:13)
at Object.next (node:events:1074:19)
at main (benchmark/readline/readline-iterable.js:78:20)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
code: 'ERR_USE_AFTER_CLOSE'
}
Node.js v24.10.0
Any number of lines higher than 1025 (i.e. > highWaterMark + 1) reproduces this
main, 25, and 24 latest are affected.
First affected version is v24.2.0.
v24.1.0 was fine, v22 latest is fine.
#59431 might be related with a common cause, but that involves terminal, and this doesn't
I.e. after fixing this #59431 should be rechecked. The error is different though.
Activity
ChALkeR commentedon Nov 2, 2025
Bisect shows at 462c4b0
Caused by #58283
[-]readline regression since v24.2.0[/-][+]readline regression since v24.2.0 on >= 1026 lines in input[/+]ChALkeR commentedon Nov 2, 2025
This iterates through all of lines except the last one, and then panics on the last one
ChALkeR commentedon Nov 2, 2025
Here is a simplified version of what is going on in async iterator
This also reproduces the issue, but without the async iterator
rv2673 commentedon Jan 14, 2026
Any progress on fixing the regression or a known workaround for looping over readline interface?
ChALkeR commentedon Jan 18, 2026
@rv2673 Fix is in #60548, this is waiting for review
KeesVNavara commentedon Feb 10, 2026
Any updates on when the fix is merged?
events: don't call resume after close
events: don't call resume after close
rv2673 commentedon Feb 24, 2026
@ChALkeR I see the PR is merged. Any idea when this regression fix might land in a new release of node 24?
rv2673 commentedon Mar 2, 2026
It doesn't seem to have been part of node 24.14.0 released last week.
events: don't call resume after close
events: don't call resume after close
events: don't call resume after close
events: don't call resume after close
ci: fix failing maxmind update script by bumping Node.js to 24.19.0 (#…
events: do not call resume() from on() after the iterator closes (#42896