-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Debuggers & profilers broken on Node.js 5.2 #4297
Comments
In the profiler case, this issue manifests as failed v8 assertions (debug builds) and garbled state (release builds) when the v8 profiler is active. For example, profiling the script: require('child_process').spawn('ls'); yields:
|
I'm fine with delaying the release to get this sorted out. For what it's worth, the release is ready and tested, and was just getting ready to go out the door. I don't think those PRs need to be completely reverted, but I'll submit a PR to revert the relevant pieces so we can get debugging and profiling working again. @ofrobots can you keep us updated as you find out if this is a V8 bug or not? |
@cjihrig I'll update this issue as I make progress. |
In b799a74 and dfee4e3 the module wrapping mechanism was changed for better error reporting. However, the changes causes issues with debuggers and profilers. This commit reverts the wrapping changes. Fixes: nodejs#4297
This commit adds a regression test for debugging of single line files. Refs: nodejs#4297
@ofrobots and @matthewloring can you verify that #4298 fixed the issues you were seeing? |
I have opened a V8 issue for -1 line_offset here: https://bugs.chromium.org/p/v8/issues/detail?id=4620 |
#4298 Fixed the failed asserts inside the v8 profiler. |
In b799a74 and dfee4e3 the module wrapping mechanism was changed for better error reporting. However, the changes causes issues with debuggers and profilers. This commit reverts the wrapping changes. Fixes: #4297 PR-URL: #4298 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
In b799a74 and dfee4e3 the module wrapping mechanism was changed for better error reporting. However, the changes causes issues with debuggers and profilers. This commit reverts the wrapping changes. Fixes: #4297 PR-URL: #4298 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
In b799a74 and dfee4e3 the module wrapping mechanism was changed for better error reporting. However, the changes causes issues with debuggers and profilers. This commit reverts the wrapping changes. Fixes: #4297 PR-URL: #4298 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
In b799a74 and dfee4e3 the module wrapping mechanism was changed for better error reporting. However, the changes causes issues with debuggers and profilers. This commit reverts the wrapping changes. Fixes: nodejs#4297 PR-URL: nodejs#4298 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
This commit adds a regression test for debugging of single line files. Refs: nodejs#4297 PR-URL: nodejs#4298 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Debuggers and profilers are broken in Node.js 5.2 by the recent changes to how we wrap modules. Specifically the PRs: #4254 and #2867 are causing issues.
The following test-case works with Node.js 5.1.1, but doesn't work with Node.js 5.2:
Where foo.js is
The expected output is:
This has to do with how V8 interprets line_offset provided with the scripts. V8 ends up setting the breakpoint at the wrong line, or in this case, not setting the breakpoint at all because it looks like a breakpoint beyond the end of the file.
Profilers are broken for a similar reason as the line-ticks are going to be reported incorrectly.
I am still investigating the issue to figure out if it is a bug in V8. In the meanwhile, I would argue that #4254 and #2867 should be reverted.
@cjihrig @bnoordhuis Thoughts?
/cc @nodejs/v8
The text was updated successfully, but these errors were encountered: