[Mono-bugs] [Bug 389500] New: Exit code of forked process is mangled

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon May 12 15:07:30 EDT 2008


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


           Summary: Exit code of forked process is mangled
           Product: Mono: Runtime
           Version: SVN
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: io-layer
        AssignedTo: dick at novell.com
        ReportedBy: gert.driesen at pandora.be
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


On Linux, the exit code of a forked process is not correctly returned by
Process.ExitCode.

To reproduce, compile and run the following code (using mcs test.cs):

using System;
using System.Diagnostics;
using System.IO;

class Program
{
  static int Main (string [] args)
  {
    string basedir = AppDomain.CurrentDomain.BaseDirectory;

    if (args.Length == 0) {
      Process p = new Process ();
      p.StartInfo.FileName = "mono";
      p.StartInfo.Arguments = Path.Combine (basedir, "test.exe") + " fork";
      p.Start ();
      p.WaitForExit ();
      Console.WriteLine ("Exit code: " + p.ExitCode);
    } else {
      return 666;
    }

    return 0;
  }
}

Expected result:

The following output is written to stdout:

Exit code: 666

Actual result:

The following output is written to stdout:

Exit code: 154


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


More information about the mono-bugs mailing list