[omniORB] bug report: transfer of unions with empty default valut

Ruslan Shevchenko Ruslan@Shevchenko.Kiev.UA
Thu, 15 Jun 2000 17:12:21 +0300


Poilpret Jean Francois wrote:
> 
> Hi Ruslan,
> 
> I think that you should add the following line:
> 
>     retval->_default();
> 
> before retval->_d(1);
> 

the bug stull exists :(


> because, according to the IDL -> C++ mapping, for unions for which you want
> the 'default' discriminator applied, you have to call that method first
> (AFAIK, unions are never automatically initialized when constructed, so that

 Yes. thanks for mention.

> you have to specify their contents, be it the default).
> I think this should work fine after this.

No, I tried all possible variants of doing this, (with ->_default()
without setting
discriminator was the first), and I sure, that this is omniORB bug.

> 
> Hope this helps,
> 
>     Jean-Francois
> 
> -----Original Message-----
> From: Ruslan Shevchenko <Ruslan@Shevchenko.Kiev.UA>
> To: omniorb-list@uk.research.att.com <omniorb-list@uk.research.att.com>
> Date: jeudi 15 juin 2000 18:13
> Subject: [omniORB] bug report: transfer of unions with empty default valut
> 
> >omniORB can't marshall/demarshall unions with empty
> >default values, i. e:
> >
> >let we have next IDL:
> >
> 
> >
> >enum EX {
> >  TX,
> >  TY
> >};
> >
> >union UY switch(EX) {
> >    case TX: long vx;
> >    case TY: string vy;
> >};
> >
> >
> >union V switch(boolean)
> >{
> >  case FALSE: UY y;
> >};
> >
> >interface Bug1 {
> >  V getV();
> >};
> >
> >
> >and next Bug1 implementation:
> >
> >
> >class Bug1_i : public POA_Bug1,
> >               public PortableServer::RefCountServantBase
> >{
> >public:
> >  inline Bug1_i() {}
> >  virtual ~Bug1_i() {}
> >  virtual V* getV();
> >};
> >
> >V* Bug1_i::getV()
> >{
> >  V_var retval = new V;
> >#ifndef NO_BUG
> >  retval->_d(1);
> >#else
> >  UY y;
> >  y.vx(1);
> >  retval->y(y);
> >#endif
> >  return retval._retn();
> >}
> >
> >
> >In case, when NO_BUG is not defined, we receive
> >Marshall exception in client during reciving of V
> >
> >satory$./eg2_clt `cat x` -ORBtraceLevel 11
> >omniORB: gateKeeper is tcpwrapGK 1.0 - based on tcp_wrappers_7.6
> >omniORB configuration file: /etc/omniORB.cfg either does not exist or is
> >not a file.
> >omniORB: The omniDynamic library is not linked.
> >omniORB: Creating ref to remote: root<0>
> > target id      : IDL:omg.org/CORBA/Object:1.0
> > most derived id: IDL:Bug1:1.0
> >omniORB: LocateRequest to remote: root<0>
> >omniORB: throw MARSHAL from nbufferedStream.cc:319
> >omniORB: tcpSocketStrand::~Strand() close socket no. 3
> >Caught a CORBA::SystemException.
> >
> >Archive with complete programs (based on echo), reproducing this bug is
> >attached.
> >
> >
> >
> >
> >
> >
> >
> >
> >if we create empty v, we can't send it via CDR.
> >
> >[demime 0.97b removed an attachment of type application/x-gzip which had a
> name of bug1.tar.gz]