[Mono-bugs] [Bug 81436][Maj] New - Problem with semaphores and mono-service

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Apr 24 06:39:01 EDT 2007


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 informatique.internet at fiducial.fr.

http://bugzilla.ximian.com/show_bug.cgi?id=81436

--- shadow/81436	2007-04-24 06:39:01.000000000 -0400
+++ shadow/81436.tmp.15217	2007-04-24 06:39:01.000000000 -0400
@@ -0,0 +1,96 @@
+Bug#: 81436
+Product: Mono: Runtime
+Version: 1.2
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: io-layer
+AssignedTo: dick at ximian.com                            
+ReportedBy: informatique.internet at fiducial.fr               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Problem with semaphores and mono-service
+
+Description of Problem:
+Each time I launch a mono-service, a new wapi semaphore is created...
+It's a regression because this behaviour is not present in mono 1.2.3
+
+Steps to reproduce the problem:
+1. try this cs:
+// project created on 24/04/2007 at 10:14
+using System;
+using System.Threading;
+
+namespace TestServices
+{
+	class MainClass : System.ServiceProcess.ServiceBase
+	{
+		bool b=true;
+		Thread traitementthread;
+		
+		public static void Main(string[] args)
+		{
+			System.ServiceProcess.ServiceBase[] ServicesToRun;
+			ServicesToRun = new System.ServiceProcess.ServiceBase[] { new MainClass() };
+			System.ServiceProcess.ServiceBase.Run(ServicesToRun);
+		}
+		
+		protected override void OnStart(string[] args)
+		{
+			// TODO : ajoutez ici le code pour démarrer votre service.
+			traitementthread=new Thread(new ThreadStart(Traitement ) );
+			traitementthread.Start();
+		}
+		
+		void Traitement()
+		{
+			while(b)
+			{
+				Thread.Sleep(100);
+				Console.WriteLine("hello");
+			}
+		}
+		
+		/// <summary>
+		/// Arrêt du service.
+		/// </summary>
+		protected override void OnStop()
+		{
+				b=false;
+			traitementthread.Join();
+		}
+	}
+}
+
+2. run ipcs -s : count the number of sem arrays
+3. run mono-service ./TestService.exe
+4. run ipcs -s : count the new number +1
+5. kill `cat /tmp/TestService.exe.lock`
+6. run ipcs -s : the semaphore created is not destroy
+
+7. if you re-run mono-service another one is created instead of using the
+previous one...
+
+
+Actual Results:
+
+It create as many sem arrays as launched services
+
+Expected Results:
+It should always use one semaphore array
+
+
+
+How often does this happen? 
+always
+
+Additional Information:
+present in mono 1.2.4 svn and 1.2.3.50 but not in 1.2.3
+
+If you run mono --wapi=hps you don't see the new handles created... where
+are they???


More information about the mono-bugs mailing list