-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
cmd/cgo: jmethodID/jfieldID is not mapped to uintptr if building with the Android NDK [1.15 backport] #41432
Comments
This issue prevents Go programs from running correctly on Android 11 (random, but somewhat reliable crashing). I'm proposing we just backport to 1.15. Although this is a problem in earlier releases as well, we can require 1.15 for Android 11 support, which was just released. |
Change https://golang.org/cl/255318 mentions this issue: |
Change https://golang.org/cl/255320 mentions this issue: |
Change https://golang.org/cl/255337 mentions this issue: |
Change https://golang.org/cl/255321 mentions this issue: |
Change https://golang.org/cl/255338 mentions this issue: |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Change https://golang.org/cl/255637 mentions this issue: |
//go:notinheap type T int type U T We already correctly propagate the notinheap-ness of T to U. But we have an assertion in the typechecker that if there's no explicit //go:notinheap associated with U, then report an error. Get rid of that error so that implicit propagation is allowed. Adjust the tests so that we make sure that uses of types like U do correctly report an error when U is used in a context that might cause a Go heap allocation. Fixes #41451 Update #40954 Update #41432 Change-Id: I1692bc7cceff21ebb3f557f3748812a40887118d Reviewed-on: https://go-review.googlesource.com/c/go/+/255637 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Go Bot <gobot@golang.org>
Change https://golang.org/cl/255697 mentions this issue: |
Gentle ping. I hope this backport can make the Go 1.15.3 release. |
@eliasnaur We are looking into balancing the complexity of the changes, and hopefully will weigh in soon. I'm sorry for the delay and lack of comments, but I want you to know that we are actively discussing this. |
I've read over all the CLs and I'm happy with them. The one outstanding concern, I believe, is whether this breaks any existing cgo-using code. The tip commits are currently working their way through global testing inside Google. If they pass that without introducing new build failures, then I'm good with the cherry-pick. |
We’re going to run tests on our internal corpus of code before we proceed. That should happen by next week, but no promises :) /cc @neild |
Change https://golang.org/cl/259300 mentions this issue: |
For (my) reference, the tip commit hashes that correspond to the backport CLs are (latest on top):
|
The global testing inside Google has completed and no new issues were identified connected to the aforementioned commits. Approving for Go 1.15 per discussion in a release meeting, this is a serious issue without a workaround where we needed to balance multiple factors going into the decision. |
This comment has been minimized.
This comment has been minimized.
Change https://golang.org/cl/260878 mentions this issue: |
Closed by merging 0b80775 to release-branch.go1.15. |
…embly The second argument of StorepNoWB must be forced to escape. The current Go code does not explicitly enforce that property. By implementing in assembly, and not using go:noescape, we force the issue. Test is in CL 249761. Issue #40975. This CL is needed for CL 249917, which changes how go:notinheap works and breaks the previous StorepNoWB wasm code. I checked for other possible errors like this. This is the only go:notinheap that isn't in the runtime itself. Included test from CL 249761. Update #41432 Change-Id: I43400a806662655727c4a3baa8902b63bdc9fa57 Reviewed-on: https://go-review.googlesource.com/c/go/+/249962 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> (cherry picked from commit c060260) Reviewed-on: https://go-review.googlesource.com/c/go/+/260878 Trust: Keith Randall <khr@golang.org> Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
//go:notinheap type T int type U T We already correctly propagate the notinheap-ness of T to U. But we have an assertion in the typechecker that if there's no explicit //go:notinheap associated with U, then report an error. Get rid of that error so that implicit propagation is allowed. Adjust the tests so that we make sure that uses of types like U do correctly report an error when U is used in a context that might cause a Go heap allocation. Update #41432 Change-Id: I1692bc7cceff21ebb3f557f3748812a40887118d Reviewed-on: https://go-review.googlesource.com/c/go/+/255637 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> (cherry picked from commit 2205379) Reviewed-on: https://go-review.googlesource.com/c/go/+/255697 Trust: Keith Randall <khr@golang.org> Reviewed-by: Austin Clements <austin@google.com>
There's one more CL in the stack that needs to be submitted before this is fully resolved. Reopening to track that. |
This comment has been minimized.
This comment has been minimized.
…bject file In the rare case when a cgo type makes it into an object file, we need the go:notinheap annotation to go with it. Fixes #41432. Change-Id: Ie2ef241ee49661792e0d8c8c46c51b2fe5c6fa7c Reviewed-on: https://go-review.googlesource.com/c/go/+/259300 Trust: Keith Randall <khr@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
Closed by merging 76a2c87 to release-branch.go1.15. |
I'm afraid it did break something, see #42032. |
…embly The second argument of StorepNoWB must be forced to escape. The current Go code does not explicitly enforce that property. By implementing in assembly, and not using go:noescape, we force the issue. Test is in CL 249761. Issue golang#40975. This CL is needed for CL 249917, which changes how go:notinheap works and breaks the previous StorepNoWB wasm code. I checked for other possible errors like this. This is the only go:notinheap that isn't in the runtime itself. Included test from CL 249761. Update golang#41432 Change-Id: I43400a806662655727c4a3baa8902b63bdc9fa57 Reviewed-on: https://go-review.googlesource.com/c/go/+/249962 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> (cherry picked from commit c060260) Reviewed-on: https://go-review.googlesource.com/c/go/+/260878 Trust: Keith Randall <khr@golang.org> Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
//go:notinheap type T int type U T We already correctly propagate the notinheap-ness of T to U. But we have an assertion in the typechecker that if there's no explicit //go:notinheap associated with U, then report an error. Get rid of that error so that implicit propagation is allowed. Adjust the tests so that we make sure that uses of types like U do correctly report an error when U is used in a context that might cause a Go heap allocation. Update golang#41432 Change-Id: I1692bc7cceff21ebb3f557f3748812a40887118d Reviewed-on: https://go-review.googlesource.com/c/go/+/255637 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> (cherry picked from commit 2205379) Reviewed-on: https://go-review.googlesource.com/c/go/+/255697 Trust: Keith Randall <khr@golang.org> Reviewed-by: Austin Clements <austin@google.com>
…bject file In the rare case when a cgo type makes it into an object file, we need the go:notinheap annotation to go with it. Fixes golang#41432. Change-Id: Ie2ef241ee49661792e0d8c8c46c51b2fe5c6fa7c Reviewed-on: https://go-review.googlesource.com/c/go/+/259300 Trust: Keith Randall <khr@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
@randall77 requested issue #40954 to be considered for backport to the next 1.15 minor release.
The text was updated successfully, but these errors were encountered: