JDK-4973159 : Regression test RmidViaInheritedChannel.java fails
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.rmi
  • Affected Version: 5.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_98
  • CPU: x86
  • Submitted: 2003-12-29
  • Updated: 2004-01-07
  • Resolved: 2004-01-07
Related Reports
Duplicate :  
Description

Name: vsR10238			Date: 12/29/2003


Filed By       : J2SE-SQA [###@###.###
JDK            : JDK1.5.0 (b28,b32)
Testbase       : Regression-test
Platform[s]    : Windows 98 (cannot reproduce on NT-based Windows and Unix platforms)
Falling test[s]:
         java/rmi/activation/rmidViaInheritedChannel/RmidViaInheritedChannel.java

Regression test java/rmi/activation/rmidViaInheritedChannel/RmidViaInheritedChannel.java
failed on Windows 98 using JDK1.5.0-(b28-b32) and passed using JDK1.5.0-b24,b26.


Test source location:
=====================
/java/re/jdk/1.5.0/promoted/all/b32/ws/j2se/test/java/rmi/activation/rmidViaInheritedChannel/RmidViaInheritedChannel.java

jtr file location:
==================
/net/jtgb4u4c.sfbay/export/sail15/results.2/tiger/b32/regtest/win32/win98_linux-17/workDir/test/java/rmi/activation/rmidViaInheritedChannel/RmidViaInheritedChannel.jtr

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

--- script start ---
#!/bin/sh
RESULT_DIR=`pwd`
WORK_DIR=$RESULT_DIR/workDir/test
REPORT_DIR=$RESULT_DIR/reportDir

#Paths in Java Software:
JT_HOME="z:/jct-tools/3.1.2/archive/fcs/binaries"
JEMMY_JAR="x:/Jemmy/jemmy.jar"
JAVA_HOME="z:/jdk/1.5.0/promoted/all/b32/binaries/windows-i586"
TEST_BASE_PATH="z:/jdk/1.5.0/promoted/all/b32/ws/j2se/test"

#Alternative paths outside Java Software:
#JT_HOME="z:/jct-tools/3.1.2/archive/fcs/binaries"
#JEMMY_JAR="x:/Jemmy/jemmy.jar"
#JAVA_HOME="z:/jdk/1.5.0/promoted/all/b32/binaries/windows-i586"
#TEST_BASE_PATH="z:/jdk/1.5.0/promoted/all/b32/ws/j2se/test"

#Alternative paths for the NSK site:
#JT_HOME="h:/java/jct"
#JEMMY_JAR="$JT_HOME/jemmy/jemmy.jar"
#JAVA_HOME="h:/java/jdk1.5.0/win32"
#TEST_BASE_PATH="h:/java/regtest.tiger/test"


TESTVMOPTS="-client"
CLASSPATH="$JT_HOME/classes;$JT_HOME/lib/javatest.jar;$JT_HOME/lib/jtreg.jar"

TEST="java/rmi/activation/rmidViaInheritedChannel/RmidViaInheritedChannel.java"

mkdir -p $WORK_DIR/scratch 2>&1
mkdir -p $WORK_DIR/jtData 2>&1
mkdir -p $REPORT_DIR 2>&1

#rm $WORK_DIR/jtData/ResultCache.jtw 2>&1

cd $WORK_DIR/scratch

$JAVA_HOME/bin/java -server -cp $CLASSPATH -DenvVars=TESTJAVAHOME=$JAVA_HOME,TESTVMOPTS=$TESTVMOPTS,DISPLAY=:0,windir=$windir,SystemRoot=$SystemRoot,PATH=${SHELL%/*},CPAPPEND=$JEMMY_JAR,TZ=,LC_ALL=en_US,LC_CTYPE=en_US,LANG=en_US,LPDEST= -DDISPLAY=:0 -DlocalHost="linux-17" -Dprogram=jtreg com.sun.javatest.regtest.Main -a -v default -batch -params -w "$WORK_DIR" -r "$REPORT_DIR" -t "$TEST_BASE_PATH" "$TEST_BASE_PATH/$TEST"

--- script end ---

Test output (jtr part):
=======================
----------messages:(3/220)----------
command: main  -Djava.rmi.activation.port=5398RmidViaInheritedChannel
reason: User specified action: run main/othervm/timeout=240 -Djava.rmi.activation.port=5398 RmidViaInheritedChannel
elapsed time (seconds): 19.67
----------System.out:(0/0)----------
----------System.err:(67/4597)*----------
export callback object and bind in registry
start rmid with inherited channel
RMID: starting rmid...
JAVAVM: command = C:\J2SDK1.5.0\JRE\bin\java    -Djava.security.policy=h:\java\regtest.tiger\test\java\rmi\activation\rmidViaInheritedChannel\rmid.security.policy 
-Djava.nio.channels.spi.SelectorProvider=RmidViaInheritedChannel$RmidSelectorProvider  -Dsun.rmi.server.activation.debugExec=true 
-Dtest.src=h:\java\regtest.tiger\test\java\rmi\activation\rmidViaInheritedChannel 
-Dtest.classes=C:\results_full\tiger\b32\regtest\win32\win98_linux-17\workDir\test\classes\java\rmi\activation\rmidViaInheritedChannel -Djava.rmi.server.logLevel=v  sun.rmi.server.Activation  -log 
C:\results_full\tiger\b32\regtest\win32\win98_linux-17\workDir\test\scratch\.\log -C-Dtest.src=h:\java\regtest.tiger\test\java\rmi\activation\rmidViaInheritedChannel 
-C-Dtest.classes=C:\results_full\tiger\b32\regtest\win32\win98_linux-17\workDir\test\classes\java\rmi\activation\rmidViaInheritedChannel

# RmidSelectorProvider.inheritedChannel
# serverSocket = ServerSocket[addr=/129.144.234.227,localport=5398]
# notify test...
notification received.
JAVAVM: finished starting vm.
RMID: finished starting rmid.
get activation system
RMID: getting a reference to the activation system
RMID: caught exception trying to shutdown rmid
RMID: Error unmarshaling return header; nested exception is:
	java.net.SocketException: Connection reset
java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
	java.net.SocketException: Connection reset
	at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:203)
	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:343)
	at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
	at java.rmi.Naming.lookup(Naming.java:84)
	at RMID.shutdown(RMID.java:232)
	at RMID.destroy(RMID.java:269)
	at ActivationLibrary$DestroyThread.run(ActivationLibrary.java:173)
Caused by: java.net.SocketException: Connection reset
	at java.net.SocketInputStream.read(SocketInputStream.java:168)
	at java.io.BufferedInputStream.fill(BufferedInputStream.java:191)
	at java.io.BufferedInputStream.read(BufferedInputStream.java:209)
	at java.io.DataInputStream.readByte(DataInputStream.java:338)
	at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:189)
	... 6 more
RMID: testlibrary finished shutting down rmid
RMID: Had to destroy RMID's process using Process.destroy()
ACTIVATION_LIBRARY: finished destroying rmid
RMID: removing rmid's old log file...
RMID: 	 unable to delete old log file.
java.rmi.activation.ActivationException: unable to obtain ActivationSystem; nested exception is:
	java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
	java.io.EOFException
	at java.rmi.activation.ActivationGroup.getSystem(ActivationGroup.java:453)
	at RmidViaInheritedChannel.main(RmidViaInheritedChannel.java:74)
	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:494)
	at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:82)
	at java.lang.Thread.run(Thread.java:566)
Caused by: java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
	java.io.EOFException
	at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:203)
	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:343)
	at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
	at java.rmi.Naming.lookup(Naming.java:84)
	at java.rmi.activation.ActivationGroup.getSystem(ActivationGroup.java:449)
	... 7 more
Caused by: java.io.EOFException
	at java.io.DataInputStream.readByte(DataInputStream.java:340)
	at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:189)
	... 11 more

JavaTest Message: Test threw exception: java.rmi.activation.ActivationException: unable to obtain ActivationSystem; nested exception is:
	java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
	java.io.EOFException
JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: java.rmi.activation.ActivationException: unable to obtain ActivationSystem; nested exception is:   java.rmi.UnmarshalException: Error unmarshaling return header; 
nested exception is:   java.io.EOFException
result: Failed. Execution failed: `main' threw exception: java.rmi.activation.ActivationException: unable to obtain ActivationSystem; nested exception is:   java.rmi.UnmarshalException: Error 
unmarshaling return header; nested exception is:   java.io.EOFException


test result: Failed. Execution failed: `main' threw exception: java.rmi.activation.ActivationException: unable to obtain ActivationSystem; nested exception is:   java.rmi.UnmarshalException: Error 
unmarshaling return header; nested exception is:   java.io.EOFException


Specific machine info:
======================
Hostname: linux-17
OS: Windows 98



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

Comments
EVALUATION To reproduce this problem, I ran rmid specifying a SelectorProvider that delegates all method implementations to the default nio SelectorProvider, except that it implements the inheritedChannel method to create and to return a bound ServerSocketChannel for rmid to use: public synchronized Channel inheritedChannel() throws IOException { System.err.println("MySelectorProvider.inheritedChannel"); if (channel == null) { /* * Create server socket channel and bind server socket. */ channel = ServerSocketChannel.open(); ServerSocket serverSocket = channel.socket(); serverSocket.bind( new InetSocketAddress(InetAddress.getLocalHost(), PORT)); System.err.println("serverSocket = " + serverSocket); } return channel; } This SelectorProvider implementation is the same as the RmidViaInheritedChannel test. Next, I attempted to list the contents of rmid's internal registry on the PORT specified above (using a utility program) which should list the ActivationSystem bound in rmid's registry (similar to what the test itself does), but instead the utility failed as the test did by receiving an EOFException looking up the ActivationSystem in rmid's registry. The rmid output file (generated when rmid uses an inheritedChannel) contained the following output: Wed Jan 07 15:06:45 EST 2004 rmid startup with inherited channel: sun.nio.ch.ServerSocketChannelImpl[/10.8.13.230:5398] Jan 7, 2004 3:06:46 PM sun.rmi.transport.tcp.TCPEndpoint <clinit> FINE: main: localHostKnown = true, localHost = 10.8.13.230 Jan 7, 2004 3:06:46 PM sun.rmi.transport.tcp.TCPTransport <init> FINE: main: Version = 2, ep = [10.8.13.230:5398,sun.rmi.server.Activation$ActivationServerSocketFactory@f7f540] Jan 7, 2004 3:06:46 PM sun.rmi.transport.tcp.TCPEndpoint getLocalEndpoint FINE: main: created local endpoint for socket factory sun.rmi.server.Activation$ActivationServerSocketFactory@f7f540 on port 5398 Jan 7, 2004 3:06:46 PM sun.rmi.transport.tcp.TCPTransport <init> FINE: main: Version = 2, ep = [10.8.13.230:0] Jan 7, 2004 3:06:46 PM sun.rmi.transport.tcp.TCPEndpoint getLocalEndpoint FINE: main: created local endpoint for socket factory null on port 0 Jan 7, 2004 3:06:46 PM sun.rmi.transport.tcp.TCPTransport listen FINE: main: (port 5398) create server socket Jan 7, 2004 3:06:46 PM sun.rmi.transport.tcp.TCPEndpoint newServerSocket FINER: main: creating server socket on [10.8.13.230:5398,sun.rmi.server.Activation$ActivationServerSocketFactory@f7f540] Jan 7, 2004 3:06:46 PM sun.rmi.transport.tcp.TCPTransport run FINE: RMI TCP Accept-5398: listening on port 5398 Jan 7, 2004 3:06:52 PM sun.rmi.transport.tcp.TCPTransport$ConnectionHandler run FINE: RMI TCP Connection(1)-129.148.70.120: accepted socket from [129.148.70.120:62880] Jan 7, 2004 3:06:52 PM sun.rmi.transport.tcp.TCPTransport$ConnectionHandler run FINER: RMI TCP Connection(1)-129.148.70.120: (port 5398) suggesting 129.148.70.120:62880 Jan 7, 2004 3:06:53 PM sun.rmi.transport.tcp.TCPTransport$ConnectionHandler run FINE: RMI TCP Connection(1)-129.148.70.120: terminated with exception: java.io.IOException: Unable to establish loopback connection at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:104) at java.security.AccessController.doPrivileged(Native Method) at sun.nio.ch.PipeImpl.<init>(PipeImpl.java:120) at sun.nio.ch.SelectorProviderImpl.openPipe(SelectorProviderImpl.java:27) at TestInheritedChannel$MySelectorProvider.openPipe(TestInheritedChannel.java:76) at java.nio.channels.Pipe.open(Pipe.java:133) at sun.nio.ch.WindowsSelectorImpl.<init>(WindowsSelectorImpl.java:101) at sun.nio.ch.WindowsSelectorProvider.openSelector(WindowsSelectorProvider.java:26) at sun.nio.ch.Util.getTemporarySelector(Util.java:94) at sun.nio.ch.SocketAdaptor$SocketInputStream.read(SocketAdaptor.java:180) at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:86) at java.io.BufferedInputStream.fill(BufferedInputStream.java:191) at java.io.BufferedInputStream.read(BufferedInputStream.java:209) at java.io.DataInputStream.readUnsignedShort(DataInputStream.java:404) at java.io.DataInputStream.readUTF(DataInputStream.java:640) at java.io.DataInputStream.readUTF(DataInputStream.java:617) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:685) at java.lang.Thread.run(Thread.java:566) Caused by: java.net.SocketException: Bad address: connect at sun.nio.ch.Net.connect(Native Method) at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:464) at java.nio.channels.SocketChannel.open(SocketChannel.java:146) at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:75) ... 17 more Jan 7, 2004 3:06:57 PM sun.rmi.transport.tcp.TCPTransport$ConnectionHandler run FINE: RMI TCP Connection(2)-129.148.70.120: accepted socket from [129.148.70.120:62883] Jan 7, 2004 3:06:57 PM sun.rmi.transport.tcp.TCPTransport$ConnectionHandler run FINER: RMI TCP Connection(2)-129.148.70.120: (port 5398) suggesting 129.148.70.120:62883 Jan 7, 2004 3:06:57 PM sun.rmi.transport.tcp.TCPTransport$ConnectionHandler run FINE: RMI TCP Connection(2)-129.148.70.120: terminated with exception: java.io.IOException: Unable to establish loopback connection at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:104) at java.security.AccessController.doPrivileged(Native Method) at sun.nio.ch.PipeImpl.<init>(PipeImpl.java:120) at sun.nio.ch.SelectorProviderImpl.openPipe(SelectorProviderImpl.java:27) at TestInheritedChannel$MySelectorProvider.openPipe(TestInheritedChannel.java:76) at java.nio.channels.Pipe.open(Pipe.java:133) at sun.nio.ch.WindowsSelectorImpl.<init>(WindowsSelectorImpl.java:101) at sun.nio.ch.WindowsSelectorProvider.openSelector(WindowsSelectorProvider.java:26) at sun.nio.ch.Util.getTemporarySelector(Util.java:94) at sun.nio.ch.SocketAdaptor$SocketInputStream.read(SocketAdaptor.java:180) at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:86) at java.io.BufferedInputStream.fill(BufferedInputStream.java:191) at java.io.BufferedInputStream.read(BufferedInputStream.java:209) at java.io.DataInputStream.readUnsignedShort(DataInputStream.java:404) at java.io.DataInputStream.readUTF(DataInputStream.java:640) at java.io.DataInputStream.readUTF(DataInputStream.java:617) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:685) at java.lang.Thread.run(Thread.java:566) Caused by: java.net.SocketException: Bad address: connect at sun.nio.ch.Net.connect(Native Method) at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:464) at java.nio.channels.SocketChannel.open(SocketChannel.java:146) at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:75) ... 17 more The problem is a failure in the nio implementation on Win98 as explained in the bug 4956497 (SocketChannel.connect() throws unexpected exception) which causes the exact same failure as this test. Therefore I am closing this bug as a duplicate of 4956497. ###@###.### 2004-01-07
07-01-2004