-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/cgo/internal/testshared: TestStd failing since CL 522318 #62277
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
Comments
The issue is the osDefaultInheritEnv initialization. Notably even before CL 522318, changing the initialization from:
to
causes the same linker failure. Alternatively, changing the initialization to:
avoids the issue. I think there's something weird about when closures are inlined into an init function. An effect of CL 522318 was basically to treat all package-scope initialization statements as though they were in an init statement, which is why the behavior is now the same as moving the assignment into an explicit @cuonglm Do you think this could be related to the IsDeadcodeClosure logic in inline/inl.go? |
Change https://go.dev/cl/522935 mentions this issue: |
It's very likely the culprit. Probably we need to visit typecheck.Target.Inits, too? |
I don't think so. The functions in Target.Inits are in Target.Funcs too. Target.Inits is only necessary so pkginit.MakeTask can list them all in the inittask. Otherwise, they should just be normal functions. (Clearly there's some way that they're not behaving just like normal functions though.) |
Hmm, that's right. Have my laptop now, will take a look. |
@mdempsky So the problem is that after https://go-review.googlesource.com/c/go/+/492016, we need to mark hidden closures produced by inlining as un-hidden, but we're only marking closure which is converted to global during static init (That's why we see this behavior after CL 522318). Seems that we need to mark any closures as un-hidden why processing init function? |
Change https://go.dev/cl/522956 mentions this issue: |
This is a temporary workaround for issue #62277, to get the longtest builders passing again. As mentioned on the issue, the underlying issue was present even before CL 522318; it just now affects inlined closures in initialization expressions too, not just explicit init functions. This CL can and should be reverted once that issue is fixed properly. Change-Id: I612a501e131d1b5eea648aafeb1a3a3fe8fe8c83 Reviewed-on: https://go-review.googlesource.com/c/go/+/522935 Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Matthew Dempsky <mdempsky@google.com> Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Change https://go.dev/cl/523038 mentions this issue: |
Change https://go.dev/cl/523037 mentions this issue: |
Change https://go.dev/cl/523175 mentions this issue: |
This reverts CL 522935. Issue #62277 is fixed, the workaround can be dropped. Updates #62277 Change-Id: I7c69e35248942b4d4fcdd81121051cca9b098980 Reviewed-on: https://go-review.googlesource.com/c/go/+/523175 Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
The longtest builders are failing since 88cb17e (go.dev/cl/522318).
With golang.org/x/tools/cmd/bisect, I've narrowed it down to net/http/cgi's init function. Notably, disabling inlining avoids the issue too.
The text was updated successfully, but these errors were encountered: