-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[checklocks] Use function line info for error messages when return instruction has no line numbers attached #12347
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
base: master
Are you sure you want to change the base?
Conversation
|
Can you squash your commits, we don't have the ability to squash and merge yet. |
6e7b714 to
dc3d29a
Compare
dc3d29a to
9a04865
Compare
…struction has no line numbers attached Resolves line information issues described by #11203 For functions that don't include explicit return statements in the Go source code, the ssa package inserts return instructions without line information attached, leading to poor error messages. Ex: -: return with unexpected locks held (locks: &({param:f}.mu) exclusively) Quick fix is to instead use the line number information of the parent function instead. FUTURE_COPYBARA_INTEGRATE_REVIEW=#12347 from uzairnawaz:return-parent-line-numbers 9a04865 PiperOrigin-RevId: 842286019
|
This patch breaks our nogo tests: https://buildkite.com/gvisor/pipeline/builds/39110#019b0462-f212-4d38-91fc-74395d051691 |
|
It appears that errors that contain no line info are currently getting discarded. But, running the tests with bazel: shows that they all pass. This same bazel test fails on this branch with the same error as above (lock not held exclusively). My guess is that attaching the line numbers causes us to now see all the errors that were previously being discarded. I can go through and annotate other occurences of this to prevent failures. Do you think this should be a separate PR or include it here? |
|
Thanks for the investigation.
It should be a separate PR. |
kakkoyun
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.
LGTM.
I attempted to fix the same issue here #11741
But this PR is way more elegant to address it.
I'll rebase my PR and check if it is still needed.
Signed-off-by: Kemal Akkoyun <[email protected]>
Resolves line information issues described by #11203
For functions that don't include explicit return statements in the Go source code, the ssa package inserts return instructions without line information attached, leading to poor error messages.
Ex: -: return with unexpected locks held (locks: &({param:f}.mu) exclusively)
Quick fix is to instead use the line number information of the parent function instead.