Open
Description
- Version: v14.15.1
- Platform: Linux 5.8.0-38-generic The binary and long term compatibility with node #43~20.04.1-Ubuntu SMP Tue Jan 12 16:39:47 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
- Subsystem: async_hooks
What steps will reproduce the bug?
Setup a node instance,
» node
and run the following javascript code.
async_hooks.createHook({after:new async_hooks.AsyncResource('str').bind(()=>{})}).enable();
Then the node instance crashes.
How often does it reproduce? Is there a required condition?
This abort can always be triggered following the steps above.
What is the expected behavior?
If any error occurs, an exception or other similar error-reporting stuff should be thrown. There is no reason to abort the whole node process.
What do you see instead?
» node
Welcome to Node.js v14.15.1.
Type ".help" for more information.
> async_hooks.createHook({after:new async_hooks.AsyncResource('str').bind(()=>{})}).enable();
AsyncHook {
[Symbol(init)]: undefined,
[Symbol(before)]: undefined,
[Symbol(after)]: [Function: bound runInAsyncScope] {
asyncResource: AsyncResource {
[Symbol(async_id_symbol)]: 26,
[Symbol(trigger_async_id_symbol)]: 5,
[Symbol(destroyed)]: [Object]
}
},
[Symbol(destroy)]: undefined,
[Symbol(promiseResolve)]: undefined
}
> RangeError: Maximum call stack size exceeded
at process._rawDebug (internal/process/per_thread.js:53:30)
at fatalError (internal/async_hooks.js:159:13)
at emitHook (internal/async_hooks.js:234:5)
at emitAfterScript (internal/async_hooks.js:480:5)
at AsyncResource.runInAsyncScope (async_hooks.js:198:9)
at emitHook (internal/async_hooks.js:230:38)
at emitAfterScript (internal/async_hooks.js:480:5)
at AsyncResource.runInAsyncScope (async_hooks.js:198:9)
at emitHook (internal/async_hooks.js:230:38)
at emitAfterScript (internal/async_hooks.js:480:5)