[ 
https://issues.apache.org/jira/browse/FTPSERVER-241?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Fred Moore updated FTPSERVER-241:
---------------------------------

    Attachment: TestOK.java
                TestKO.java
                FDLeakBase.java

Please find attached the following repro/test harness artifacts


====> FDLeakBase.java

Launch this program with the following command line:

    java test.FDLeak <home-dir> <time-out-in-minutes> <keystore> 
<keystorepassword>

This is a program that starts an embedded FTP/S Server (M2-ish) and an embedded 
FTP/S Client that pounds it with a tight CONN+NLST+DISC loop.

In our Linux *and* Windows environment we have leaks when run on JRE newer than 
1.5.0_11.

We monitor leaks using "lsof -p <pid> | grep sock" on Linux, and using 
SysInternals processexplorer on Windows.

FWIW on Windows the leak surfaces as a growing number of process EndPoints in 
processexplorer generated dumps, which seem consistent with the symptom 
reported a while ago here: 
http://www.mail-archive.com/[email protected]/msg00131.html by 
Gerard Frederic.


====> TestKO.java

Launch this program with the following command line (you should provide a 
selfsigned keystore with related password):

    java -cp . -Djavax.net.ssl.keyStore=server.jks 
-Djavax.net.ssl.keyStorePassword=password TestKO

The program will loop over SSLServerSocket createServerSocket()/close() and 
quickly hit the "too many files open" condition very quickly (unless you run it 
on JRE 1.5.0_11).


====> TestOK.java

Launch this program with the following command line (you should provide a 
selfsigned keystore with related password):

    java -cp . -Djavax.net.ssl.keyStore=server.jks 
-Djavax.net.ssl.keyStorePassword=password TestOK

This program is functionally equivalent to TestKO, but it's rewritten to use 
just SSLSocket instead of SSLServerSocket.

This proved to be airtight in all 1.5.x 1.6.x JREs we tested.

> Socket file descriptors leak leading to "Too Many Files Open" using FTP/S
> -------------------------------------------------------------------------
>
>                 Key: FTPSERVER-241
>                 URL: https://issues.apache.org/jira/browse/FTPSERVER-241
>             Project: FtpServer
>          Issue Type: Bug
>          Components: Server
>    Affects Versions: 1.0.0-M2
>         Environment: Linux & Win + JRE newer than 1.5.0_11
>            Reporter: Fred Moore
>             Fix For: 1.0.0-RC1
>
>         Attachments: FDLeakBase.java, TestKO.java, TestOK.java
>
>
> This documented JVM bug "SSLServerSocket file descriptor leak" 
> (http://bugs.sun.com/view_bug.do?bug_id=6764972) affects FTPServer in FTP/S 
> mode and eventually leads to a "Too Many Files Open" condition on Linux (and 
> equivalent platform-dependent condition on windows).
> For workaround hints see:
> http://www.nabble.com/-security-dev-00402-:-Re:-NullPointerException-at%09sun.security.ssl.OutputRecord.writeBuffer-td20492154.html
> See also this discussion thread on FTPServer mailing list:
> http://mail-archives.apache.org/mod_mbox/mina-ftpserver-users/200812.mbox/browser

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to