commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marco Campelo" <marco.camp...@gmail.com>
Subject Deadlock found in Commons Net FTP
Date Wed, 03 Jan 2007 16:49:22 GMT
Hello All,

I found a deadlock in Commons Net FTP in the following situation:

1) Start transmitting a file to a FTP Server
2) Disconnect the FTP Server from the network (CopyStreamException
will be throw at this point after timeout occurs ~9 minutes)
3) Try to logout from FTP Server:

Application will stay in deadlock. I killed the application using a
kill -3 command and got the output that is available below.

I found two similar bugs already reported:

commons.net.FTPClient hangs on disconnect or logout
https://issues.apache.org/jira/browse/NET-91

Deadlock in TelnetInputStream
https://issues.apache.org/jira/browse/NET-145

I read the the bug fix for the issue "Deadlock in TelnetInputStream"
is available only in Commons Net FTP 2.0 and it requires JDK 1.5.

The problem is that our application is running on JDK 1.4 and we
wouldn't like to use a unstable version.

Is there any bug fix or workaround available for Commons Net 1.4.1?

Really appreciate your help.

BR,
Marco CampĂȘlo

Full thread dump Java HotSpot(TM) Client VM (1.4.2_08-b03 mixed mode):

"Thread-0" daemon prio=6 tid=0x001cbf18 nid=0x9 runnable [f9a7f000..f9a7fc30]
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:129)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
        - locked <0xf1845a20> (a java.io.BufferedInputStream)
        at java.io.FilterInputStream.read(FilterInputStream.java:66)
        at java.io.PushbackInputStream.read(PushbackInputStream.java:120)
        at org.apache.commons.net.io.FromNetASCIIInputStream.__read(FromNetASCIIInputStream.java:75)
        at org.apache.commons.net.io.FromNetASCIIInputStream.read(FromNetASCIIInputStream.java:170)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
        - locked <0xf1846988> (a
org.apache.commons.net.telnet.TelnetInputStream)
        at org.apache.commons.net.telnet.TelnetInputStream.__read(TelnetInputStream.java:114)
        at org.apache.commons.net.telnet.TelnetInputStream.run(TelnetInputStream.java:535)
        at java.lang.Thread.run(Thread.java:534)

"Signal Dispatcher" daemon prio=10 tid=0x000cddc0 nid=0x6 waiting on
condition [0..0]

"Finalizer" daemon prio=8 tid=0x000c7d68 nid=0x4 in Object.wait()
[fc77f000..fc77fc30]
        at java.lang.Object.wait(Native Method)
        - waiting on <0xf1f437a8> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
        - locked <0xf1f437a8> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
        at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)

"Reference Handler" daemon prio=10 tid=0x000c72e8 nid=0x3 in
Object.wait() [fe27f000..fe27fc30]
        at java.lang.Object.wait(Native Method)
        - waiting on <0xf1f43810> (a java.lang.ref.Reference$Lock)
        at java.lang.Object.wait(Object.java:429)
        at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:115)
        - locked <0xf1f43810> (a java.lang.ref.Reference$Lock)

"main" prio=5 tid=0x000356b8 nid=0x1 in Object.wait() [ffbfe000..ffbff164]
        at java.lang.Object.wait(Native Method)
        - waiting on <0xf18475f8> (a [I)
        at java.lang.Object.wait(Object.java:429)
        at org.apache.commons.net.telnet.TelnetInputStream.read(TelnetInputStream.java:339)
        - locked <0xf18475f8> (a [I)
        at org.apache.commons.net.telnet.TelnetInputStream.read(TelnetInputStream.java:466)
        at java.io.BufferedInputStream.read1(BufferedInputStream.java:220)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:277)
        - locked <0xf1849700> (a java.io.BufferedInputStream)
        at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:408)
        at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:450)
        at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:182)
        - locked <0xf184a0c0> (a java.io.InputStreamReader)
        at java.io.InputStreamReader.read(InputStreamReader.java:167)
        at java.io.BufferedReader.fill(BufferedReader.java:136)
        at java.io.BufferedReader.readLine(BufferedReader.java:299)
        - locked <0xf184a0c0> (a java.io.InputStreamReader)
        at java.io.BufferedReader.readLine(BufferedReader.java:362)
        at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:264)
        at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:460)
        at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:520)
        at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:569)
        at org.apache.commons.net.ftp.FTP.quit(FTP.java:781)
        at org.apache.commons.net.ftp.FTPClient.logout(FTPClient.java:706)
        at com.nokia.ci.nwg.util.ftp.FTPHandler.disconnect(FTPHandler.java:318)
        at com.nokia.ci.nwg.CDRTransmitter.doPerformControl(CDRTransmitter.java:71)
        at com.nokia.ci.nwg.CDRProcessor.doProccessCDRs(CDRProcessor.java:59)
        at com.nokia.ci.nwg.CDRProcessor.main(CDRProcessor.java:85)

"VM Thread" prio=5 tid=0x000c64a0 nid=0x2 runnable

"VM Periodic Task Thread" prio=10 tid=0x000d0c20 nid=0x8 waiting on condition
"Suspend Checker Thread" prio=10 tid=0x000cd488 nid=0x5 runnable

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message