-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Confusing stack trace when using --abort-on-uncaught-exception #21988
Comments
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 |
Does that mean that since V8 6 (about a year) stack traces were broken with |
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. |
Note 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()"
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 |
Original commit message: [Isolate] Fix Isolate::PrintCurrentStackTrace for interpreted frames Previously we were getting the code object from the stack, so printed incorrect position details for interpreted frames. BUG=v8:7916 Change-Id: I2f87584117d88b7db3f3b9bdbfe793c4d3e33fe9 Reviewed-on: https://chromium-review.googlesource.com/1126313 Reviewed-by: Toon Verwaest <[email protected]> Commit-Queue: Ross McIlroy <[email protected]> Cr-Commit-Position: refs/heads/master@{nodejs#54253} Refs: v8/v8@9a23bdd Fixes: nodejs#21988
Original commit message: [Isolate] Fix Isolate::PrintCurrentStackTrace for interpreted frames Previously we were getting the code object from the stack, so printed incorrect position details for interpreted frames. BUG=v8:7916 Change-Id: I2f87584117d88b7db3f3b9bdbfe793c4d3e33fe9 Reviewed-on: https://chromium-review.googlesource.com/1126313 Reviewed-by: Toon Verwaest <[email protected]> Commit-Queue: Ross McIlroy <[email protected]> Cr-Commit-Position: refs/heads/master@{nodejs#54253} Refs: v8/v8@9a23bdd Fixes: nodejs#21988
Ping @nodejs/v8 – any ideas here? |
The issue was fixed on V8 6.9, we just need to backport the fixes for v10.x and v8.x (v6.x is not affected). |
@mmarchini Do you know what the earliest 10.x version to which the fix will be back ported? Is there a PR to which we can subscribe? |
Not yet. I was talkting to @Drieger and he'll open a backport PR later today, so I'm guessing we'll have this fixed in the next v10.x release. |
@misterdjules @mmarchini I opened #22910 to backport to v10.x |
Original commit message: [Isolate] Fix Isolate::PrintCurrentStackTrace for interpreted frames Previously we were getting the code object from the stack, so printed incorrect position details for interpreted frames. BUG=v8:7916 Change-Id: I2f87584117d88b7db3f3b9bdbfe793c4d3e33fe9 Reviewed-on: https://chromium-review.googlesource.com/1126313 Reviewed-by: Toon Verwaest <[email protected]> Commit-Queue: Ross McIlroy <[email protected]> Cr-Commit-Position: refs/heads/master@{nodejs#54253} Refs: nodejs#21988
Original commit message: [Isolate] Fix Isolate::PrintCurrentStackTrace for interpreted frames Previously we were getting the code object from the stack, so printed incorrect position details for interpreted frames. BUG=v8:7916 Change-Id: I2f87584117d88b7db3f3b9bdbfe793c4d3e33fe9 Reviewed-on: https://chromium-review.googlesource.com/1126313 Reviewed-by: Toon Verwaest <[email protected]> Commit-Queue: Ross McIlroy <[email protected]> Cr-Commit-Position: refs/heads/master@{#54253} Refs: v8/v8@9a23bdd Refs: #21988 PR-URL: #22910 Reviewed-By: Matheus Marchini <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
Original commit message: [Isolate] Fix Isolate::PrintCurrentStackTrace for interpreted frames Previously we were getting the code object from the stack, so printed incorrect position details for interpreted frames. BUG=v8:7916 Change-Id: I2f87584117d88b7db3f3b9bdbfe793c4d3e33fe9 Reviewed-on: https://chromium-review.googlesource.com/1126313 Reviewed-by: Toon Verwaest <[email protected]> Commit-Queue: Ross McIlroy <[email protected]> Cr-Commit-Position: refs/heads/master@{#54253} Refs: v8/v8@9a23bdd Refs: #21988 PR-URL: #22910 Reviewed-By: Matheus Marchini <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
Original commit message: [Isolate] Fix Isolate::PrintCurrentStackTrace for interpreted frames Previously we were getting the code object from the stack, so printed incorrect position details for interpreted frames. BUG=v8:7916 Change-Id: I2f87584117d88b7db3f3b9bdbfe793c4d3e33fe9 Reviewed-on: https://chromium-review.googlesource.com/1126313 Reviewed-by: Toon Verwaest <[email protected]> Commit-Queue: Ross McIlroy <[email protected]> Cr-Commit-Position: refs/heads/master@{#54253} Refs: v8/v8@9a23bdd Fixes: #21988 PR-URL: #22418 Refs: #22338 Reviewed-By: Matheus Marchini <[email protected]> Reviewed-By: Ujjwal Sharma <[email protected]> Reviewed-By: Richard Lau <[email protected]>
Should this be closed? |
IIRC, yes (we can reopen otherwise). |
When using
--abort-on-uncaught-exception
, all lines in the stack trace appear as1:1
instead 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
The text was updated successfully, but these errors were encountered: