Repository navigation
Confusing stack trace when using --abort-on-uncaught-exception #21988
Description
Activity
- addedv8 engineIssues and PRs related to the V8 dependency.Issues and PRs related to the V8 dependency.post-mortemIssues and PRs related to Node.js postmortem diagnostics.Issues and PRs related to Node.js postmortem diagnostics.
on Jul 26, 2018 This is a regression, introduced somewhere in v8.2.1...v8.3.0 – most likely #14574 (V8 5.8 → V8 6.0).
/cc @nodejs/v8
Reacted by mary marchini and Benjamin GruenbaumDoes that mean that since V8 6 (about a year) stack traces were broken with
--abort-on-uncaught-exception? Would be interesting to see how many people actually use the flag and how.Would be interesting to see how many people actually use the flag and how.
When aborting on uncaught errors, I usually don't look only at the stack trace that is outputted by V8. Instead I usually rely on getting the call stack from the resulting core dump. It is still confusing if they're inconsistent with each other.
I've also not used node > 6.x in production yet.
Reacted by Benjamin Gruenbaum and Anna HenningsenNote that Windows is not affected.
Bisecting v8.2.1...v8.3.0 I got 44ad55d (#14574) as the first bad commit.
Interesting, with
./node --always-opt --abort-on-uncaught-exception -e "throw new Error()"I got the correct output:$ ./node --always-opt --abort-on-uncaught-exception -e "throw new Error()" Uncaught Error FROM [eval]:1:1 Script.runInThisContext (vm.js:88:20) Object.runInThisContext (vm.js:285:38) Object.<anonymous> ([eval]-wrapper:6:22) Module._compile (internal/modules/cjs/loader.js:689:30) evalScript (internal/bootstrap/node.js:563:27) startup (internal/bootstrap/node.js:1:1) bootstrapNodeJSCore (internal/bootstrap/node.js:596:3) [1] 53989 illegal hardware instruction ./node --always-opt --abort-on-uncaught-exception -e "throw new Error()"
Seems to be a problem with interpreted functions and
AbstractCode::SourcePosition, because theByteArraypassed toSourcePositionTableIteratorin this function haslength()= 0. @nodejs/v8 any thoughts on this? Seems to be a V8 bug.- added 2 commits that reference this issue
on Sep 10, 2018 4 remaining items
@misterdjules @mmarchini I opened #22910 to backport to v10.x
Reacted by Julien GilliReacted by Julien Gilli- added a commit that references this issue
on Oct 2, 2018 Should this be closed?
IIRC, yes (we can reopen otherwise).
When using
--abort-on-uncaught-exception, all lines in the stack trace appear as1:1instead of the actual line and column numbers.If we run the above script, we'll get:
But if we run it with
--abort-on-uncaught-exception, the result is quite different (for example,main (./e.js:1:1)instead ofmain (./e.js:2:9)):At first I thought it was a V8 bug, but running the same script with d8 gives the expected result:
Maybe it's something related to our modules system? cc @nodejs/modules