[omniORB] Omni's bug?

Maxim Krylov cyberz@garant.ru
Fri, 7 May 1999 21:49:43 +0400


Hello!

I began to use OmniORB recently. I faced little problem simular to a bug.

Suppose we have class:

  calss Server
  {
  protected:
    CORBA::ORB_var m_pOrb;
    CORBA::BOA_var m_pBoa;
    SomeObj_i * m_pSomeObj;
  public:
    Server () {
      m_pOrb = CORBA::ORB_init ( 0, NULL, "omniORB2 );
      m_pBoa = m_pOrb->BOA_init ( 0, NULL, "omniORB2_BOA" );
      m_pSomeObj = new SomeObj_i ();
      m_pSomeObj->_obj_is_ready (m_pBoa);
    }
    ~Server () {
      m_pBoa->impl_shutdown ();
      m_pBoa->dispose (m_pSomeObj);
      m_pBoa->destroy();
    }
    char * GetIOR () {
      FirstTest_var refFirstTest = m_pFirstTest->_this();
      CORBA::String_var s = omni::objectToString(p->PR_getobj());
      return s;
    }
  };

This class is being creaded and destroed several times in main():

  void main ()
  {
    Server * pServer;

    pServer = new Server ();
    cout << "First server creation: " << pServer->GetIOR ();
    delete pServer;

    pServer = new Server ();
    cout << "Next  server creation: " << pServer->GetIOR ();
    delete pServer;
  }

As a result we have:

  First server creation:
IOR:01239c001200000049444c3a4669727374546573743a312e300004100100000000000000
28000000010100000e0000003139352e3230392e33332e3736007f060c0000003732df490000
00ff00000002
  Next  server creation:
IOR:013d01101200000049444c3a4669727374546573743a312e3000cdcd00000000

Thus, at the second time initalizing ORB all server objects objects have too
short IOR. If the client trys to invoke this IOR it hangs without exception.
Under debugger we have (omni::objectToString) missing part of
IOP::TaggedProfileList pd_iopprofile, i.e. pd_buf == NULL.
In call of CORBA::ORB::BOA_init for the second time, the static variable in
corbaBoa.cc

  static CORBA::BOA_ptr     boa = 0;

have a pointer to previously created and then destroed BOA, as a result
futher initialization is missed.

  CORBA::BOA_ptr
  CORBA::
  ORB::BOA_init(int &argc, char **argv, const char *boa_identifier)
  {
    omni_mutex_lock sync(internalLock);
    if (boa)
      return CORBA::BOA::_duplicate(boa);
    ....
  }

If i set boa to NULL everything will be alright, both of IOR's is correct.

Adding to ~Server()
   CORBA::release (m_pBoa);
   CORBA::release (m_pOrb);
doesn't help.


Is it my or Omni's bug?

Thank you for advance.
Max.

P.S. I use OmniOrb 2.7.1, MSVC5.0