[omniORB] omniORB: Assertion failed.

yashik@veon.com yashik@veon.com
Fri, 3 May 2002 12:32:05 +0200


Hi Bjorn,

     Thank you very much for your answer.
Changing policy variables (PortableServer::LifespanPolicy_var and
PortableServer::IdAssignmentPolicy_var ) to _ptr's fixes the problem in my
case.

The strange thing is that the following code crashes

     PortableServer::LifespanPolicy_var lifespan =

root_poa->create_lifespan_policy(PortableServer::PERSISTENT);
     PortableServer::IdAssignmentPolicy_var idassignment =
               root_poa->create_id_assignment_policy(
PortableServer::USER_ID);

     CORBA::PolicyList pl;
     pl.length(2);
     pl[0] = lifespan;
     pl[1] = idassignment;

while
     PortableServer::LifespanPolicy_ptr lifespan =

root_poa->create_lifespan_policy(PortableServer::PERSISTENT);
     PortableServer::IdAssignmentPolicy_ptr idassignment =

root_poa->create_id_assignment_policy(PortableServer::USER_ID);

     CORBA::PolicyList pl;
     pl.length(2);
     pl[0] = lifespan;
     pl[1] = idassignment;
     ...
     lifespan->destroy();
     idassignment->destroy();

does not. The only explanation I can think of is that when assigning _var
policies to the policy list the policy list takes ownership without
increasing ref count, while assigning _ptr policy policy list either
add_ref's or does not take ownership. I wonder is that correct behaviour.

Regards,
Yakov.



                                                                                                                                 
                    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 13:25                                                                                             
                    Please respond to shamus                                                                                     
                                                                                                                                 
                                                                                                                                 




Hi Yakov,

 The problem appears to be exactly, what the assert message
says. When the PortableServer::LifespanPolicy_var's go out
of scope at the end of main, they try to release their
resources, which causes the assert. I seem to recall something
special about the lifespan policy pseudo object's lifecycle,
but i forgot, what it was.

Yours sincerely,

Bjorn