[omniORB] Strange access violation -- What do you think?

Sai-Lai Lo S.Lo@orl.co.uk
26 Aug 1998 22:30:46 +0100


Brenneis,

Are you using omniORB_2.5.0?  There is a bug in Strand::SyncWrTimedLock()
which has been fixed in snapshot_980410.  If you have already using that
version, then we have to dig deeper.


-------- src/lib/omniORB2/strand.cc ------------------------
CORBA::Boolean
Strand::
Sync::WrTimedLock(Strand* s,
		  CORBA::Boolean& heartbeat,
		  unsigned long secs,
		  unsigned long nanosecs)
{
  CORBA::Boolean notimeout;
  // Note: the caller must have got the mutex s->pd_rope->pd_lock 
  while (s->pd_wr_nwaiting < 0) {
    s->pd_wr_nwaiting--;
    notimeout = s->pd_wrcond.timedwait(secs,nanosecs);
    if (s->pd_wr_nwaiting >= 0)
      s->pd_wr_nwaiting--;
    else
      s->pd_wr_nwaiting++;
    if (!notimeout && s->pd_wr_nwaiting < 0) {
      // give up;
      return 0;
    }
  }
  s->pd_wr_nwaiting = -s->pd_wr_nwaiting - 1;
  
  CORBA::Boolean hb = s->pd_heartbeat;
  s->pd_heartbeat = heartbeat;
  heartbeat = hb;
  return 1;
}
---------------------------------------------------------------


Sai-Lai


-- 
Dr. Sai-Lai Lo                          |       Research Scientist
                                        |
E-mail:         S.Lo@orl.co.uk          |       Olivetti & Oracle Research Lab
                                        |       24a Trumpington Street
Tel:            +44 223 343000          |       Cambridge CB2 1QA
Fax:            +44 223 313542          |       ENGLAND