bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug classpath/37983] New: trouble w/ synchronized close method in Pushb


From: robert dot dodier at gmail dot com
Subject: [Bug classpath/37983] New: trouble w/ synchronized close method in PushbackInputStream
Date: 31 Oct 2008 21:05:17 -0000

I'm working with the FTP classes in Apache commons-net 1.4.1.
I am working with classpath 0.96.1 on Buildroot Linux on a Gumstix (ARM cpu).
However I suppose the problem persists in 0.97.2 since the
PushbackInputStream.java file is identical.

When my code calls org.apache.commons.net.ftp.FTPClient.disconnect,
the program hangs. Further investigation shows that it gets stuck just
before calling in.close() in java.io.FilterInputStream.
The FilterInputStream.in variable is of the class
org.apache.commons.net.io.FromNetASCIIInputStream, which extends
java.io.PushbackInputStream without redefining the close() method.
The program doesn't enter the PushbackInputStream.close method.

PushbackInputStream.close is synchronized. Apparently there is a
deadlock: if I cut out the "synchronized" keyword, the program runs
to completion. I am guessing that there is a thread sleeping in read()
or something like that; I didn't investigate further.

Incidentally when the same program is run w/ Sun's JRE (java 1.6),
it runs to completion.

At this point I guess I am inclined to plead for trying to reduce
the use of synchronization in PushbackInputStream.
Apparently it is possible to create an implementation of it which
avoids deadlock; Sun's version seems to be evidence of that.

(This bug report is a near-verbatim copy of an email which I
sent to the classpath mailing list. Just want to make sure
the issue gets tracked.)


-- 
           Summary: trouble w/ synchronized close method in
                    PushbackInputStream
           Product: classpath
           Version: 0.96.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: classpath
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: robert dot dodier at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37983





reply via email to

[Prev in Thread] Current Thread [Next in Thread]