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

Ruslan Shevchenko Ruslan@Shevchenko.Kiev.UA
Thu, 15 Jun 2000 14:15:56 +0300


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]