-
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
src: handle TryCatch with empty message #20708
Conversation
// This test is convoluted because it needs to trigger a callback | ||
// into JS land at just the right time when an exception is pending, | ||
// and does so by exploiting a weakness in the streams infrastructure. | ||
// I won't shed any tears if this test ever becomes invalidated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry if I'm being dense, but can you explain what you mean by this comment? I'm not sure what you mean exactly by "becomes invalidated". Does that mean "becomes unnecessary" in this context? Or maybe it means "stops working"? Or something else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary, yes, as in "no longer tests this particular condition because node's internals changed."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, literally invalidated like you wrote initially, just I was thinking about it wrong. I get it now. Thanks.
This bug needs a test case with a high goldilocks factor to trigger but the synopsis is that `v8::TryCatch::Message()` returns an empty handle when the TryCatch is declared at a time when an exception is already pending. We now recompute the message inside `node::ReportException()` and all is well again. Fixes: nodejs#8854
Landed in de4e0d7 |
This bug needs a test case with a high goldilocks factor to trigger but the synopsis is that `v8::TryCatch::Message()` returns an empty handle when the TryCatch is declared at a time when an exception is already pending. We now recompute the message inside `node::ReportException()` and all is well again. PR-URL: #20708 Fixes: #8854 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
This bug needs a test case with a high goldilocks factor to trigger but the synopsis is that `v8::TryCatch::Message()` returns an empty handle when the TryCatch is declared at a time when an exception is already pending. We now recompute the message inside `node::ReportException()` and all is well again. PR-URL: #20708 Fixes: #8854 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
This bug needs a test case with a high goldilocks factor to trigger
but the synopsis is that
v8::TryCatch::Message()
returns an emptyhandle when the TryCatch is declared at a time when an exception is
already pending.
We now recompute the message inside
node::ReportException()
andall is well again.
Fixes: #8854
CI:
https://ci.nodejs.org/job/node-test-pull-request/14850/CI:
https://ci.nodejs.org/job/node-test-pull-request/14851/CI: https://ci.nodejs.org/job/node-test-pull-request/14861/ (minor test tweaks)