Uh oh!
There was an error while loading. Please reload this page.
src: print exceptions from PromiseRejectCallback - #29513
Conversation
Previously, leaving the exception lying around would leave the JS engine in an invalid state, as it was not expecting exceptions to be thrown from the C++ `PromiseRejectCallback`, and lead to hard crashes under some conditions (e.g. with coverage enabled).
I am confused, when would our
I am not sure how/why Actual technical changes LGTM, I am not ✅ing simply because I did not checkout the code and reproduce what this fixed because I am not sure how to make it throw. |
addaleax
commented
Sep 9, 2019
@benjamingr If you look at test/parallel/test-ttywrap-stack.js, you’ll see that it generates unhandled rejections near the stack limit. In that case, the PromiseRejectCallback may also throw an exception, namely a stack depth exceeded exception, when it tries to run JS code. Currently, when running the test with (I’m not sure but it’s probably also possible to make the callback crash by overriding internals enough, e.g. |
benjamingr
left a comment
There was a problem hiding this comment.
Thanks for explaining how to test this Anna :]
Changes LGTM
nodejs-github-bot
commented
Sep 12, 2019
Trott
commented
Sep 12, 2019
Some minor JS lint errors to fix: |
addaleax
commented
Sep 12, 2019
Thanks, CI should be fixed now – also updated another test to account for the changes here. |
nodejs-github-bot
commented
Sep 12, 2019
Trott
commented
Sep 12, 2019
Documenting here so people don't do futile "Resume Build" runs: At least some CI failures appear to be relevant edge cases. One example: test-digitalocean-ubuntu1604_sharedlibs_container-x64-10 13:09:28 not ok 1630 parallel/test-promise-reject-callback-exception13:09:28 ---13:09:28 duration_ms: 0.26613:09:28 severity: fail13:09:28 exitcode: 113:09:28 stack: |-13:09:28 assert.js:37313:09:28 throw err;13:09:28 ^13:09:28 13:09:28 AssertionError [ERR_ASSERTION]: stdout: <>13:09:28 at Object.<anonymous> (/home/iojs/build/workspace/node-test-commit-linux-containered/test/parallel/test-promise-reject-callback-exception.js:23:3)13:09:28 at Module._compile (internal/modules/cjs/loader.js:936:30)13:09:28 at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)13:09:28 at Module.load (internal/modules/cjs/loader.js:789:32)13:09:28 at Function.Module._load (internal/modules/cjs/loader.js:702:12)13:09:28 at Function.Module.runMain (internal/modules/cjs/loader.js:999:10)13:09:28 at internal/main/run_main_module.js:17:11 {13:09:28 generatedMessage: false,13:09:28 code: 'ERR_ASSERTION',13:09:28 actual: false,13:09:28 expected: true,13:09:28 operator: '=='13:09:28 }13:09:28 ... |
addaleax
commented
Sep 13, 2019
nodejs-github-bot
commented
Sep 13, 2019
Previously, leaving the exception lying around would leave the JS engine in an invalid state, as it was not expecting exceptions to be thrown from the C++ `PromiseRejectCallback`, and lead to hard crashes under some conditions (e.g. with coverage enabled). PR-URL: #29513 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
danbev
commented
Sep 16, 2019
Landed in e095e64. |
Previously, leaving the exception lying around would leave the JS engine in an invalid state, as it was not expecting exceptions to be thrown from the C++ `PromiseRejectCallback`, and lead to hard crashes under some conditions (e.g. with coverage enabled). PR-URL: #29513 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Previously, leaving the exception lying around would leave the JS engine in an invalid state, as it was not expecting exceptions to be thrown from the C++ `PromiseRejectCallback`, and lead to hard crashes under some conditions (e.g. with coverage enabled). PR-URL: #29513 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
gengjiawen
commented
May 28, 2020
Just want to say thank you from 2020 😭 |
Previously, leaving the exception lying around would leave the JS
engine in an invalid state, as it was not expecting exceptions to
be thrown from the C++
PromiseRejectCallback, and lead to hardcrashes under some conditions (e.g. with coverage enabled).
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes