[omniORB] Bug in omniORB 3.0

David Riddoch djr@uk.research.att.com
Mon, 3 Jan 2000 18:41:46 +0000 (GMT)


Hi,

Okay, got round to this at last!  Sorry about the delay.


> I'm running omniORB 3.0 under Irix 6.5.3 using the 7.3 MIPS C++
> compiler.
> When starting my server, I catch the following exception:
> 
> omniORB: Assertion failed.  This indicates a bug in omniORB.
>  file: ../corbaObject.cc
>  line: 223
>  info: !_NP_is_pseudo()
> 
> Is this a real bug, or am I doing something really wrong in my
> code? If it is a real bug, is there a patch yet? Could this be
> due to my trying to create a child POA with a nil POAManager?

Yes, this is a bug in <omniORB>/src/lib/omniORB2/orbcore/policy.cc.  I'll
put the fix in CVS tonight.  It is a ref counting problem for policy
objects.

However, there is also a bug in your code ... see below.


> My server code is:
> 
> int main (int argc, char**argv)
> {
>  try {
>   cerr << "1" << endl;
>   CORBA::ORB_var orb = CORBA::ORB_init(argc,argv,"omniORB3");
> 		
>   cerr << "2" << endl;
>   CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
>   PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);
> 		
>   cerr << "3" << endl;
>   PortableServer::POAManager_var mgr = poa->the_POAManager();
>   mgr->activate();
> 		
>   cerr << "4" << endl;
>   Factory_impl	factory_servant(poa);	// THROWS EXCEPTION ABOUT HERE?
> 		
>   cerr << "5" << endl;
>   PortableServer::ObjectId_var oid =
>     PortableServer::string_to_ObjectId("vrs_WorldFactory");
> 
>   cerr << "5a" << endl;
>   poa->activate_object_with_id(oid,&factory_servant);

This requires the USER_ID policy, which the root poa does not have.
Perhaps you meant to activate the object in the _worldPoa?


>   cerr << "6" << endl;
>   orb->run();
>  }
>  catch (const CORBA::Exception&) {
>   cerr << "Uncaught corba exception" << endl;
>   return 1;
>  }
>  return 0;
> }
> 
> and the factory constructor is
> 
> Factory_impl::Factory_impl (PortableServer::POA_ptr poa)
> {
>  cerr << "Factory_impl" << endl;
>  _rootPoa = poa;
> 	
>  cerr << "\t1" << endl;
>  PortableServer::IdAssignmentPolicy_var assign =
>  _rootPoa->create_id_assignment_policy(PortableServer::USER_ID);
> 	
>  cerr << "\t2" << endl;
>  CORBA::PolicyList policyList;
>  policyList.length(1);
>  policyList[0] = PortableServer::IdAssignmentPolicy::_duplicate(assign);
> 	
>  PortableServer::POAManager_var	mgr =
> PortableServer::POAManager::_nil();
>  cerr << "\t3" << endl;
>  _worldPoa = _rootPoa->create_POA ("Worlds", mgr, policyList);
>  cerr << "Factory_impl" << endl;
> }
> 
> Output from this whole mess is:
> 1
> 2
> 3
> 4
> Factory_impl
>   1
>   2
>   3
> Factory_impl
> omniORB: Assertion failed.  This indicates a bug in omniORB.
>  file: ../corbaObject.cc
>  line: 223
>  info: !_NP_is_pseudo()
> Abort (core dumped)