Skip to content

Node >= 8.0.0 inconsistently not throwing "Maximum call stack size exceeded"#17684

@remojansen

Description

@remojansen
Build system information Build language: node_js Build group: stable Build dist: trusty Build id: 316498514 Job id: 316498516 Runtime kernel version: 4.9.6-040906-generic travis-build version: 724aa1721 Build image provisioning date and time Tue Dec 5 20:11:19 UTC 2017 Operating System Details Distributor ID: Ubuntu Description: Ubuntu 14.04.5 LTS Release: 14.04 Codename: trusty 

I'm the author of InversifyJS. InversifyJS is an IoC container and it is designed to throw an exception if it finds a circular dependency.

try{constresult=willThrow();thrownewError(`This line should never be executed. Expected  'willThrow' to throw! ${JSON.stringify(result)}`);}catch(e){// expect e to match some error (not the error above)}

The willThrow function should catch an Error of type Maximum call stack size exceeded and throw a custom error this is the case in versions 7.10.1, 8.8.1 but not the case in 9.2.0 or 9.3.0.

It is quite crazy because it is resolving an object that cannot be resolved (a circular object).

I have tried 9.3.0 in a few machines:

  • Ubuntu 14.04.5 LTS (Circle CI)
  • Windows 8.1 x86 (App veyor)
  • Macbook Pro 16.6.0 Darwin Kernel Version 16.6.0: Fri Apr 14 16:21:16 PDT 2017; root:xnu-3789.60.24~6/RELEASE_X86_64 x86_64
  • Linux Mint 4.4.0-21-generic 37-Ubuntu SMP Mon Apr 18 18:33:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

The only machines with the expected behavior (an exception is thrown) are the Macbook Pro and the WIndows machine.

I have a build that reproduces the issue https://travis-ci.org/inversify/InversifyJS/builds/316498439 and a PR inversify/InversifyJS#716.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions