[omniORB] POA_var issue in OmniORB 4.0 on NT
Paul Keeley
pkeeley@insci.com
Fri, 8 Feb 2002 10:29:22 -0500
I have written an application that encapsulates the orb and some POA's in a
class. When the class uses POA_var variables for the POA's the application
crashes on exit. What seems to be happening is that on construction of the
class, a _nil object is created and added to the nilObjectList in
omniInternal.cc. When the POA_var is assigned to the actual POA the nil
reference is left in the nilObjectList. Then on final clean up it crashes
when this object is deleted because the nil POA is created with a
pd_policy.threading mode of TP_SINGLE_THREAD and when it is deleted it tries
to delete a non-existent pd_call_lock. This sequence takes place in
_omniFinalCleanup and ~omniOrbPOA().
I can get around it by changing the POA_var to a POA_ptr but there is
probably a bug in there somewhere.
Here is a simple program that exhibits the bug.
#include "some file created through omniidl"
class test
{
public:
test()
{
int argc = 0;
orb = CORBA::ORB_init(argc, NULL, "omniORB4");
{
CORBA::Object_var obj =
orb->resolve_initial_references("RootPOA");
poa = PortableServer::POA::_narrow(obj);
}
}
~test(){orb->destroy();}
protected:
CORBA::ORB_var orb;
PortableServer::POA_var poa;
};
int main (int argc, char *argv[])
{
test *t = new test;
delete t;
return 0;
}
Cheers,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Paul Keeley
IDS Developer, INSCI Tel: 508-870-4324
Two Westborough Business Park Fax: 508-870-5585
Suite 2000/2001
Westborough MA 01581 mailto: pkeeley@insci.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~