[omniORB] Bug in corbaBoa.cc #876

tihomir.sokcevic@acterna.com tihomir.sokcevic@acterna.com
Wed May 29 14:52:03 2002


Hi,

with  entry->setDead(); the entry is deleted and afterwards id->servant() is
deleted => entry is a downcasted id!

Regards

void
omniOrbBOA::lastInvocationHasCompleted(omniLocalIdentity* id)
{
  ASSERT_OMNI_TRACEDMUTEX_HELD(*omni::internalLock, 1);

  omniObjTableEntry* entry = omniObjTableEntry::downcast(id);
  OMNIORB_ASSERT(entry);
  // This function should only ever be called with a localIdentity
  // which is an objectTableEntry, since those are the only ones which
  // can be deactivated.

  if( omniORB::trace(15) ) {
    omniORB::logger l;
    l << "BOA etherealising object.\n"
      << " id: " << id->servant()->_mostDerivedRepoId() << "\n";
  }

  entry->setEtherealising();
  omniServant * pServant = id->servant();                         //fixes access
 to deleted object
  entry->setDead();

  omni::internalLock->unlock();
  delete pServant;                                 //fixes access to deleted
object
  met_detached_object();
}