[omniORB] omniORB 2.8.0 versus Orbix 3.0.1

Brecht Vermeulen Brecht.Vermeulen@rug.ac.be
Tue, 29 Feb 2000 00:54:51 +0100 (MET)


Hi all,

yes, I admit, we always come back to the Orbix problem, but we can't get
around :-).

I've tested the eg2 example (after some adaptation) between the
Sun/Solaris2.6/Orbix3.0.1 and the Linux/Debian2.1/omniORB2.8.0 platforms.

This example works perfect, independent where the server is executing.
(although the combination Orbix server-omniORB client takes 2 full seconds
before the call returns, because the IOR of the server object contains the
port of the Orbixd (1570) and only in second instance is the object
directly called on the right port ?, Orbix client-omniORB server works
fast and perfect)

But when trying the eg3 example with the server on omniORB and the client
on Orbix3 (with omniORB Naming Server) the client does the call, returns,
works perfect, but when exiting gives a Bus Error (core dumped). Here,
only two connections are made, a first one straight to the Naming Server
(via the Common.Service IOR config in Orbix) and a second straight to the
serving object.

This is thus a different error from the OBJECT_NOT_EXIST exception
described in the CORBA comparison project and described in the omniORB
list, last october.

Has anyone experience or ideas for this ?
An abstract of the  client code is following.

thanks,
Brecht Vermeulen
Ghent University
ATLANTIS ATM-IP testlab
-------------------------------------------------------------
void
hello(CORBA::Object_ptr obj)
{
  Echo_var e = Echo::_narrow(obj);

  if (CORBA::is_nil(e)) {
    cerr << "hello: cannot invoke on a nil object reference.\n" << endl;
    return;
  }

  // The CORBA standard says, if a const char * string is used, then
automatically
  // the CORBA::string_dup functions is called.
#ifdef __omniORB__
  CORBA::String_var src = (const char*) "Hello!"; // String literals are
not
                                                  // const char*. Must do
                                                  // explicit casting to 
                                                  // force the use of the
copy
                                                  // operator=(). 
#elif defined __Orbix__
  CORBA::String_var src = CORBA::string_dup("Hello!"); 
  // this will work with omniORB too, but it is for showing the difference
#endif

  CORBA::String_var dest;

  for (int i=0; i<10;i++) {
  dest = e->echoString(src);

  cerr << "I said,\"" << (char*)src << "\"."
       << " The Object said,\"" << (char*)dest <<"\"" << endl;

  cerr << "The function echoString on the object is called already " 
       << e->times_called() << " time(s)"<<endl;
  }

}


int
main (int argc, char **argv) 
{
#ifdef __omniORB__
  CORBA::ORB_var orb = CORBA::ORB_init(argc,argv,"omniORB2");
#elif defined __Orbix3__
  CORBA::ORB_var orb = CORBA::ORB_init(argc,argv,"Orbix");
#endif

  try {
    CORBA::Object_var obj = getObjectReference(orb);
    hello(obj);
    cout<<"still alive"<<endl;
  }
#ifdef __omniORB__
  catch(CORBA::COMM_FAILURE& ex) {
    cerr << "Caught system exception COMM_FAILURE, unable to contact the "
         << "object." << endl;
  }
  catch(omniORB::fatalException& ex) {
    cerr << "Caught omniORB2 fatalException. This indicates a bug is
caught "
         << "within omniORB2.\nPlease send a bug report.\n"
         << "The exception was thrown in file: " << ex.file() << "\n"
         << "                            line: " << ex.line() << "\n"
         << "The error message is: " << ex.errmsg() << endl;
  }
#endif
  catch (CORBA::SystemException& ex) {
    cerr << "Caught a system exception." 
#ifdef __Orbix__
         << ex 
#endif
	 << endl;
  }
  catch(...) {
    cerr << "Caught a system exception." << endl;
  }

  cout<<"still alive ?"<<endl;
  return 0;
}

The two 'still alives' are perfectly printed...