JDK-7132247 : TEST_BUG: java/rmi/registry/readTest/readTest.sh failing with Cygwin
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.rmi
  • Affected Version: 8
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2012-01-22
  • Updated: 2013-12-17
  • Resolved: 2012-09-05
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 JDK 8
7u21Fixed 8 b55Fixed
Description
This test doesn't appear to obtain the PID correctly when working in Cygwin environments, thus causing all JDK8 jobs in JPRT that include the RMI tests to fail. Here is a sample failure:

--------------------------------------------------
TEST: java/rmi/registry/readTest/readTest.sh
JDK under test: (C:\temp\jprt\P2\203840~1.ALB\TESTPR~1\WINDOW~1.2-P)
java version "1.8.0-internal"
Java(TM) SE Runtime Environment (build 1.8.0-internal-201201212038.albatem.jdk-b00)
Java HotSpot(TM) 64-Bit Server VM (build 23.0-b10, mixed mode)


ACTION: shell -- Failed. Execution failed: exit code 1
REASON: User specified action: run shell readTest.sh 
TIME:   12.797 seconds
messages:
command: shell readTest.sh []
reason: User specified action: run shell readTest.sh 
elapsed time (seconds): 12.797
STDOUT:
Test output : 
Error: Could not find or load main class readTest
==============
rmiregistry output  : 
==============
Failed
STDERR:
cp: cannot stat `C:/temp/jprt/P2/203840.albatem/source/test/java/rmi/registry/readTest\\*': No such file or directory
javac: invalid flag: testPkg\*java
Usage: javac <options> <source files>
use -help for a list of possible options
javac: file not found: readTest.java
Usage: javac <options> <source files>
use -help for a list of possible options
/cygdrive/c/temp/jprt/P2/203840.albatem/source/test/java/rmi/registry/readTest/readTest.sh: line 68: kill: (4648) - No such process
/cygdrive/c/temp/jprt/P2/203840.albatem/source/test/java/rmi/registry/readTest/readTest.sh: line 69:  5448 Killed                  ${TESTJAVA}${FS}bin${FS}rmiregistry 7491 > ..${FS}${RMIREG_OUT} 2>&1  (wd: /cygdrive/c/temp/jprt/P2/203840.albatem/source/build/windows-amd64/testoutput/jdk_rmi/JTwork/java/rmi/registry/readTest/readTest/rmi_tmp)

TEST RESULT: Failed. Execution failed: exit code 1
--------------------------------------------------

Comments
the issue was fixed
20-08-2013

EVALUATION Root cause of this bug is: 1. CYGWIN doesn't handle "\\" correctly, if say FS="\\"; echo $FS, in cgywin, will print \\\\ which cause file not found. 2. Java doesn't recognize CYGWIN style path like "/cygwin/d/...", should use cygpath to convert to Windows native path. http://hg.openjdk.java.net/jdk8/tl/jdk/rev/e50a39d011b5
17-08-2012

SUGGESTED FIX Replace the FS variable value by "/". Convert the path provided to windows application (java), which is a cygwin path, to a windows path before calling the windows application itself.
29-06-2012

EVALUATION The readTest.sh shell script is not correctly configured in the CYGWIN case: FS var is still set to "\" like for MKS while it should be "/"unix-like (CYGWIN uses posix like path naming like "cygdrive/c/mydir/..." In addition, since the java executable is a "windows exwcutable", it should be provided a windows-like path in the command line, not a cygwin path.
29-06-2012