-
Notifications
You must be signed in to change notification settings - Fork 1.5k
checklocks: always allow calls to methods of atomic wrappers #8807
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
checklocks: always allow calls to methods of atomic wrappers #8807
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
@amscanne would you mind taking a look at this change? |
We can't enable checklocks on CI yet until google/gvisor#8807 is merged upstream. This was tested with private build of checklocks with this patch applied and the results were clean.
We can't enable checklocks on CI yet until google/gvisor#8807 is merged upstream. This was tested with private build of checklocks with this patch applied and the results were clean.
|
any interest in that fix? |
|
@avagin gentle ping, anything I can do to help this get merged? I would really like to re-enable checklocks on Kopia |
|
Why is it safe to call methods of atomic wrappers in this case? A few lines bellow, we check that it is not one of Load functions. Why do we want skip Load methods? Could you add tests in tools/checklocks/test/? I think it will help to understand the problem. |
|
atomic.Int32,Int64,etc. are opaque wrappers around int32,int64,... that no longer require calls to package-level functions, such as Current logic will incorrectly flag access such as: My PR simply adds a heuristic which threats all calls to methods (functions with a receiver) in the |
I know what atomic.Int32,Int64,etc mean... I was talking about this check: |
|
Overall, changes look good to me. Please, merge the second commit into the first one or write a normal commit message for it. |
6b79fe4 to
591192c
Compare
This allows the use of wrappers such as atomic.Int32 introduced in Go 1.19 without triggering the `unexpected call to atomic function`.
591192c to
1b02da0
Compare
This allows the use of wrappers such as atomic.Int32 introduced in Go 1.19 without triggering the
unexpected call to atomic function.I tried running recent checklocks on
github.com/kopia/kopiaand got a ton of such errors, which I don't think should be reported since the wrappers are there to ensure safety of atomic operations. This PR fixes the issue.