[11u] RFR: 8256818: SSLSocket that is never bound or connected leaks socket resources

Alex Kashchenko akashche at redhat.com
Tue Dec 22 21:17:35 UTC 2020

On 12/15/20, Alex Kashchenko <akashche at redhat.com> wrote:
> Hi,
> Please review the backport of JDK-8256818 to 11u:
> Bug: https://bugs.openjdk.java.net/browse/JDK-8256818
> Original change: https://github.com/openjdk/jdk/commit/93b6ab56
> 11u webrev: https://cr.openjdk.java.net/~akasko/jdk11u/8256818/webrev.00/
> Patch depends on JDK-8240704 [1], that applies cleanly and is on approval.
> Patch doesn't apply cleanly: FileUtils.java in 11u doesn't contain
> recent changes from mainline and needed adjustments; libFileUtils.c
> cannot be placed into test/lib/ because 11u doesn't have JDK-8248667
> [2], it is placed under test/jdk/native_util/ instead. Testing:
> checked that changed tests pass on Linux and Windows, ran
> jtreg:jdk/sun/security/ssl/ and jck:api/javax_net/ssl .
> I also intend to backport subsequent updates to SSLSocketLeak.java
> from mainline.
> [1] https://bugs.openjdk.java.net/browse/JDK-8240704
> [2] https://bugs.openjdk.java.net/browse/JDK-8248667

JDK-8240704 was integrated, updated the webrev as a committed one on
top of current 11u-dev (patch itself is the same):


Note, the problem with leaking file descriptors in not present in
current 11u-dev - in current version closeSocket() is indeed not
called when socket was not connected, but (unlike the mainline jdk) FD
is not open at this point. The problem may appear soon, when more
TLSv1.3-related changes are backported, so it is proposed to have this
patch added to 11 to anticipate that.


More information about the jdk-updates-dev mailing list