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
Linux linx-PC 5.8.0-63-generic #71-Ubuntu SMP Tue Jul 13 15:59:12 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
Repl
What steps will reproduce the bug?
Open node repl
Type (async (a)=>a(a))(async (a)=>a(a)) but don't press return
Crash
How often does it reproduce? Is there a required condition?
100% of the time.
What is the expected behavior?
The repl should not crash.
What do you see instead?
RangeError: Maximum call stack size exceeded
at <anonymous>:1:19
at <anonymous>:1:30
at <anonymous>:1:30
at <anonymous>:1:30
at <anonymous>:1:30
at <anonymous>:1:30
at <anonymous>:1:30
at <anonymous>:1:30
at <anonymous>:1:30
at <anonymous>:1:30
Additional information
Typing (a=>a(a))(a=>a(a)) doesn't crash and only prints the error after you press enter.
It won't crash the repl as stack won't exceed but might end up in the following error:
> RangeError: MapmaximumsizeexceededatMap.set(<anonymous>)
at AsyncHook.init (node:domain:76:15)
at emitInitNative (node:internal/async_hooks:201:43)
at emitInitScript (node:internal/async_hooks:506:3)
at promiseInitHook (node:internal/async_hooks:321:3)
at promiseInitHookWithDestroyTracking (node:internal/async_hooks:325:3)
at REPL1:1:45
at REPL1:1:81
at processTicksAndRejections (node:internal/process/task_queues:77:11)```
Activity
targos commentedon Oct 18, 2021
@nodejs/repl
BridgeAR commentedon Nov 29, 2021
Pressing enter crashes the REPL with newer versions. This is likely an issue due to top level away support?
yashLadha commentedon Mar 1, 2022
When building on master it is crashing without pressing enter as well @BridgeAR .
yashLadha commentedon Mar 1, 2022
On further deep-dive it seems TCO (Tail call optimisation) is not kicking in. To verify this hypothesis i have written a simple script
On executing the above script it is always erroring out with
StackOverflowtargos commentedon Mar 1, 2022
V8 doesn't implement TCO.
yashLadha commentedon Mar 8, 2022
Then isn't the expected behaviour in the issue template seems wrong?
yashLadha commentedon Mar 12, 2022
One more thing if you change the snippet just slightly.
It won't crash the repl as stack won't exceed but might end up in the following error:
avivkeller commentedon Jun 20, 2026
I can't reproduce in the latest version of Node.js