FW: [omniORB] Is this a Bug in OmniORB??

S. Sahayaraj ssahayaraj@quark.co.in
Wed Aug 7 15:09:01 2002


Hi Bjorn,
	Yes.. You are right. I too agree. If you're looking deeply into the
marshalling logic of return values, then you could see the different
behaviour for NULL pointers in OmniORB.

	But still the problem is not solved. The following is the piece of
code which throws the exception. These are in GIOP_s.cc file under \OmniORB
4\Orbcore folder.

	void GIOP_S::SendReply() {

  OMNIORB_ASSERT(pd_state == WaitingForReply);

  if (!response_expected()) throw terminateProcessing();

  pd_state = ReplyIsBeingComposed;
  impl()->outputMessageBegin(this,impl()->marshalReplyHeader);  
  calldescriptor()->marshalReturnedValues((cdrStream&)*this);
  impl()->outputMessageEnd(this);
  pd_state = ReplyCompleted;
}

Case 1:
	If we return NULL, then impl()->marshalReplyHeader throws the
exception. 

	This is illegal one. So just forget it.

Case 2 :
	If we return either Object::_nil() or MyObject::_nil() then it gives
the exception in calldescriptor()->marshalReturnedValues((cdrStream&)*this);

	My question here is why this two different behaviour is happening
eventhough the same calldescriptor is doing the marshalling for same
returnvalues. You can get this value if you debug the OmniORB code.

Thank you.


--Sahay.

 


-----Original Message-----
From: bjorn rohde jensen [mailto:bjensen@fastmail.fm]
Sent: Wednesday, August 07, 2002 7:12 PM
To: S. Sahayaraj
Cc: omniorb-list@realvnc.com
Subject: Re: FW: [omniORB] Is this a Bug in OmniORB??


Hi Sahay,

 Well, you usually dont actually return
CORBA::objects. You return references to
servants incarnating Objects exposing the interfaces
defined in your idl, so you should definately
not try to pass CORBA::_nil() reference, where
a MyObject reference is expected. That would
correspond to an invalid cast, possibly with all
sorts of nasty effects or just compile error.
 You could do something like;

MyObject getValue(int objectID)
{
 return MyObject::_nil();
}

That ought to work. Not checked it though;)

Yours sincerely,

Bjorn