[OmniORB] "pure virtual method called"

Alfonso Tames alfonso@tames.com
Wed Oct 30 00:20:01 2002


I also experience 'pure virtual method called' when trying to use an
object after it got destroyed. The behaviour is pretty erratic and can
cause confusion, sometimes it works and sometimes not. If you are
receiving object references in your methods (someObject_ptr), be sure
you deep copy them to variables outside the scope of your function if
you plan to continue using them.

On Tue, 2002-10-29 at 17:07, Bastiaan Bakker wrote:
> Hi Cameron,
> 
> All cases where I encountered 'pure virtual method called' where
> situations were a object method was called after destruction of the
> object. For example, by using both _var and calling CORBA::release(). 
> So setting a breakpoint on the destructors of your servants may help.
> 
> Good luck,
> 
> Bastiaan Bakker
>  
>  
> 
> On Tue, 2002-10-29 at 10:02, Cameron Rochester wrote:
> > Hello all,
> > 
> > I am having a problem with "pure virtual method called" (this is the message
> > printed on screen just before the app core dumps). The exact same code
> > worked with OmniORB 3.0.3 but does not appear to work with OmniORB 4.0.0.
> > 
> > The code that appears to be giving this exception is:
> > 
> > EventChannelImpl::EventChannelImpl()
> > {
> >     ConsumerAdminImpl* ca = new ConsumerAdminImpl();
> >     m_consumerAdmin = ca->_this();
> >     ca->_remove_ref();
> > 
> >     SupplierAdminImpl* sa = new SupplierAdminImpl();
> >     m_supplierAdmin = sa->_this();
> >     sa->_remove_ref();
> > }
> > 
> > where the member variables are defined to be:
> > 
> >     CosEventChannelAdmin::ConsumerAdmin_var   m_consumerAdmin;
> >     CosEventChannelAdmin::SupplierAdmin_var   m_supplierAdmin;
> > 
> > and the classes inherit from the following:
> > 
> > class ConsumerAdminImpl
> >     : public virtual POA_CosEventChannelAdmin::ConsumerAdmin,
> >       public virtual PortableServer::RefCountServantBase
> > 
> > class SupplierAdminImpl
> >     : public virtual POA_CosEventChannelAdmin::SupplierAdmin,
> >       public virtual PortableServer::RefCountServantBase
> > 
> > 
> > Does anyone have any ideas about this problem? Below is the stack trace from
> > the core dump. The call to "_this()" appears to be the culprit. If anyone
> > would be able to help it would be most appreciated, please let me know if
> > you want more information/code.
> > 
> > Thanks in advance
> > Cameron Rochester
> > 
> > #0  0xfe3d9da0 in __sigprocmask () from /usr/lib/libthread.so.1
> > #1  0xfe3cf400 in _resetsig () from /usr/lib/libthread.so.1
> > #2  0xfe3ceb4c in _sigon () from /usr/lib/libthread.so.1
> > #3  0xfe3d1a28 in _thrp_kill () from /usr/lib/libthread.so.1
> > #4  0xfe2395b0 in abort () from /usr/lib/libc.so.1
> > #5  0xff156e00 in __default_terminate ()
> >    from /home/cameronr/omni/build/lib/libomnithread.so.3
> > #6  0xff156e30 in __terminate ()
> >    from /home/cameronr/omni/build/lib/libomnithread.so.3
> > #7  0xff2d1d04 in __pure_virtual ()
> >    from /home/cameronr/omni/build/lib/libomniORB4.so.0
> > #8  0xff264f50 in
> > servant__this__Q24omni10omniOrbPOAPQ214PortableServer11Servant
> > BasePCc () from /home/cameronr/omni/build/lib/libomniORB4.so.0
> > #9  0xff271bc4 in PortableServer::ServantBase::_do_this ()
> >    from /home/cameronr/omni/build/lib/libomniORB4.so.0
> > #10 0x416ac in EventChannelImpl::EventChannelImpl ()
> > #11 0x40168 in main ()
> > _______________________________________________
> > omniORB-list mailing list
> > omniORB-list@omniorb-support.com
> > http://www.omniorb-support.com/mailman/listinfo/omniorb-list
> 
> 
> _______________________________________________
> omniORB-list mailing list
> omniORB-list@omniorb-support.com
> http://www.omniorb-support.com/mailman/listinfo/omniorb-list