JDK-6941936 : Broken pipe error of test case DNSIdentities.java
  • Type: Bug
  • Component: security-libs
  • Sub-Component: javax.net.ssl
  • Affected Version: 7
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2010-04-08
  • Updated: 2011-03-07
  • Resolved: 2011-03-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 Other
7 b91Fixed OpenJDK6Fixed
Description
During PIT test, the following test case failed with the similiar reason, "broken pipe":
FAILED: sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/DNSIdentities.java
FAILED: sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/Identities.java
FAILED: sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/IPAddressIPIdentities.java
FAILED: sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/IPIdentities.java

For example, for DNSIdentities.java, the test log looks like:
TEST: sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/DNSIdentities.java
JDK under test: (/tmp/jprt/T1/T/011642.ss145989/testproduct/linux_i586_2.6-product)
java version "1.7.0-internal"
Java(TM) SE Runtime Environment (build 1.7.0-internal-jprtadm_2010_04_06_18_32-b00)
Java HotSpot(TM) Server VM (build 18.0-b02-2010-04-07-011642.ss145989.tl-pit-2d-awt-swing, mixed mode)

ACTION: build -- Passed. Build successful
REASON: Named class compiled on demand
TIME:   0.801 seconds
messages:
command: build DNSIdentities
reason: Named class compiled on demand
elapsed time (seconds): 0.801

ACTION: compile -- Passed. Compilation successful
REASON: .class file out of date or does not exist
TIME:   0.801 seconds
messages:
command: compile /tmp/jprt/T1/T/011642.ss145989/source/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/DNSIdentities.java
reason: .class file out of date or does not exist
elapsed time (seconds): 0.801
STDOUT:
STDERR:

ACTION: main -- Failed. Execution failed: `main' threw exception: java.net.SocketException: Broken pipe
REASON: Assumed action based on file name: run main DNSIdentities 
TIME:   0.501 seconds
messages:
command: main DNSIdentities
reason: Assumed action based on file name: run main DNSIdentities 
elapsed time (seconds): 0.501
STDOUT:
url is https://localhost:34224/
STDERR:
java.net.SocketException: Broken pipe
	at java.net.SocketOutputStream.socketWrite0(Native Method)
	at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
	at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
	at sun.security.ssl.OutputRecord.writeBuffer(OutputRecord.java:314)
	at sun.security.ssl.OutputRecord.write(OutputRecord.java:303)
	at sun.security.ssl.SSLSocketImpl.writeRecordInternal(SSLSocketImpl.java:757)
	at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:745)
	at sun.security.ssl.Handshaker.sendChangeCipherSpec(Handshaker.java:635)
	at sun.security.ssl.ClientHandshaker.sendChangeCipherAndFinish(ClientHandshaker.java:921)
	at sun.security.ssl.ClientHandshaker.serverHelloDone(ClientHandshaker.java:847)
	at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:245)
	at sun.security.ssl.Handshaker.processLoop(Handshaker.java:545)
	at sun.security.ssl.Handshaker.process_record(Handshaker.java:481)
	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:907)
	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1143)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1170)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1154)
	at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:439)
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1164)
	at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:459)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
	at DNSIdentities.doClientSide(DNSIdentities.java:709)
	at DNSIdentities.startClient(DNSIdentities.java:815)
	at DNSIdentities.<init>(DNSIdentities.java:746)
	at DNSIdentities.main(DNSIdentities.java:733)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:613)
	at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:94)
	at java.lang.Thread.run(Thread.java:717)

JavaTest Message: Test threw exception: java.net.SocketException: Broken pipe
JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: java.net.SocketException: Broken pipe

TEST RESULT: Failed. Execution failed: `main' threw exception: java.net.SocketException: Broken pipe

Comments
PUBLIC COMMENTS changes: http://hg.openjdk.java.net/jdk7/tl/jdk/rev/89f4ec9e4b33
10-04-2010

EVALUATION The TLS server will close the socket after a sleep, "Thread.sleep(2000)". However, it is not enough for some test environment. Need to improve the test that the close will not occure until the client is ready to close.
08-04-2010