Skip to content

Error stack inspection is broken on v6.x for most scenarios #250

Description

@mmarchini

Tested on Node.js v6.15.0. The issue can be reproduced with a core dump generated with the following command:

node --abort-on-uncaught-exception -e "let n = new Error(); throw new TypeError()"

Neither Error nor TypeError are displaying the stack trace on 6.x.

For TypeError the problem is how llnode guesses determines the object is an Error on v6.x: https://github.com/nodejs/llnode/blob/master/src/llv8-inl.h#L92-L99
We should find a better heuristic if we want to support this feature on v6.x.

For Error, the first element of the stack array is 1 in this test case, it should be the number of frames on the stack. Or at least I thought it should, looking again at v6.x code there's no guarantee it will be the number of frames :/
Relevant V8 code:

Fortunately v8.x is more predictable: https://github.com/nodejs/node/blob/v8.0.0/deps/v8/src/objects.cc#L9976-L9984

Not sure how to fix it yet though.

Refs #233.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions