-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
deps: backport a8f6869 from upstream V8 #22122
Conversation
The v8 embedder string in common.gypi needs to be updated as well I believe. |
Yes and V8_PATCH_LEVEL should not be updated |
1a5cb4e
to
39fda8e
Compare
@benjamn I didn't know about that script. It is a little bit outdated because |
Yeah the backport_node script is a bit outdated wrt updating embedded string. |
What's the next step here? |
cc @nodejs/v8-update |
Thanks @MylesBorins, this is useful feedback. It looks like Also, the I'm not sure why |
8724158
to
af55577
Compare
The only test failure I'm seeing (after rebasing against not ok 1844 parallel/test-tls-server-verify --- duration_ms: 0.845 severity: fail exitcode: 1 stack: |- 0 0 connecting with agent1 0 1 connecting with agent2 0 2 connecting with agent3 0 3 connecting with nocert 1 0 connecting with agent1 1 1 connecting with agent2 1 2 connecting with agent3 1 3 connecting with nocert 2 0 connecting with agent1 2 1 connecting with agent2 2 2 connecting with agent3 2 3 connecting with nocert 3 0 connecting with agent1 3 1 connecting with agent2 3 2 connecting with agent3 3 3 connecting with nocert 4 0 connecting with agent1 4 1 connecting with agent2 4 2 connecting with agent3 4 3 connecting with nocert 5 0 connecting with agent1 5 1 connecting with agent2 5 2 connecting with agent3 5 3 connecting with agent4 5 4 connecting with nocert 0 Running 'Do not request certs. Everyone is unauthorized.' 0 - unauthed connection: null 0 - unauthed connection: null 0 - unauthed connection: null 0 0 * unauthed 0 1 * unauthed 0 2 * unauthed 0 - unauthed connection: null 0 3 * unauthed 1 Running 'Allow both authed and unauthed connections with CA1' 1 - authed connection: agent1 1 - unauthed connection: DEPTH_ZERO_SELF_SIGNED_CERT 1 1 * unauthed 1 0 * authed 1 - unauthed connection: UNABLE_TO_VERIFY_LEAF_SIGNATURE 1 2 * unauthed 1 - unauthed connection: UNABLE_TO_GET_ISSUER_CERT 1 3 * unauthed 2 Running 'Do not request certs at connection. Do that later' 2 - connected, renegotiating 2 - authed connection: agent1 2 0 * authed 2 - unauthed connection: null 2 1 * unauthed 2 - unauthed connection: null 2 2 * unauthed 2 - unauthed connection: null 2 3 * unauthed 3 Running 'Allow only authed connections with CA1' 3 - authed connection: agent1 3 0 * authed 4 Running 'Allow only authed connections with CA1 and CA2' 4 - authed connection: agent1 4 0 * authed 4 - authed connection: agent3 4 2 * authed 5 Running 'Allow only certs signed by CA2 but not in the CRL' assert.js:84 throw new AssertionError(obj); ^ |
Lots of failures, please dig in to the results |
test-trace-event-promises.js failures will be fixed by #22200. |
Lot's of V8 Failures as well https://ci.nodejs.org/job/node-test-commit-v8-linux/1586/testReport/ V8-Ci on master for comparison: https://ci.nodejs.org/job/node-test-commit-v8-linux/1587/ |
Lots of test suite failures, but not many different tests failing. As far as I can tell, all the Regarding the V8 failures, those same tests are passing on V8 |
af55577
to
115f04f
Compare
Just rebased to include #22200 (d7e1847). I have not done anything to address the V8 failures, yet. https://ci.nodejs.org/job/node-test-commit-linux/nodes=ubuntu1604-32/20546/ seems to be from the previous test run (old revision, |
@benjamingr our CI will auto rebase against master when you run the job 😄 |
I think I've tracked down the cause of the V8 test failures, and I've submitted a possible solution as another V8 change request: https://chromium-review.googlesource.com/c/v8/v8/+/1168449 I could make those changes locally, though it might be better to get them landed in V8 first? |
115f04f
to
ed69b68
Compare
Ok, I've provisionally cherry-picked my local commit to fix the V8 test failures, even though it has not landed upstream yet (I submitted it for review just last night). If the tests pass here, that would be a good sign that it's a safe and useful change. I will keep working on https://chromium-review.googlesource.com/c/v8/v8/+/1168449 with @hashseed and anyone else who's interested. |
It looks like my follow-up fix may not be necessary for recent versions of V8 (according to @hashseed here), but is definitely necessary for Node's current version of V8, so I'm unsure how to proceed. Should we land an unnecessary change upstream just so Node's copy of V8 does not diverge from upstream, or should we just make the change locally, as I did above? Has this kind of situation ever happened before, @MylesBorins? |
It looks like SetDebugDelegate(debug::DebugDelegate* delegate, bool pass_ownership) was simplified to just SetDebugDelegate(debug::DebugDelegate* delegate) in v8/v8@37dcd83, but the extra `pass_ownership` parameter is still there in the current version of `node/deps/v8`. I should be able to fix those tests by passing `false` for `pass_ownership`. Also, the `DebugDelegate::BreakProgramRequested` method lost a parameter in v8/v8@e404670, but it's not a parameter I was using in my test, so there shouldn't be any harm in adding the `exec_state` parameter back to `BreakProgramRequested` (and continuing to ignore it). I'm not sure why `ninja -C out/Debug` didn't catch these errors before. Maybe they only show up in release builds?
A simpler version of the changes I proposed upstream in this V8 change request: https://chromium-review.googlesource.com/c/v8/v8/+/1168449 In this version, Debug::RestoreDebug never attempts to enter a new DebugScope, but merely reuses the previous one, if we're returning to a thread that was previously in a DebugScope. If the thread was not previously in a DebugScope, I believe it does not need to have any debugging state restored with ClearOneShot and PrepareStep. The tests from https://chromium-review.googlesource.com/c/v8/v8/+/833260 still pass, and the failing V8-CI tests are now passing locally for me: https://ci.nodejs.org/job/node-test-commit-v8-linux/1601/
77567b7
to
8d66ed7
Compare
I rebased the PR on top of master. |
Landed in bb35752 |
Original commit message: [debug] Fully implement Debug::ArchiveDebug and Debug::RestoreDebug. I have a project that embeds V8 and uses a single `Isolate` from multiple threads. The program runs just fine, but sometimes the inspector doesn't stop on the correct line after stepping over a statement that switches threads behind the scenes, even though the original thread is restored by the time the next statement is executed. After some digging, I discovered that the `Debug::ArchiveDebug` and `Debug::RestoreDebug` methods, which should be responsible for saving/restoring this `ThreadLocal` information when switching threads, currently don't do anything. This commit implements those methods using MemCopy, in the style of other Archive/Restore methods in the V8 codebase. Related: https://groups.google.com/forum/#!topic/v8-users/_Qf2rwljRk8 R=yangguo@chromium.org,jgruber@chromium.org CC=info@bnoordhuis.nl Bug: v8:7230 Change-Id: Id517c873eb81cd53f7216c7efd441b956cf7f943 Reviewed-on: https://chromium-review.googlesource.com/833260 Commit-Queue: Yang Guo <yangguo@chromium.org> Reviewed-by: Yang Guo <yangguo@chromium.org> Cr-Commit-Position: refs/heads/master@{#54902} Refs: v8/v8@a8f6869 Fix build errors by matching older V8 APIs used by Node. It looks like SetDebugDelegate(debug::DebugDelegate* delegate, bool pass_ownership) was simplified to just SetDebugDelegate(debug::DebugDelegate* delegate) in v8/v8@37dcd83, but the extra `pass_ownership` parameter is still there in the current version of `node/deps/v8`. I should be able to fix those tests by passing `false` for `pass_ownership`. Also, the `DebugDelegate::BreakProgramRequested` method lost a parameter in v8/v8@e404670, but it's not a parameter I was using in my test, so there shouldn't be any harm in adding the `exec_state` parameter back to `BreakProgramRequested` (and continuing to ignore it). Skip restoring debug state unless thread previously in DebugScope. A simpler version of the changes I proposed upstream in this V8 change request: https://chromium-review.googlesource.com/c/v8/v8/+/1168449 In this version, Debug::RestoreDebug never attempts to enter a new DebugScope, but merely reuses the previous one, if we're returning to a thread that was previously in a DebugScope. If the thread was not previously in a DebugScope, I believe it does not need to have any debugging state restored with ClearOneShot and PrepareStep. The tests from https://chromium-review.googlesource.com/c/v8/v8/+/833260 still pass, and the failing V8-CI tests are now passing locally for me. PR-URL: #22122 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
Original commit message: [debug] Fully implement Debug::ArchiveDebug and Debug::RestoreDebug. I have a project that embeds V8 and uses a single `Isolate` from multiple threads. The program runs just fine, but sometimes the inspector doesn't stop on the correct line after stepping over a statement that switches threads behind the scenes, even though the original thread is restored by the time the next statement is executed. After some digging, I discovered that the `Debug::ArchiveDebug` and `Debug::RestoreDebug` methods, which should be responsible for saving/restoring this `ThreadLocal` information when switching threads, currently don't do anything. This commit implements those methods using MemCopy, in the style of other Archive/Restore methods in the V8 codebase. Related: https://groups.google.com/forum/#!topic/v8-users/_Qf2rwljRk8 R=yangguo@chromium.org,jgruber@chromium.org CC=info@bnoordhuis.nl Bug: v8:7230 Change-Id: Id517c873eb81cd53f7216c7efd441b956cf7f943 Reviewed-on: https://chromium-review.googlesource.com/833260 Commit-Queue: Yang Guo <yangguo@chromium.org> Reviewed-by: Yang Guo <yangguo@chromium.org> Cr-Commit-Position: refs/heads/master@{#54902} Refs: v8/v8@a8f6869 Fix build errors by matching older V8 APIs used by Node. It looks like SetDebugDelegate(debug::DebugDelegate* delegate, bool pass_ownership) was simplified to just SetDebugDelegate(debug::DebugDelegate* delegate) in v8/v8@37dcd83, but the extra `pass_ownership` parameter is still there in the current version of `node/deps/v8`. I should be able to fix those tests by passing `false` for `pass_ownership`. Also, the `DebugDelegate::BreakProgramRequested` method lost a parameter in v8/v8@e404670, but it's not a parameter I was using in my test, so there shouldn't be any harm in adding the `exec_state` parameter back to `BreakProgramRequested` (and continuing to ignore it). Skip restoring debug state unless thread previously in DebugScope. A simpler version of the changes I proposed upstream in this V8 change request: https://chromium-review.googlesource.com/c/v8/v8/+/1168449 In this version, Debug::RestoreDebug never attempts to enter a new DebugScope, but merely reuses the previous one, if we're returning to a thread that was previously in a DebugScope. If the thread was not previously in a DebugScope, I believe it does not need to have any debugging state restored with ClearOneShot and PrepareStep. The tests from https://chromium-review.googlesource.com/c/v8/v8/+/833260 still pass, and the failing V8-CI tests are now passing locally for me. PR-URL: #22122 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
Original commit message: [debug] Fully implement Debug::ArchiveDebug and Debug::RestoreDebug. I have a project that embeds V8 and uses a single `Isolate` from multiple threads. The program runs just fine, but sometimes the inspector doesn't stop on the correct line after stepping over a statement that switches threads behind the scenes, even though the original thread is restored by the time the next statement is executed. After some digging, I discovered that the `Debug::ArchiveDebug` and `Debug::RestoreDebug` methods, which should be responsible for saving/restoring this `ThreadLocal` information when switching threads, currently don't do anything. This commit implements those methods using MemCopy, in the style of other Archive/Restore methods in the V8 codebase. Related: https://groups.google.com/forum/#!topic/v8-users/_Qf2rwljRk8 R=yangguo@chromium.org,jgruber@chromium.org CC=info@bnoordhuis.nl Bug: v8:7230 Change-Id: Id517c873eb81cd53f7216c7efd441b956cf7f943 Reviewed-on: https://chromium-review.googlesource.com/833260 Commit-Queue: Yang Guo <yangguo@chromium.org> Reviewed-by: Yang Guo <yangguo@chromium.org> Cr-Commit-Position: refs/heads/master@{#54902} Refs: v8/v8@a8f6869 Fix build errors by matching older V8 APIs used by Node. It looks like SetDebugDelegate(debug::DebugDelegate* delegate, bool pass_ownership) was simplified to just SetDebugDelegate(debug::DebugDelegate* delegate) in v8/v8@37dcd83, but the extra `pass_ownership` parameter is still there in the current version of `node/deps/v8`. I should be able to fix those tests by passing `false` for `pass_ownership`. Also, the `DebugDelegate::BreakProgramRequested` method lost a parameter in v8/v8@e404670, but it's not a parameter I was using in my test, so there shouldn't be any harm in adding the `exec_state` parameter back to `BreakProgramRequested` (and continuing to ignore it). Skip restoring debug state unless thread previously in DebugScope. A simpler version of the changes I proposed upstream in this V8 change request: https://chromium-review.googlesource.com/c/v8/v8/+/1168449 In this version, Debug::RestoreDebug never attempts to enter a new DebugScope, but merely reuses the previous one, if we're returning to a thread that was previously in a DebugScope. If the thread was not previously in a DebugScope, I believe it does not need to have any debugging state restored with ClearOneShot and PrepareStep. The tests from https://chromium-review.googlesource.com/c/v8/v8/+/833260 still pass, and the failing V8-CI tests are now passing locally for me. PR-URL: #22122 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
The upstream V8 commit a8f68691 was originally cherry-picked onto nodejs/node master as commit bb35752, then backported to v10.x-staging and released in Node.js v10.10.0 as 5e9ed6d. This commit cherry-picks that commit back to the v8.x-staging branch. Refs: v8/v8@a8f6869 Refs: nodejs#22122 Refs: nodejs@bb35752 Refs: nodejs@5e9ed6d Original commit message: [debug] Fully implement Debug::ArchiveDebug and Debug::RestoreDebug. I have a project that embeds V8 and uses a single `Isolate` from multiple threads. The program runs just fine, but sometimes the inspector doesn't stop on the correct line after stepping over a statement that switches threads behind the scenes, even though the original thread is restored by the time the next statement is executed. After some digging, I discovered that the `Debug::ArchiveDebug` and `Debug::RestoreDebug` methods, which should be responsible for saving/restoring this `ThreadLocal` information when switching threads, currently don't do anything. This commit implements those methods using MemCopy, in the style of other Archive/Restore methods in the V8 codebase. Related: https://groups.google.com/forum/#!topic/v8-users/_Qf2rwljRk8 R=yangguo@chromium.org,jgruber@chromium.org CC=info@bnoordhuis.nl Bug: v8:7230 Change-Id: Id517c873eb81cd53f7216c7efd441b956cf7f943 Reviewed-on: https://chromium-review.googlesource.com/833260 Commit-Queue: Yang Guo <yangguo@chromium.org> Reviewed-by: Yang Guo <yangguo@chromium.org> Cr-Commit-Position: refs/heads/master@{nodejs#54902} PR-URL: nodejs#22714 ADDITIONAL CHANGES: Support optional boolean argument to DisableBreak constructor. This allows a stack-allocated DisableBreak object to re-enable breakpoints temporarily, rather than always disabling them. This functionality anticipates an upstream change that will be introduced in V8 6.7.176: v8/v8@cc9736a More immediately, these changes should fix a cctest compile error in this backport PR: nodejs#22714 (comment)
The upstream V8 commit a8f68691 was originally cherry-picked onto nodejs/node master as commit bb35752, then backported to v10.x-staging and released in Node.js v10.10.0 as 5e9ed6d. This commit cherry-picks that commit back to the v8.x-staging branch. Additionally this commit supports optional boolean argument to DisableBreak constructor. This allows a stack-allocated DisableBreak object to re-enable breakpoints temporarily, rather than always disabling them. This functionality anticipates an upstream change that will be introduced in V8 6.7.176: v8/v8@cc9736a Original commit message: [debug] Fully implement Debug::ArchiveDebug and Debug::RestoreDebug. I have a project that embeds V8 and uses a single `Isolate` from multiple threads. The program runs just fine, but sometimes the inspector doesn't stop on the correct line after stepping over a statement that switches threads behind the scenes, even though the original thread is restored by the time the next statement is executed. After some digging, I discovered that the `Debug::ArchiveDebug` and `Debug::RestoreDebug` methods, which should be responsible for saving/restoring this `ThreadLocal` information when switching threads, currently don't do anything. This commit implements those methods using MemCopy, in the style of other Archive/Restore methods in the V8 codebase. Related: https://groups.google.com/forum/#!topic/v8-users/_Qf2rwljRk8 R=yangguo@chromium.org,jgruber@chromium.org CC=info@bnoordhuis.nl Bug: v8:7230 Change-Id: Id517c873eb81cd53f7216c7efd441b956cf7f943 Reviewed-on: https://chromium-review.googlesource.com/833260 Commit-Queue: Yang Guo <yangguo@chromium.org> Reviewed-by: Yang Guo <yangguo@chromium.org> Cr-Commit-Position: refs/heads/master@{#54902} PR-URL: #22714 Refs: v8/v8@a8f6869 Refs: #22122 Refs: bb35752 Refs: 5e9ed6d Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Yang Guo <yangguo@chromium.org>
Refs: v8/v8@a8f6869
Original commit message:
Once this PR is approved/merged, I will also submit a PR to backport it to v8.x-staging so that it can be included in Node 8.12.0, if all goes smoothly.
Thanks again to @hashseed for working with me on the V8 side.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesdocumentation is changed or added(implementation detail)