[Mono-list] mcs: Threading error

Christopher A. Brooks cab938@mail.usask.ca
Fri, 10 May 2002 11:22:29 -0600


Hi all,

I'm just getting start with both .net and mono, so forgive me if this is a
pretty newbie question.  Here's what I get when I compile:

cab938> mcs Class1.cs

** (process:21634): WARNING **: unhandled exception
System.NullReferenceException: "A null value was found where an object
instance was required"
in (unmanaged) System.IO.MonoIO:FindNextFile ()
in 25c System.IO.Directory:GetFileSystemEntries ()
in 04d Mono.CSharp.Driver:CompileFiles ()
in 15b8 Mono.CSharp.Driver:MainDriver ()
in 00b Mono.CSharp.Driver:Main ()

It works fine in Visual Studio on win 2k. I'm trying to compile it on the
May 10th, 2002 mono 0.11 rpm provided by baselabs on mandrake 8.2 linux.  In
short, the source just trys to spawn two threads pointing at static methods
as below:

using System;
using System.Threading;

namespace CompatabilityTest{
 class Class1{
  [STAThread]
  static void Main(string[] args){
   Console.Out.WriteLine("Testing Threads:");
   Thread t = new Thread( new ThreadStart( Function.Increment ) );
   Thread t2 = new Thread( new ThreadStart( Function.Decrement ) );
   t.Start();
   t2.Start();
  }
 }

 class Function{
  public static void Increment(){
   for ( int i = 0 ; i < 99999 ; i ++ )
    Console.Out.WriteLine( "inc: " + i );
  }

  public static void Decrement(){
   for ( int i = 99999 ; i > 0 ; i -- )
    Console.Out.WriteLine( "dec: " + i );
  }
 }
}

When I pull the binary over from the windows box it is able to run for
"awhile", and I get:

cab938> mono myfile.exe
{normal execution}
inc: 4362
inc: 4363
inc: 4364
inc: 4365

** ERROR **: file unicode.c: line 390 (iconv_convert): should not be reached
aborting...
inc: 4366
inc: 4367
inc: 4368
inc: 4369
inc: 4370Abort
cab938>

Suggestions?  Thanks for any pointers, just trying to get some simple
threading stuff running!  Cya,

Chris
--
Christopher A. Brooks
Graduate Student, U of S

Email: cab938@mail.usask.ca
Mail: Christopher Brooks
        Department of Computer Science
        University of Saskatchewan
        57 Campus Drive
        Saskatoon, Saskatchewan, S7N 5A9
        Canada