[omniORB] gcc and multiple virtual inheritance

yashik@veon.com yashik@veon.com
Tue, 19 Feb 2002 16:14:04 +0200


Hi,

     I tried to derive from implementation of the base interface and this
works fine for me:

A_B_impl : virtual public POA_A::B, virtual
PortableServer::RefCountServantBase
{
...
}

A_C_impl :
     public virtual POA_A::C, // The 'C' interface
     public virtual A_B_impl,  // The implementation of the base 'B'
interface
     public virtual PortableServer::RefCountServantBase
{
...
}

Pay attention: all inheritance are virtual.
I then create only one instance of A_C_impl  (which is implements both
interfaces)

OmniORB 3.0.4,gcc 2.95.2 on  solaris8-sparc

Regards,
Yakov




                                                                                                                            
                    "zee" <zeyu@kasenna.com>                                                                                
                    Sent by:                           To:     <omniorb-list@uk.research.att.com>                           
                    owner-omniorb-list@uk.resear       cc:                                                                  
                    ch.att.com                         Subject:     Re: [omniORB] gcc and multiple virtual inheritance      
                                                                                                                            
                                                                                                                            
                    02/19/2002 06:30                                                                                        
                                                                                                                            
                                                                                                                            




i tried again with the changes you suggested and i got the same problem.
purify sessions suggest that the constructors of the base classes were
trying to read/write past the end of malloced blocks.

by the way i am using omniORB4 snapshot 20020115 with gcc-2.95.3 on
solaris8-sparc.  i wonder if i overlooked something obvious.

z

----- Original Message -----
From: "Stefan Seefeld" <seefeld@sympatico.ca>
To: <omniorb-list@uk.research.att.com>
Sent: Monday, February 18, 2002 6:42 PM
Subject: Re: [omniORB] gcc and multiple virtual inheritance


> zee wrote:
>
>My der
> > A_C_impl : public POA_A::C, PortableServer::RefCountServantBase
>
>
> this should probably read
>
> A_C_impl : public virtual POA_A::C, public
PortableServer::RefCountServantBase
>
> and may be even the RefCountServantBase should be derived virtually from.
>
>
> > The constructor code for A_C_impl generated by gcc is bad and would
> > corrupt the heap with segvs.  Both gcc-2.95.2 and gcc-3.0.2 exhibit
this
> > problem.
>
>
> I'm using this (modulo the changes I just suggested) myself on a large
scale
> without problems with gcc 2.95.x, but I know that gcc 3.0.x with x at
least
> 0 had trouble with more complex inheritance relationships due to the new
ABI
> they are using. I'm not using gcc 3.0.x for my omniORB based projects...
>
> Regards,
> Stefan
>
>