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
"TestKVWithEmptyValue" of etcd-io/etcd fails with master go #45685
Comments
@laboger Can you please give some pointers? |
@Rajalakshmi-Girish Can you provide directions on building etcd? Also information on when this last passed. |
Bisecting this failure, it started with 9a555fc |
Note, I applied the fix from b98ce3b to avoid another failure masking this bug. |
This also fails with
and etcd commit |
Could you provide more information about why this is a Go bug, instead of a bug of etcd? Thanks. |
I thought so because it passed with stable go version and not with the master go. |
We built it using https://github.com/etcd-io/etcd/blob/master/build.sh |
That doesn't imply it is a Go bug. The code might depend on buggy or internal behavior of earlier versions of Go, which may change. |
Hi Cherry, Paul narrowed this down to this commit.
This test also failed due to the bug that was later fix by this commit, so he had to backport that to avoid the error it fixes in both cases: So I think that it is likely to be a Golang issue due to that commit. There are multiple layers of closures as it tries to get the key. @Rajalakshmi-Girish told me that there were also some failures on x86 when building and testing etcd with Go master that didn't happen in Go 1.16, but not exactly the same. |
That commit enables inlining functions that include closures, which may result in changes of PCs if the test compares function PCs. Comparing function PCs are never supposed to work, as commented in #45697 (comment) . If the test indeed compares function PCs, that Go commit is working as intended and the test needs to be adjusted. Thanks. |
Here is the function from etcd/client/v3/utils.go that is returning a different value than it was before, which causes the test to fail starting at the commit noted earlier in this issue:
This is not exactly comparing function PCs, but it seems like this is something that might get different results if the function was inlined because then the FuncForPC would not be the same depending on whether it was inlined or not. If you agree, then @Rajalakshmi-Girish can open an issue for etcd and we can close this. A related question: if comparing function PCs is not supposed to work, isn't that something the compiler should flag as incorrect syntax? |
Would be nice if we could. I'm not sure how you would do that. You'd have to know that a |
I agree this is not exactly comparing function PCs. But comparing function names is no better, especially for non-top-level functions. The naming scheme of closures is not documented, may vary in different toolchains, and subject to change (even without inlining). (Comparing names of top-level functions seems reasonable.) |
@laboger I have raised an issue for etcd etcd-io/etcd#12993 |
It is already a compile-time error for comparing |
Thanks all for the investigation. I think we can close this. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
No
What operating system and processor architecture are you using (
go env
)?Linux ppc64le
What did you do?
go test go.etcd.io/etcd/tests/v3/integration
Ran integration tests of etcd-io/etcd
What did you expect to see?
Should Pass successfully.
NOTE: It passed with the stable release.
What did you see instead?
Following Error for TestKVWithEmptyValue:
Please find the attached log
etcd.log
The text was updated successfully, but these errors were encountered: