OSSP CVS Repository

ossp - Ticket #67
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Attach]  [Edit]  [History

Ticket 67: MM_LOCK_RD mode does not work correctly with MM_SEMT_IPCSEM

Calls to mm_core_lock from mm_alloc.c with mode=MM_LOCK_RD cause deadlock sometimes (MM_SEMT_IPCSEM is defined in config.h).

To reproduce the problem I have one daemon process that created shared MM region and went to sleep (waiting for a messages) and a number of other processes which are being started repeatedly in endless script while doing the following:
[Append remarks]

Remarks:

MM package was used in a multiprocess environment where communicating processes (using the same shared memory region) are NOT related, therefore in a multireader scenario we easily can get into situation when a process will try to unlock a semaphore (when number of readers goes to 0) which was locked by some other process (the first reader). Of course, it won't work. I was able to prove (with some debug printouts added) that it's exactly what happens.

In MM description one can read: "..usage of shared memory between forked (and this way strongly related) processes..." and this requirement was obviously violated. I believe that the only reasonable workaround for our environment is the one I already have - not to use MM_LOCK_RD locking mode but only MM_LOCK_RW.
[Append remarks]

Properties:

Type: code           Version: 1.4.0 
Status: closed          Created: 2005-Sep-29 23:54
Severity:          Last Change: 2005-Dec-14 19:32
Priority:          Subsystem: mm 
Assigned To: rse           Derived From:  
Creator: anonymous 

CVSTrac 2.0.1