public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* libgcj/1238: Resource revocation (close) does not cancel PipedInputStream reader
@ 2000-12-20 12:22 jsturm
  0 siblings, 0 replies; only message in thread
From: jsturm @ 2000-12-20 12:22 UTC (permalink / raw)
  To: java-gnats

>Number:         1238
>Category:       libgcj
>Synopsis:       Resource revocation (close) does not cancel PipedInputStream reader
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    tromey
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 20 12:18:09 PST 2000
>Closed-Date:    Thu Apr 20 22:37:14 PDT 2000
>Last-Modified:  Thu Apr 20 22:40:00 PDT 2000
>Originator:     Jeff Sturm
>Release:        CVS
>Organization:
>Environment:
Any	
>Description:
Some time ago on java-dicuss we talked about I/O cancellation
via resource revocation vs. thread interruption.  Sun is
deprecating the latter technique it seems, and the former
may have to be used for portability.

In libgcj thread interruption generally works but is platform
dependent (e.g. socket reads will NOT be interruptable on
Win32).  I think it was informally decided that we should
support both techniques if possible.

I put together the attached test program to demonstrate that
a PipedInputStream does not return from read() when the stream
is closed.  The same goes for PipedReader.  JDK 1.1.x behaves
the same as libgcj in that regard; I haven't tried JDK 1.2.

Should we alter the stream classes to make their behavior
consistent regardless of compatibility with the JDK?
>How-To-Repeat:
Compile/run the attached program with gcj.  After about two seconds it will
return with:

Closing pipe input stream:
Interrupting pipe reader:
java.io.InterruptedIOException
>Fix:

>Release-Note:

>Audit-Trail:

Formerly PR java.io/204

State-Changed-From-To: open->feedback
State-Changed-By: tromey
State-Changed-When: Thu Apr 20 18:19:26 2000
State-Changed-Why:
    I checked in a fix for this.
    Can you give it a try?
    If not, tell me and I will just close this PR.
    
    BTW I've also checked your test case into Mauve.

From: tromey@sourceware.cygnus.com
To: java-gnats@sourceware.cygnus.com
Cc:  
Subject: java.io/204
Date: 21 Apr 2000 01:18:16 -0000

 CVSROOT:	/cvs/java
 Module name:	libgcj
 Changes by:	tromey@sourceware.cygnus.com	00/04/20 18:18:16
 
 Modified files:
 	libjava        : ChangeLog 
 	libjava/java/io: PipedInputStream.java PipedOutputStream.java 
 	                 PipedReader.java PipedWriter.java 
 
 Log message:
 	Fix for PR java.io/204:
 	* java/io/PipedInputStream.java, java/io/PipedReader.java,
 	java/io/PipedOutputStream.java, java/io/PipedWriter.java: Imported
 	from Classpath.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/gcc/libjava/ChangeLog.diff?cvsroot=java&r1=1.350&r2=1.351
 http://gcc.gnu.org/cgi-bin/gcc/libjava/java/io/PipedInputStream.java.diff?cvsroot=java&r1=1.3&r2=1.4
 http://gcc.gnu.org/cgi-bin/gcc/libjava/java/io/PipedOutputStream.java.diff?cvsroot=java&r1=1.4&r2=1.5
 http://gcc.gnu.org/cgi-bin/gcc/libjava/java/io/PipedReader.java.diff?cvsroot=java&r1=1.3&r2=1.4
 http://gcc.gnu.org/cgi-bin/gcc/libjava/java/io/PipedWriter.java.diff?cvsroot=java&r1=1.3&r2=1.4
 

From: tromey@cygnus.com
To: java-gnats@sourceware.cygnus.com, jsturm@sigma6.com, tromey@cygnus.com
Cc:  
Subject: Re: java.io/204
Date: 21 Apr 2000 01:19:26 -0000

 Synopsis: Resource revocation (close) does not cancel PipedInputStream reader
 
 State-Changed-From-To: open->feedback
 State-Changed-By: tromey
 State-Changed-When: Thu Apr 20 18:19:26 2000
 State-Changed-Why:
     I checked in a fix for this.
     Can you give it a try?
     If not, tell me and I will just close this PR.
     
     BTW I've also checked your test case into Mauve.
 
 http://sourceware.cygnus.com/cgi-bin/gnatsweb.pl?cmd=view&pr=204&database=java

