[Mono-bugs] [Bug 464628] New: WARNING **: _wapi_handle_unref: Attempting to unref unused handle on a ProcessTest case.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Jan 8 15:49:34 EST 2009


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


           Summary: WARNING **: _wapi_handle_unref: Attempting to unref
                    unused handle on a ProcessTest case.
           Product: Mono: Runtime
           Version: SVN
          Platform: i686
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: misc
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: spigaz at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Other


I'm getting the message
WARNING **: _wapi_handle_unref: Attempting to unref unused handle on a
ProcessTest case.

trunk/mcs/class/System/Test/System.Diagnostics/ProcessTest.cs:TestEventRaising

I just copied it to a plain main:

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

public class A
{
                // Plain copy paste from test
trunk/mcs/class/System/Test/System.Diagnostics/ProcessTest.cs:TestEventRaising
                public static void Main()
                {
                        EventWaitHandle errorClosed = new
ManualResetEvent(false);
                        EventWaitHandle outClosed = new
ManualResetEvent(false);
                        EventWaitHandle exited = new ManualResetEvent(false);

                        Process p = new Process();
                        p.StartInfo.UseShellExecute = false;
                        p.StartInfo.RedirectStandardOutput = true;
                        p.StartInfo.RedirectStandardError = true;
                        p.StartInfo.RedirectStandardInput = false;
                        p.OutputDataReceived += (object sender,
DataReceivedEventArgs e) => {
                                if (e.Data == null) {
                                        outClosed.Set();
                                }
                        };

                        p.ErrorDataReceived += (object sender,
DataReceivedEventArgs e) => {
                                if (e.Data == null) {
                                        errorClosed.Set();
                                }
                        };

                        p.Exited += (object sender, EventArgs e) => {
                                exited.Set ();
                        };

                        p.EnableRaisingEvents = true;

                        //if (RunningOnUnix){
                                p.StartInfo.FileName = "/bin/ls";
                                p.StartInfo.Arguments = "/";
                        /*} else {
                                p.StartInfo.FileName = "help";
                                p.StartInfo.Arguments = "";
                        }*/

                        p.Start();

                        p.BeginErrorReadLine();
                        p.BeginOutputReadLine();

                        Console.WriteLine("started, waiting for handles");
                        bool r = WaitHandle.WaitAll(new WaitHandle[] {
errorClosed, outClosed, exited }, 10000, false);

                        //Assert.AreEqual (true, r, "Null Argument Events
Raised");
                        System.Console.WriteLine(r);
                }
}

If the machine is slow/busy enought the message appears all the time even on
this simple in out use. On faster machines sometimes it doesn't on this simple
app, but it does on long lasting apps.

I tried two simplifications, one invoking the events directly without delegates
and process invocation, and I couldn't reproduce it, perhaps because it gets a
lot faster. I tried also with static methods and it also gets a lot faster, but
I was able to reproduce it only once, on a very slow and busy machine.

I know that the message is harmless, but my app uses more or less the same
pattern and is getting hundreds of messages like those.


-- 
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