JDK-6578707 : Typecode Indirection error thrown
  • Type: Bug
  • Component: other-libs
  • Sub-Component: corba:orb
  • Affected Version: 6u1
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2007-07-10
  • Updated: 2018-02-14
  • Resolved: 2018-02-14
Related Reports
Relates :  
Description
FULL JDK VERSION(S):
-------------------
java version "1.6.0_01"
Java(TM) SE Runtime Environment (build 1.6.0_01-b05)
Java HotSpot(TM) Client VM (build 1.6.0_01-b05, mixed mode, sharing)

DESCRIPTION:
------------
I have run the attached test case with IBM SDK as the client and Sun SDK as Server. The testcase runs fine for i=1 to i=322 but fails at i=333. It also fails at i=837 when i is started from 334 in for loop. The logs suggest that the reply message sent by Sun ORB does not send correct indirection offset. The indirection offset (0xFFFFFF80) is not pointing to the correct typecode value (0x0000001D).


Client.java
=====================================================================================
import java.rmi.*;
import javax.rmi.*;
import javax.naming.*;
import java.rmi.server.*;
import java.io.*;
import java.util.*;

class Fragment implements java.io.Serializable {

    String str;

    Fragment(int  size) {
        str="";
        for(int i=0;i<size;i++) {
            str+="B";
        }
    }


}

class Wrapper implements java.io.Serializable{
	
	Fragment f = null;

	Vector vec = null;

	public Wrapper(int len, Vector vec){
		this.vec = vec;
		f = new Fragment(len);

	}

    	private void readObject(java.io.ObjectInputStream is) throws java.io.IOException,  ClassNotFoundException{
      		is.defaultReadObject();
    	}

   	private void writeObject(java.io.ObjectOutputStream is) throws java.io.IOException{
      		is.defaultWriteObject();
    	}
}

public class Client{

	public static void main(String[] args) throws Exception{
		Context ic = new InitialContext();
		Object ref = ic.lookup("HELLO");
		Hello hello = (Hello)PortableRemoteObject.narrow(ref, Hello.class);
		Throwable t = new Throwable();
		Vector v = new Vector();
		v.add(t);
		for(int i = 0; i < 1024; i++){
			System.out.println(i);
			Wrapper w = new Wrapper(i, v);
			hello.sayHello(w);
		}
	}
=====================================================================================


Server.java
=====================================================================================
import java.rmi.*;
import javax.rmi.*;
import javax.naming.*;
import java.rmi.server.*;
public class Server{
	public static void main(String[] args ) throws Exception{
		Hello hello = new HelloImpl();
		Context ic = new InitialContext();
		ic.rebind("HELLO",hello);
	}
}
=======================================================================

Comments
The Java EE and CORBA modules have been removed from JDK 11. There are no plans to fix this issue.
14-02-2018

EVALUATION I've run the test program in a couple of different environments with Sun ORBs on both ends, but I cannot reproduce the problem from the Sun ORB alone. Clearly we have an interop problem. This looks very similar to bug 5034649 that was reported by BEA over 3 years ago. That bug was caused by incorrectly computing the typecode offset BEFORE doing a write_long of the typecode kind, ignoring the fact that the write_long may adjust the padding, resulting in an incorrect offset computation. As I recall, this problem only showed up at certain precise offsets depending on the exact size of other types being marshaled before the TypeCode. You should take a look at the Sun ORB com.sun.corba.se.impl.corba.TypeCodeImpl class. Just search for the bug ID 5034649 for the details of the changes. If this is not the cause of the observed problem, please send me more details, including the contents of the marshaled messages so I can explore this further.
23-10-2007

WORK AROUND None
10-07-2007