[omniORB] omniORB: Assertion failed.
yashik@veon.com
yashik@veon.com
Thu, 2 May 2002 02:41:25 +0200
Hi Bjorn,
Thank you for your answer.
Please see the source of main below.
EncoderAPI_impl is declared like this (even though I get the crash even if
I don't create the servant)
class EncoderAPI_impl :
public virtual POA_TEST::EncoderAPI,
public virtual PortableServer::RefCountServantBase
{
};
Regards,
Yakov.
--------------------------------------------------
int main(int argc, char** argv)
{
params.init(argc,argv);
params.get_updated(argc,argv);
CORBA::ORB_var orb = CORBA::ORB_init(argc,argv,"omniORB3");
CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
PortableServer::POA_var root_poa = PortableServer::POA::_narrow(obj);
PortableServer::POAManager_var pman = root_poa->the_POAManager();
pman->activate();
// Create a PERSISTENT LifespanPolicy object
PortableServer::LifespanPolicy_var lifespan =
root_poa->create_lifespan_policy(PortableServer::PERSISTENT);;
// Create a USER_ID id_assignment policy object
PortableServer::IdAssignmentPolicy_var idassignment =
root_poa->create_id_assignment_policy(PortableServer::USER_ID);
// Create a new POA with the persistent lifespan policy.
CORBA::PolicyList pl;
pl.length(2);
pl[0] = lifespan;
pl[1] = idassignment;
PortableServer::POA_var poa =
root_poa->create_POA(s_cszEncoderPOAName, pman, pl);
// Create object id (Always use the same one)
PortableServer::ObjectId_var oid =
PortableServer::string_to_ObjectId(s_cszEncoderAPIObjectName);
// Create the servant
EncoderAPI_impl* encoderAPI = new EncoderAPI_impl();
// Activate the object
poa->activate_object_with_id(oid, encoderAPI);
// Destroy policy objects
lifespan->destroy();
idassignment->destroy();
obj = poa->id_to_reference(oid);
if ( params.isPrintIOR() )
{
CORBA::String_var sior(orb->object_to_string(obj));
std::cerr << (char*)sior << std::endl;
}
encoderAPI->_remove_ref();
if ( 0 && !params.isExit() )
{
orb->run();
orb->destroy();
}
else
{
//orb->shutdown(0);
orb->destroy();
std::cout << "after destroy..." << std::endl;
}
return 0;
}
bjorn rohde jensen
<shamus@tdcadsl.dk> To: omniorb-list@uk.research.att.com
Sent by: cc:
owner-omniorb-list@uk.resear Subject: Re: [omniORB] omniORB: Assertion failed.
ch.att.com
05/02/2002 00:31
Please respond to shamus
Hi Yakov,
That assert looks quite interesting, something wrong
with the reference counting it would appear. This might
be fairly interesting to track down, perhaps one could
have a look at the complete source?:)
Yours sincerely,
Bjorn