Skip to content

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

@ilyaigpetrov

Description

@ilyaigpetrov
  • Node Version: v8.2.1
  • Platform: Linux 4.10.0-33-generic #37~16.04.1-Ubuntu SMP Fri Aug 11 14:07:24 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
  • [email protected]

My product is not affected by this bug, but I report it anyway because it's still a bug and may affect someone else.

'use strict';

const fetch = require('node-fetch');

// Function name `fetch` clashes with required `fetch`!
const FooBar = async function fetch(url, encoding) {

  const res = fetch(url); // Programmer forgot `await` here!
  const text = await res.text();

};

(async function () {
  return await FooBar('https://github.com');
})();
$ node foobar.js 
Error: async hook stack has become corrupted (actual: 0, expected: 1)
 1: node::Start(uv_loop_s*, int, char const* const*, int, char const* const*) [node]
 2: node::Start(int, char**) [node]
 3: __libc_start_main [/lib/x86_64-linux-gnu/libc.so.6]
 4: 0x8ec861 [node]

Expected

User-friendly error message is expected, not this stack error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    async_hooksIssues and PRs related to the async hooks subsystem.confirmed-bugIssues with confirmed bugs.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions