United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7132247 TEST_BUG: java/rmi/registry/readTest/readTest.sh failing with Cygwin
JDK-7132247 : TEST_BUG: java/rmi/registry/readTest/readTest.sh failing with Cygwin

Details
Type:
Bug
Submit Date:
2012-01-22
Status:
Closed
Updated Date:
2013-12-17
Project Name:
JDK
Resolved Date:
2012-09-05
Component:
core-libs
OS:
generic
Sub-Component:
java.rmi
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
8
Fixed Versions:

Related Reports
Backport:
Backport:
Backport:
Backport:
Backport:

Sub Tasks

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
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.
                                     
2012-06-29
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.
                                     
2012-06-29
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
                                     
2012-08-17
the issue was fixed

                                     
2013-08-20



Hardware and Software, Engineered to Work Together