Skip to content

Conversation

@mmarchini
Copy link
Contributor

When the stack property of an Error object is accessed in V8, a
stringified version of the stack is generated, and then the "raw stack"
(with FP and arguments) is removed from memory. Our current inspection
code couldn't handle this because it was not checking if the raw stack
was a valid object. This commit makes that code more robust and thus
fixes inspection of error objects with stringified stacks.

@codecov-io
Copy link

codecov-io commented Sep 17, 2019

Codecov Report

Merging #291 into master will decrease coverage by 1.15%.
The diff coverage is 31.57%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #291      +/-   ##
=========================================
- Coverage   79.75%   78.6%   -1.16%     
=========================================
  Files          33      33              
  Lines        4219    4225       +6     
=========================================
- Hits         3365    3321      -44     
- Misses        854     904      +50
Impacted Files Coverage Δ
src/llv8.cc 71.11% <100%> (-3.38%) ⬇️
src/printer.cc 77.7% <7.14%> (-1.86%) ⬇️
src/llv8.h 80.95% <0%> (-19.05%) ⬇️
src/llv8-constants.h 98.48% <0%> (-1.52%) ⬇️
src/llv8-constants.cc 82.52% <0%> (-0.98%) ⬇️
src/llv8-inl.h 92.58% <0%> (-0.85%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9449d99...d5f6b2d. Read the comment docs.

src/llv8.cc Outdated
: frame_array_(frame_array) {
if (!frame_array.Check()) {
Error::PrintInDebugMode(
"JS Array is not a valid object");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think this message would be more helpful if it mentioned that the invalid JS array is an error stack?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about that, but I want to change our PrintInDebugMode to also print the function where it was called, so I decided to keep like this until I make that change.

@mmarchini mmarchini force-pushed the fix-jserror-with-stringified-stack branch 3 times, most recently from b10efec to f76d999 Compare September 25, 2019 21:07
When the `stack` property of an Error object is accessed in V8, a
stringified version of the stack is generated, and then the "raw stack"
(with FP and arguments) is removed from memory. Our current inspection
code couldn't handle this because it was not checking if the raw stack
was a valid object. This commit makes that code more robust and thus
fixes inspection of error objects with stringified stacks.
@mmarchini mmarchini force-pushed the fix-jserror-with-stringified-stack branch from f76d999 to d5f6b2d Compare September 27, 2019 18:10
mmarchini added a commit that referenced this pull request Sep 27, 2019
When the `stack` property of an Error object is accessed in V8, a
stringified version of the stack is generated, and then the "raw stack"
(with FP and arguments) is removed from memory. Our current inspection
code couldn't handle this because it was not checking if the raw stack
was a valid object. This commit makes that code more robust and thus
fixes inspection of error objects with stringified stacks.

PR-URL: #291
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@mmarchini
Copy link
Contributor Author

Landed in fb25c91

@mmarchini mmarchini closed this Sep 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants