[omniORB-dev] omniORB 4.0.1 destroy race condition

Teemu Torma teemu at torma.org
Thu May 8 22:51:56 BST 2003


To whom it may concern.

Whilst testing forthcoming valgrind 1.9.6 snapshot with omniORB 
application, it started reporting of mutex being unlocked by another 
thread than locker, or destroying a mutex still in use.

By reviewing poa.cc it seems that this problem can happen in two 
different places where we are doing

     while( pd_destroyed != 2 )  pd_deathSignal.wait();

but not holding a reference to the poa.  Thus when pd_deathSignal.wait() 
returns, in re-aquires the pd_lock, but at that point the poa might be 
being destructed or already completely deleted depending on the 
scheduling issues.

By making the necessary changes to have a reference count to the poa in 
these two places, the problem went away, and valgrind has been happy 
ever since.  Please see the attached patch.

Teemu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: poa.diff
Type: text/x-diff
Size: 1627 bytes
Desc: not available
Url : http://www.omniorb-support.com/pipermail/omniorb-dev/attachments/20030508/0cee42b1/poa.bin


More information about the omniORB-dev mailing list