[Mono-bugs] [Bug 465706] New: Process.Exited event not raised

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Jan 13 08:38:21 EST 2009


https://bugzilla.novell.com/show_bug.cgi?id=465706


           Summary: Process.Exited event not raised
    Classification: Mono
           Product: Mono: Class Libraries
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: rkvinge at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Created an attachment (id=264763)
 --> (https://bugzilla.novell.com/attachment.cgi?id=264763)
sleep.cs

Sample code (also attached).

using System.Threading;
using System;
using System.Diagnostics;
using System.Reflection;

class C
{
    static AutoResetEvent ExitedEvent = new AutoResetEvent (false);

    static void Main (string [] args)
    {
        Console.WriteLine ("Test, args: {0}", args.Length);

        if (args.Length > 0) {
            Console.WriteLine ("Sleeping {0} seconds", args [0]);
            Thread.Sleep (int.Parse (args [0]) * 1000);
            Console.WriteLine ("Sleeping [DONE]");
        } else {
            Process p = new Process ();
            p.StartInfo.FileName = "sleep";
            p.StartInfo.Arguments = "2";
            p.EnableRaisingEvents = true;
            p.Exited += delegate (object sender, EventArgs e)
            {
                Console.WriteLine ("Exited!");
                ExitedEvent.Set ();
            };
            p.Start ();

            Console.WriteLine ("Waiting...");
            ExitedEvent.WaitOne ();
            Console.WriteLine ("Waiting [DONE]");
        }

    }

}

Repro: save to sleep.cs, compile with gmcs and execute. 
Result: 
- It'll hang on r123038.
- It works on 1.9.1
- It works on MS

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list