[Mono-list] Error with simple threading application on Win32 (threads.c: line 923 (ves_icall_System_Threading_Thread_Abort) should not be reached)

Louis R. Marascio marascio@metreos.com
Sun, 1 Feb 2004 16:25:51 -0600


This is a multi-part message in MIME format.

------=_NextPart_000_0020_01C3E8E0.11379700
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hello,

I'm investigating the fesability of porting our currently MS .NET 1.1 =
app to
Mono. In writing a few tests I came across what appears to be a critical
error. I have a simple application that registeres a TCP remoting =
channel
and then creates a client of the server object.  It executes a method =
100
times and then exits.  Every time it exits I get this error:

**ERROR**: file threads.c: line 923
(ves_icall_System_Threading_Thread_Abort): should not be reached =
aborting...

I've managed to create a very simple test case that reproduces this =
behavior
consistently, every time I run it.  It is attached here as Class1.cs.

The problem occurs when using mono and mint.  The same application works
without issue using Microsoft's runtime.

Any thoughts?

Thanks!

Louis

---
Louis R. Marascio
Metreos Corporation
o: +1 (512) 437 7903
m: +1 (832) 768 4609
e: marascio@metreos.com=20

------=_NextPart_000_0020_01C3E8E0.11379700
Content-Type: text/plain;
	name="Class1.cs"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="Class1.cs"

using System;
using System.Threading;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;

namespace TestApp=20
{
    #region Remoting Server

    public class HelloServer : MarshalByRefObject=20
    {
        public HelloServer()=20
        {
            Console.WriteLine("HelloServer activated ({0})", =
this.GetHashCode());
        }

        public void HelloMethod(String name)=20
        {
            Console.WriteLine("Hello.HelloMethod ({0}) : {1}", =
this.GetHashCode(), name);
        }
    }

    public class QueueWriterLookupServer=20
    {
        private static TcpChannel chan;

        public static void StartServer()=20
        {
            chan =3D new TcpChannel(8088);

            try
            {
                ChannelServices.RegisterChannel(chan);
            }
            catch(Exception)
            {}

            RemotingConfiguration.RegisterWellKnownServiceType(
                Type.GetType("TestApp.HelloServer"),
                "SayHello",=20
                WellKnownObjectMode.Singleton);

            return;
        }

        public static void StopServer()
        {
            ChannelServices.UnregisterChannel(chan);
        }
    }

    #endregion

    class Tester
    {
        [STAThread]
        static void Main(string[] args)
        {
            // Start the server
            QueueWriterLookupServer.StartServer();

            // Create a client of the server object
            HelloServer obj =3D (HelloServer)Activator.GetObject(
                typeof(HelloServer),
                "tcp://localhost:8088/SayHello");

            if (obj =3D=3D null)=20
            {
                Console.WriteLine("Could not locate server");
            }
            else=20
            {
                for(int i =3D 0; i < 100; i++)
                {
                    // Call the method on the server object
                    obj.HelloMethod("Caveman" + i);
                }
            }

            // Stop the server
            QueueWriterLookupServer.StopServer();
        }
    }
}
------=_NextPart_000_0020_01C3E8E0.11379700--