Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dev.boringcrypto.go1.8] crypto/internal/boring: fix finalizer-induce…
…d crashes All the finalizer-enabled C wrappers must be careful to use runtime.KeepAlive to ensure the C wrapper object (a Go object) lives through the end of every C call using state that the wrapper's finalizer would free. This CL makes the wrappers appropriately careful. The test proves that this is the bug I was chasing in a separate real program, and that the KeepAlives fix it. I did not write a test of every possible operation. Change-Id: I627007e480f16adf8396e7f796b54e5525d9ea80 Reviewed-on: https://go-review.googlesource.com/64870 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Adam Langley <agl@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-on: https://go-review.googlesource.com/65489
- Loading branch information
Showing
5 changed files
with
87 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters