[omniORB] omniORB 3.0 eg1 crashes on VMS Alpha

Bruce Visscher visschb@rjrt.com
Thu, 07 Oct 1999 15:53:43 -0400


Hello,

Well, I think I was wrong about it being an initialization order
problem.

I think the culprit here is that omni_thread::self() is not reliable on
OpenVMS Alpha V7.1 once the return from main is executed.  Once that
happens, the debugger reports that I'm in THREAD 4294967293 (main
executes in THREAD 1) and omni_thread::self() returns 0.  I find this
odd, but I don't know if it's non-conforming with the POSIX 1003.1c
standard.  Does anyone know?

In any case, the following patch fixes the problem.

---------------------------------------------------------------------------------
*** tracedthread.cc	Wed Sep 22 10:27:14 1999
--- tracedthread-vmsworkaround.cc	Thu Oct 07 14:46:08 1999
***************
*** 79,85 ****
  
    omni_mutex_lock sync(pd_lock);
  
!   if( pd_holder == me ) {
      omniORB::log <<
        "omniORB: Assertion failed -- attempt to lock mutex when already
held.\n"
        " This is a bug in omniORB. Please submit a report (with
stack\n"
--- 79,85 ----
  
    omni_mutex_lock sync(pd_lock);
  
!   if( pd_holder && pd_holder == me ) {
      omniORB::log <<
        "omniORB: Assertion failed -- attempt to lock mutex when already
held.\n"
        " This is a bug in omniORB. Please submit a report (with
stack\n"
***************
*** 130,135 ****
--- 130,138 ----
      omni_thread* me = omni_thread::self();
  
      if(  yes && pd_holder == me || !yes && pd_holder != me )
+       return;
+ 
+     if ( !yes && !me && !pd_holder )
        return;
    }
  
---------------------------------------------------------------------------------