-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/cgo: panic when length too large #53966
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
Conversation
This PR (HEAD: 14b65e1) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/418494 to see it. Tip: You can toggle comments from me using the |
Message from hopehook: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/418494. |
This PR (HEAD: 246db49) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/418494 to see it. Tip: You can toggle comments from me using the |
Message from Keith Randall: Patch Set 2: Code-Review+2 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/418494. |
Message from Keith Randall: Patch Set 2: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/418494. |
Message from Keith Randall: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/418494. |
Message from Gopher Robot: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/418494. |
Message from Keith Randall: Patch Set 2: Code-Review+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/418494. |
Message from hopehook: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/418494. |
Message from Gopher Robot: Patch Set 2: TryBot-Result+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/418494. |
Message from Keith Randall: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/418494. |
This PR is being closed because golang.org/cl/418494 has been abandoned. no longer needed |
@@ -1669,6 +1669,9 @@ const cBytesDef = ` | |||
// freed, such as by calling C.free (be sure to include stdlib.h | |||
// if C.free is needed). | |||
func _Cfunc_CBytes(b []byte) unsafe.Pointer { | |||
if len(b) > (1<<30) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm very confused that how did you find this 1<<30 threshold? Such an accurate value. I also have a panic problem with cgo now. I'm using an old version, I added your judgment to my code, and it still didn't solve my problem. I'm more curious which way did you find this value? @cuiweixie
Please don’t reply on this GitHub thread. Visit golang.org/cl/418494. |
Fixes #53965