From: Jeff Sturm <jsturm@sigma6.com>
To: tromey@cygnus.com
Cc: java-gnats@sourceware.cygnus.com
Subject: Re: java.io/204
Date: Fri, 21 Apr 2000 00:37:20 -0400

 tromey@cygnus.com wrote:
 > Synopsis: Resource revocation (close) does not cancel PipedInputStream reader
 > 
 > State-Changed-From-To: open->feedback
 > State-Changed-By: tromey
 > State-Changed-When: Thu Apr 20 18:19:26 2000
 > State-Changed-Why:
 >     I checked in a fix for this.
 >     Can you give it a try?
 >     If not, tell me and I will just close this PR.
 
 Yes, looks good:
 
 [jsturm@cc42593-a tmp]$ ./pipetest
 Closing pipe input stream:
 Pipe returned: -1
 
 --
 Jeff Sturm
 jsturm@sigma6.com
State-Changed-From-To: feedback->closed
State-Changed-By: tromey
State-Changed-When: Thu Apr 20 22:37:14 2000
State-Changed-Why:
    Jeff reports this is fixed.

From: tromey@cygnus.com
To: java-gnats@sourceware.cygnus.com, jsturm@sigma6.com, tromey@cygnus.com
Cc:  
Subject: Re: java.io/204
Date: 21 Apr 2000 05:37:14 -0000

 Synopsis: Resource revocation (close) does not cancel PipedInputStream reader
 
 State-Changed-From-To: feedback->closed
 State-Changed-By: tromey
 State-Changed-When: Thu Apr 20 22:37:14 2000
 State-Changed-Why:
     Jeff reports this is fixed.
 
 http://sourceware.cygnus.com/cgi-bin/gnatsweb.pl?cmd=view&pr=204&database=java
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="PipeTest.java"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="PipeTest.java"

aW1wb3J0IGphdmEuaW8uUGlwZWRJbnB1dFN0cmVhbTsKaW1wb3J0IGphdmEuaW8uUGlwZWRPdXRw
dXRTdHJlYW07CgpwdWJsaWMgY2xhc3MgUGlwZVRlc3QgaW1wbGVtZW50cyBSdW5uYWJsZSB7CglU
aHJlYWQgbWFpbjsKCVBpcGVkSW5wdXRTdHJlYW0gaW47CglQaXBlZE91dHB1dFN0cmVhbSBvdXQ7
CgoJcHVibGljIHZvaWQgcnVuKCkgewoJCXRyeSB7CgkJCVRocmVhZC5zbGVlcCgxMDAwKTsKCQkJ
U3lzdGVtLm91dC5wcmludGxuKCJDbG9zaW5nIHBpcGUgaW5wdXQgc3RyZWFtOiIpOwoJCQlpbi5j
bG9zZSgpOwoJCQlUaHJlYWQuc2xlZXAoMTAwMCk7CgkJCVN5c3RlbS5vdXQucHJpbnRsbigiSW50
ZXJydXB0aW5nIHBpcGUgcmVhZGVyOiIpOwoJCQltYWluLmludGVycnVwdCgpOwoJCX0gY2F0Y2gg
KFRocm93YWJsZSB0KSB7CgkJfQoJfQoKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKFN0cmluZ1td
IGFyZ3MpIHsKCQl0cnkgewoJCQlQaXBlVGVzdCB0ZXN0ID0gbmV3IFBpcGVUZXN0KCk7CgoJCQl0
ZXN0Lm1haW4gPSBUaHJlYWQuY3VycmVudFRocmVhZCgpOwoJCQl0ZXN0Lm91dCA9IG5ldyBQaXBl
ZE91dHB1dFN0cmVhbSgpOwoJCQl0ZXN0LmluID0gbmV3IFBpcGVkSW5wdXRTdHJlYW0odGVzdC5v
dXQpOwoKCQkJKG5ldyBUaHJlYWQodGVzdCkpLnN0YXJ0KCk7CgoJCQlTeXN0ZW0ub3V0LnByaW50
bG4oIlBpcGUgcmV0dXJuZWQ6ICIgKyB0ZXN0LmluLnJlYWQoKSk7CgkJCVN5c3RlbS5leGl0KDAp
OwoJCX0gY2F0Y2ggKFRocm93YWJsZSB0KSB7CgkJCXQucHJpbnRTdGFja1RyYWNlKCk7CgkJfQoJ
fQp9Cg==


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-12-20 12:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-20 12:22 libgcj/1238: Resource revocation (close) does not cancel PipedInputStream reader jsturm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).