[Mono-bugs] [Bug 61687][Cri] New - Shared Mutex problems after any process exits

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sat, 17 Jul 2004 01:22:16 -0400 (EDT)

Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by cgaisford@novell.com.


--- shadow/61687	2004-07-17 01:22:16.000000000 -0400
+++ shadow/61687.tmp.6657	2004-07-17 01:22:16.000000000 -0400
@@ -0,0 +1,50 @@
+Bug#: 61687
+Product: Mono: Runtime
+Version: unspecified
+OS: Red Hat 9.0
+OS Details: 
+Status: NEW   
+Priority: Critical
+Component: misc
+AssignedTo: dick@ximian.com                            
+ReportedBy: cgaisford@novell.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+Summary: Shared Mutex problems after any process exits
+Description of Problem:
+When using a named mutex to protect resources across mutiple threads and
+processes, the mutex appears to become corrupt or lost after the first
+process exits.  It doesn't matter if the first process to exit is the main
+thread or a child thread, the Mutex is useless at that point.
+Any further calls to ReleaseMutex will result in an error being written to
+the console about a failure to lookup the Mutex.  The WaitOne call will
+begin to return False and not block on the named mutex as well.
+Steps to reproduce the problem:
+1. Complile the attached file "NewMutexText.cs"
+2. Run it
+3. Watch it crash and burn
+Actual Results:
+After the first process exits, many messages will be displayed about not
+being able to lookup the Mutex.  When the next process comes to an end, it
+and all other processes and threads using the named mutex will hang.
+Expected Results:
+The app should execute all threads and processes normally and exit cleanly
+as it does when run on Windows using .Net.
+After building the assembly, it can be copied to a Windows box with .Net
+and run.
+How often does this happen? 
+Every time the application is run
+Additional Information:
+I wrote an app that used a FileStream class with FileShare.None as a
+replacement mutex and it ran fine on both SuSE 9.1 and RedHat 9.