Avoid holding a GlobalRef to ALPN selector#735
Merged
Conversation
Just to be as safe as possible, use a ScopedLocalRef instead of trying to manage the jstring reference manually.
The ALPN selector code used to hold a GlobalRef for the callback. This appeared to make it impossible to discard the ref since there wasn't any trigger for the AppData to be cleared as there is with the SSLHandshakeCallbacks. Instead move the management of the reference into Java and use the same SSLHandshakeCallbacks to manage calling into the ALPN selector code. This fixes google#711
1de7024 to
8f30521
Compare
Install linux-libc-dev for BoringSSL requirement to see the Linux getrandom() syscall information.
4a8f698 to
c11e1dd
Compare
This is the current default distribution for Travis-CI.
c11e1dd to
46f2e2d
Compare
|
Tested from my local build, I confirm this patch fixed the memory leak issue! 🎉 |
prbprbprb
approved these changes
Oct 24, 2019
Contributor
|
Thanks! |
|
Thanks! Could you please make a release for this? |
|
@sunng87 how did you test this? Did you build it yourself or get the binaries from some place. I would also like to test it. |
|
@LukeButters yes I built kruton's branch from my laptop and installed the snapshot jar to my local maven repo. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The ALPN selector code used to hold a GlobalRef for the callback. This
appeared to make it impossible to discard the ref since there wasn't any
trigger for the AppData to be cleared as there is with the
SSLHandshakeCallbacks. Instead move the management of the reference into
Java and use the same SSLHandshakeCallbacks to manage calling into the
ALPN selector code.
This fixes #711