-
Notifications
You must be signed in to change notification settings - Fork 11.7k
[trace-view] Fixed a problem with reference lifetimes #24196
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
| root_value_read: JSONTraceValue; | ||
| } | ||
|
|
||
| interface JSONTracePushEffect { |
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.
These were actually not necessary as they are subsumed by JSONTraceValue interface
| frame_id: number; | ||
| gas_left: number; | ||
| return_: JSONTraceRuntimeValueContent[]; | ||
| return_: JSONTraceValue[]; |
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.
Unrelated fix (spotted when looking at trace format code...)
| // Read as Buffer then view it as a Uint8Array for fzstd which expects Uint8Array | ||
| const buf = fs.readFileSync(traceFilePath); | ||
| const decompressed = await decompress(buf); | ||
| const u8 = new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength); |
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.
Another unrelated fix (for some reason the code was actually working even though TS compiler didn't like the types - now compilation is clean again)
awelc
left a comment
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.
Left some additional comments
Description
This PR implements a fix to local variable lifetime approximation algorithm which was causing an exception being thrown when variable containing the actual value (that was referenced in the subsequent frames by another variable) went out of scope due to it's lifetime ending. Lifetimes should be extended by additional events in the trace beyond reads and writes.
Additionally, extended debug printing to catch these types of errors in the unit tests rather than when actually debugging code...
Test plan
Added a new test that was failing under old implementation but passes under the new one. All tests must pass