JDK-4856199 : Generic/4820217/StreamsSurviveDestroy.java failed, x86
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 1.4.2
  • Priority: P2
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: solaris_9
  • CPU: x86
  • Submitted: 2003-04-30
  • Updated: 2004-01-07
  • Resolved: 2003-12-04
Related Reports
Relates :  
Description

Name: aaR10208			Date: 04/30/2003


Filed By       : J2SE-SQA [###@###.###
JDK            : JDK1.4.2-b21
Testbase       : RegTest-cte
Platform[s]    : Solaris 9 (x86) (CDE), SMP, 4 CPUs (unable to reproduce on single-CPU box).
switch/Mode    : -server
Falling test[s]: CTE_REGTEST/Generic/4820217/StreamsSurviveDestroy.java

The test performs 4 steps:  test(), testCloseBeforeDestroy(), testCloseAfterDestroy(), testInterrupt()
and there is an intermittent failure in the testCloseAfterDestroy().

Most probably the failure is caused by the racing in the test (see also output logs below):
the stream copiers receive EOF from the process' output and error streams and stop working before
the test calls Process.destroy(), so the test fails.

Please note, that the failure is intermittent, and I was not able to reproduce it on my single-cpu
solx86 box after 10 runs.

Test source location:
=====================
/net/jdk/export/jpse04/Regression/1.4.2/test/CTE_REGTEST/Generic/4820217/StreamsSurviveDestroy.java

jtr file location:
==================
/net/jtgb4u4c.sfbay/export/sail15/results/mantis/b21/regtest/x86/sol9_x86-server_smp_linux-6/workDir/cte/CTE_REGTEST/Generic/4820217/StreamsSurviveDestroy.jtr

How to reproduce:
=================
Run the following script (you may need to change its variables)

--- script start ---
#!/bin/sh
JDK=/java/re/jdk/1.4.2/promoted/latest/binaries/solaris-x86
TESTBASE=//net/jdk/export/jpse04/Regression/1.4.2/test/CTE_REGTEST
#JDK=/net/linux-15/export/home/java/jdk1.4.2/x86
#TESTBASE=/net/linux-15/export/home/java/regtest/cte
TEST=StreamsSurviveDestroy
cp ${TESTBASE}/CTE_REGTEST/Generic/4820217/$TEST.java .
${JDK}/bin/javac ${TEST}.java
${JDK}/bin/java -showversion ${TEST}
--- script end ---

Script output:
==============
[3 successful runs before]
$./doit.sh
java version "1.4.2-rc"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-rc-b21)
Java HotSpot(TM) Client VM (build 1.4.2-rc-b21, mixed mode)

test
   EOF
   EOF
   exit: 15
testCloseBeforeDestroy
   exit: 15
   out: Thrown as expected: java.io.IOException: Bad file number
   err: Thrown as expected: java.io.IOException: Bad file number
testCloseAfterDestroy
   EOF
   EOF
   exit: 15
Exception in thread "main" java.lang.Exception: out: Expected exception not thrown
         at StreamsSurviveDestroy$Copier.check(StreamsSurviveDestroy.java:71)
         at StreamsSurviveDestroy.testCloseAfterDestroy(StreamsSurviveDestroy.java:125)
         at StreamsSurviveDestroy.main(StreamsSurviveDestroy.java:181)


Test output (jtr part):
=======================
----------System.out:(0/0)----------
----------System.err:(27/1141)----------
test
   EOF
   EOF
   exit: 15
testCloseBeforeDestroy
   exit: 15
   out: Thrown as expected: java.io.IOException: Bad file number
   err: Thrown as expected: java.io.IOException: Bad file number
testCloseAfterDestroy
   EOF
   EOF
   exit: 15
java.lang.Exception: out: Expected exception not thrown
	at StreamsSurviveDestroy$Copier.check(StreamsSurviveDestroy.java:71)
	at StreamsSurviveDestroy.testCloseAfterDestroy(StreamsSurviveDestroy.java:125)
	at StreamsSurviveDestroy.main(StreamsSurviveDestroy.java:181)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:82)
	at java.lang.Thread.run(Thread.java:534)

JavaTest Message: Test threw exception: java.lang.Exception: out: Expected exception not thrown
JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: java.lang.Exception: out: Expected exception not thrown
result: Failed. Execution failed: `main' threw exception: java.lang.Exception: out: Expected exception not thrown


test result: Failed. Execution failed: `main' threw exception: java.lang.Exception: out: Expected exception not thrown


Specific machine info:
======================
Hostname: linux-6
OS: Solaris 9 (x86) (CDE), SMP 4 CPUs



======================================================================

Comments
EVALUATION If it fails with latest Mantis-rc build, file a seperate bug for this failure ( bug # 4820217 ) with appropriate category and subcategory. This is not then a CTE Testcase problem. ###@###.### 2003-05-12 I finally found a 4-cpu Solaris x-86 box to try this out on. I managed to reproduce the problem running this test using java -server, but only with JRE version 1.4.1, not 1.4.2 or 1.5.0. With 1.4.1, the test fails about 5% of the time. I made sure to run many iterations of the test using 1.4.2 and 1.5.0. The test can be most easily made to fail if there is some concurrent activity on the system - a teamware bringover works well. This test never fails in our nightly testing (although we don't test Solaris-x86). Since the bug has apparently been fixed for Mantis, I intend to close it as Not Reproducible ###@###.### 2003-11-20
20-11-2003