-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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: enable #cgo noescape/nocallback #66879
Conversation
This PR (HEAD: cdc4e9c) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/579955. Important tips:
|
Message from Gopher Robot: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from DeJiang Zhu (doujiang): Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from xie cui: Patch Set 1: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from Gopher Robot: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from Gopher Robot: Patch Set 1: TryBot-Result+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from Russ Cox: Patch Set 1: Hold+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
This reverts commit 607e020. Reason for revert: Go1.22 is released. It's aggressive to introdcue #cgo noescape/nocallback in Go1.22, as in golang#63739 And it won't be a problem again while upgrading from Go1.22 to Go1.23. fix golang#56378 Signed-off-by: doujiang24 <doujiang24@gmail.com>
Signed-off-by: doujiang24 <doujiang24@gmail.com>
Signed-off-by: doujiang24 <doujiang24@gmail.com>
cdc4e9c
to
34903bf
Compare
This PR (HEAD: 34903bf) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/579955. Important tips:
|
Message from DeJiang Zhu (doujiang): Patch Set 3: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from xie cui: Patch Set 3: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from Gopher Robot: Patch Set 3: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from Gopher Robot: Patch Set 3: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from Gopher Robot: Patch Set 3: TryBot-Result-1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from DeJiang Zhu (doujiang): Patch Set 3: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from xie cui: Patch Set 3: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from xie cui: Patch Set 3: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from xie cui: Patch Set 3: Commit-Queue+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from xie cui: Patch Set 3: -Commit-Queue Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from Go LUCI: Patch Set 3: CV cannot start a Run for Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from Go LUCI: Patch Set 3: LUCI-TryBot-Result-1 Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from xie cui: Patch Set 3: -Run-TryBot Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from xie cui: Patch Set 3: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from xie cui: Patch Set 4: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from Ian Lance Taylor: Patch Set 4: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from DeJiang Zhu (doujiang): Patch Set 6: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from Dominik Honnef: Patch Set 6: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from DeJiang Zhu (doujiang): Patch Set 6: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from Ian Lance Taylor: Patch Set 6: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Signed-off-by: doujiang24 <doujiang24@gmail.com>
This PR (HEAD: 8dc86e0) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/579955. Important tips:
|
Message from DeJiang Zhu (doujiang): Patch Set 7: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from Dominik Honnef: Patch Set 7: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from DeJiang Zhu (doujiang): Patch Set 7: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from Ian Lance Taylor: Patch Set 7: (3 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Signed-off-by: doujiang24 <doujiang24@gmail.com>
This PR (HEAD: 766ea1b) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/579955. Important tips:
|
Message from DeJiang Zhu (doujiang): Patch Set 8: (3 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from Ian Lance Taylor: Patch Set 8: (5 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Signed-off-by: doujiang24 <doujiang24@gmail.com>
This PR (HEAD: 42fcc50) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/579955. Important tips:
|
Message from DeJiang Zhu (doujiang): Patch Set 8: (5 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from Ian Lance Taylor: Patch Set 9: Commit-Queue+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from Go LUCI: Patch Set 9: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2024-08-16T18:44:18Z","revision":"edc82423a56d035634101ebdd15203f76df5a005"} Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from Ian Lance Taylor: Patch Set 9: -Commit-Queue Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from Go LUCI: Patch Set 9: This CL has passed the run Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from Go LUCI: Patch Set 9: LUCI-TryBot-Result+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from Ian Lance Taylor: Patch Set 9: Auto-Submit+1 Code-Review+2 Commit-Queue+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from Go LUCI: Patch Set 9: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2024-08-16T19:11:42Z","revision":"edc82423a56d035634101ebdd15203f76df5a005"} Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from Ian Lance Taylor: Patch Set 9: -Commit-Queue Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
Message from Go LUCI: Patch Set 9: This CL has passed the run Please don’t reply on this GitHub thread. Visit golang.org/cl/579955. |
In Go 1.22 we added code to the go/build package to ignore #cgo noescape and nocallback directives. That permits us to enable these directives in Go 1.24. Also, this fixed a Bug in CL 497837: After retiring _Cgo_use for parameters, the compiler will treat the parameters, start from the second, as non-alive. Then, they will be marked as scalar in stackmap, which means the pointer won't be copied correctly in copystack. Fixes #56378. Fixes #63739. Change-Id: I46e773240f8a467c3c4ba201dc5b4ee473cf6e3e GitHub-Last-Rev: 42fcc50 GitHub-Pull-Request: #66879 Reviewed-on: https://go-review.googlesource.com/c/go/+/579955 Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Carlos Amedee <carlos@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This PR is being closed because golang.org/cl/579955 has been merged. |
In Go 1.22 we added code to the go/build package to ignore #cgo noescape
and nocallback directives. That permits us to enable these directives in Go 1.24.
Also, this fixed a Bug in CL 497837:
After retiring _Cgo_use for parameters, the compiler will treat the
parameters, start from the second, as non-alive. Then, they will be marked
as scalar in stackmap, which means the pointer won't be copied correctly
in copystack.
Fixes #56378.
Fixes #63739.