[omniORB] Re: AIX Problems

Sai-Lai Lo S.Lo@uk.research.att.com
23 Sep 1999 10:56:11 +0100


Gary,

Your first problem with 2.7.1 is a known bug and has been fixed in omniORB
2.8.0.

The problem was that NetBufferedStream::RdUnlock() and WrUnlock() shouldn't
call giveback_*() when the strand is already dying.

The fix is:

void
NetBufferedStream::RdUnlock() {
  if (pd_RdLock) {
    if (!strandIsDying()) giveback_received();
    Strand_Sync::RdUnlock();
    pd_RdLock = 0;
  }
  return;
}

void
NetBufferedStream::WrUnlock() {
  if (pd_WrLock) {
    if (!strandIsDying()) giveback_reserved();
    Strand_Sync::WrUnlock();
    pd_WrLock = 0;
  }
  return;
}


Your second build problem is fixed in omniORB 2.8.0. Please go directly to
omniORB 2.8.0, instead of building 2.8.0pre2 as I have made some last
minute cleanup to the scavenger code. Its time to checkout the CVS
server!

Sai-Lai


>>>>> Gary D Duzan writes:

> Heh. Let's try this again... (Maybe I should just turn on automime...)

>    I've encountered some issues with OmniORB on AIX: one with 2.7.1 and
> one with 2.8.0pre2.
>    The first has to do with exception handling. In
> tcpSocketStrand::ll_send(), a CORBA::COMM_FAILURE is called. While the
> stack is being unwound, the GIOP_S object in GIOP::dispatcher() is
> destroyed. As part of the destructor, the NetBufferedStream is being
> destroyed. Something that the destructor for NetBufferedStream calls is
> throwing an exception which is not caught, which confuses AIX since we
> are already in an exception handling context, with a crash with the
> following stack trace:

>         pthread_kill()
>         raise()
>         abort()
>         terminate()
>         __Invoke__Destructor()
>         __DoThrow()
>         tcpSocketStrand::ll_send(void*,unsigned long)
>         reliableStreamStrand::transmit()
>         reliableStreamStrand::giveback_reserved(unsigned long, unsigned char, unsigned char)
>         NetBufferedStream::giveback_reserved(unsigned char, unsigned char)
>         NetBufferedStream::flush(unsigned char)
>         GIOP_S::SendMsgErrorMessage()
>         GIOP_S::HandleRequest(unsigned char)
>         GIOP::dispatcher(Strand*)
>         tcpSocketWorker::_realRun(void*)
>         omniORB::giopServerThreadWrapper::run(void(*)(void*),void*)
>         tcpSocketWorker::run(void*)
>         omni_thread_wrapper()
>         _pthread_body()
>         0x0000000000000000

> The following hack to nbufferedStream.cc allows the code to continue
> without a crash:

> 119,120c119,129
> <   RdUnlock();
> <   WrUnlock();
> ---
>> try {
>> RdUnlock();
>> }
>> catch(...) {
>> }
>> 
>> try {
>> WrUnlock();
>> }
>> catch(...) {
>> }
> I haven't looked more deeply into who is throwing the exception,
> but the main thing seems to be to keep it from escaping the
> destructor.

>    In 2.8.0pre2, I had to apply the following patch (on top of what
> Craig posted) to get it to compile on AIX 4.2.1 with xlC 3.1.4, which
> doesn't have a bool type built in.


-- 
Sai-Lai Lo                                   S.Lo@uk.research.att.com
AT&T Laboratories Cambridge           WWW:   http://www.uk.research.att.com 
24a Trumpington Street                Tel:   +44 1223 343000
Cambridge CB2 1QA                     Fax:   +44 1223 313542
ENGLAND