Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

async_hooks: async hook stack assertion shadows "Maximum call stack size exceeded" #36079

Closed
puzpuzpuz opened this issue Nov 11, 2020 · 2 comments
Labels
async_hooks Issues and PRs related to the async hooks subsystem.

Comments

@puzpuzpuz
Copy link
Member

puzpuzpuz commented Nov 11, 2020

What steps will reproduce the bug?

'use strict';
const { AsyncLocalStorage } = require('async_hooks');

const als = new AsyncLocalStorage();

function run(count) {
  if (count !== 0) {
    return als.run({}, run, --count);
  }
}
run(1000);

It's enough to run this script with node --stack-size=100 async-hooks-crash.js.

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

Always

What is the expected behavior?

RangeError: Maximum call stack size exceeded should be reported in the crash output:

$ node --stack-size=100 async-hooks-crash.js 
...

RangeError: Maximum call stack size exceeded
    ...

What do you see instead?

$ node --stack-size=100 async-hooks-crash.js 
Error: async hook stack has become corrupted (actual: 111, expected: 70)
 1: 0x97e352 node::AsyncHooks::pop_async_context(double) [node]
 2: 0x979587 node::AsyncWrap::PopAsyncContext(v8::FunctionCallbackInfo<v8::Value> const&) [node]
 3: 0xbe369b  [node]
 4: 0xbe4c46  [node]
 5: 0xbe52c6 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [node]
 6: 0x13ff259  [node]

Additional information

This issue was observed in CI runs for #34573 and #35779

Refs: #15448 (the condition is different and that issue was fixed a long time ago)

@Flarna
Copy link
Member

Flarna commented Jan 7, 2022

I can't reproduce this with latest 14, 16 and 17 versions. But it is still reproducible with 12.22.8

@targos targos added the v12.x label Jan 7, 2022
@targos
Copy link
Member

targos commented Apr 8, 2022

Closing this issue because v12.x goes EOL at the end of this month and no more releases are planned.

@targos targos closed this as completed Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
async_hooks Issues and PRs related to the async hooks subsystem.
Projects
None yet
Development

No branches or pull requests

3 participants