-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
util: inspect: do not crash on an Error stack that contains a Symbol #56573
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #56573 +/- ##
==========================================
- Coverage 89.21% 89.14% -0.07%
==========================================
Files 662 662
Lines 191934 191940 +6
Branches 36945 36889 -56
==========================================
- Hits 171227 171114 -113
- Misses 13543 13672 +129
+ Partials 7164 7154 -10
|
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.
We could try to still log something more helpful than just the array with the symbol in it. Something like:
Error
[Symbol(foo)]
We just have to detect it's deviating from regular errors.
0a8293c
to
8ed3e8b
Compare
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.
Landing this as is is an improvement over the current situation (since it does not error anymore), while I believe we should push for a tad more and show the error name and message as well.
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.
After giving it another thought, I think it is best to land this as is and improve the error output later.
Error output for these cases is broken one way or the other and this is an improvement, even without the other part (which is tricky, since stack traces can have an arbitrary shape).
2e0f183
to
3523bf2
Compare
3523bf2
to
ce97b94
Compare
ce97b94
to
dd5d34c
Compare
Commit Queue failed- Loading data for nodejs/node/pull/56573 ✔ Done loading data for nodejs/node/pull/56573 ----------------------------------- PR info ------------------------------------ Title util: inspect: do not crash on an Error stack that contains a Symbol (#56573) ⚠ Could not retrieve the email or name of the PR author's from user's GitHub profile! Branch ljharb:inspect-symbol-error-stack -> nodejs:main Labels util, author ready Commits 1 - util: inspect: do not crash on an Error stack that contains a Symbol Committers 1 - Jordan Harband <[email protected]> PR-URL: https://github.com/nodejs/node/pull/56573 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Jason Zhang <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/56573 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Jason Zhang <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> -------------------------------------------------------------------------------- ⚠ Something was pushed to the Pull Request branch since the last approving review. ℹ This PR was created on Sun, 12 Jan 2025 21:06:20 GMT ✔ Approvals: 4 ✔ - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/56573#pullrequestreview-2545519208 ✔ - Luigi Pinca (@lpinca): https://github.com/nodejs/node/pull/56573#pullrequestreview-2546408229 ✔ - Jason Zhang (@jazelly): https://github.com/nodejs/node/pull/56573#pullrequestreview-2548382788 ✔ - Ruben Bridgewater (@BridgeAR) (TSC): https://github.com/nodejs/node/pull/56573#pullrequestreview-2565164187 ✔ Last GitHub CI successful ℹ Last Full PR CI on 2025-01-23T22:28:33Z: https://ci.nodejs.org/job/node-test-pull-request/64674/ - Querying data for job/node-test-pull-request/64674/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/12952622843 |
looks like i need one more stamp :-) |
See #56570 PR-URL: #56573 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Jason Zhang <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Landed in 19fabc0 |
See #56570 PR-URL: #56573 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Jason Zhang <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
See #56570 - this avoids a crash when an Error's
stack
property contains a Symbol inside an array