[Mono-bugs] [Bug 379524] New: Environment. Exit in separate thread results in thread creation failure

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Apr 13 04:59:46 EDT 2008


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


           Summary: Environment.Exit in separate thread results in thread
                    creation failure
           Product: Mono: Runtime
           Version: SVN
          Platform: All
        OS/Version: Windows XP
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: misc
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: gert.driesen at pandora.be
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Invoking Environment.Exit in a separate thread results in a thread creation
failure.

To reproduce, compile and run the following code snippet:

using System;
using System.Globalization;
using System.Threading;

class Program
{
  static int Main (string [] args)
  {
    for (int i = 0; i < 1000; ++i) {
      Thread thread = new Thread (new ThreadStart (Test));
      if (i != 500)
        thread.CurrentCulture = new CultureInfo ("en-CA");
      thread.Start ();
    }
    return 1;
  }

  static void Test ()
  {
    string name = Thread.CurrentThread.CurrentCulture.Name;
    if (name != "en-CA")
      Environment.Exit (0);
  }
}

Expected result:

Successful execution (exit code 0)

Actual result:

(test.exe:4740): WARNING **: ves_icall_System_Threading_Thread_Thread_internal:
CreateThread error 0x8

Unhandled Exception: System.SystemException: Thread creation failed.
   at System.Threading.Thread.Start () [0x00000]
   at Program.Main (System.String[] args) [0x00000]


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