[omniORB] Bug with same name interface inheritance

Chris Hafey chafey@prowess.com
Thu, 06 May 1999 16:59:05 -0700


Hi,
  An implementation of the ClientTest::Broker interface in the following
IDL file will cause omniorb 2.7.1 to crash with a stack overflow error on
my Windows NT 4.0 SP3 + VC 5.0 SP1 setup:

-------------------------------------------
module Base
{
  interface Broker
  {
    void DoStuff1();
  };
};

module ClientTest
{
  interface Broker : Base::Broker
  {
    void DoStuff2();
  };
};
-------------------------------------------

Build a program to implement the ClientTest::Broker interface.  Instantiate
the implementation and invoke _is_a() on the implementation.  Pass whatever
you want into _is_a() and you will get a stack overflow error.  I tried
debugging the code some and the problem has to do with the
_widenFromTheMostDerivedIntf() method.  It attempts to call the
Base::Broker::_widenFroMTheMostDerivedIntf() method but ends up in
itself!?!  I can get around this problem by renaming ClientTest::Broker in
the IDL file to something else (ClientTest::Broker2 works).  My guess is
the compiler is getting confused since a base class has the same name as
the class itself?  I didn't see anything related to this in the list
archives so I figured I would post the problem and workaround here.  Is
this NT/VC 5.0 specific or does it break on another platforms? 

Chris Hafey
Prowess Systems