Skip to content

Breaking change in V8 for Error.prepareStackTrace #21574

Description

@schuay

The proposed change (not yet landed): https://crrev.com/c/1113438
And the original related node issue: #21270

This changes formatting behavior for stack traces to use the Error.prepareStackTrace function set in the original creation context of the error object, instead of the current context.

The following node tests start failing:

parallel/test-repl-pretty-custom-stack
parallel/test-repl-pretty-stack
parallel/test-repl-underscore

Failures look similar to:

    AssertionError [ERR_ASSERTION]: Input A expected to strictly equal input B:
    + expected - actual
    
    - '    at repl:1:18'
    + 'Error: foo'
        at Immediate.setImmediate (/b/swarming/w/ir/cache/builder/v8_node_linux64_rel/node.js/test/parallel/test-repl-underscore.js:200:16)
        at runCallback (timers.js:695:18)
        at tryOnImmediate (timers.js:666:5)
        at processImmediate (timers.js:648:5)
        at process.topLevelDomainCallback (domain.js:121:23)

Full test run logs: https://logs.chromium.org/v/?s=v8%2Fbuildbucket%2Fcr-buildbucket.appspot.com%2F8942571998063714288%2F%2B%2Fsteps%2Frun_tests%2F0%2Fstdout

Presumably this happens because custom stack formatting is set in one context but not another.

Can this reasonably be fixed in node?

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions