[Mono-bugs] [Bug 46133][Wis] New - mono remoting error

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Thu, 10 Jul 2003 22:58:45 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by weilu@21cn.com.

http://bugzilla.ximian.com/show_bug.cgi?id=46133

--- shadow/46133	Thu Jul 10 22:58:45 2003
+++ shadow/46133.tmp.591	Thu Jul 10 22:58:45 2003
@@ -0,0 +1,188 @@
+Bug#: 46133
+Product: Mono/Runtime
+Version: unspecified
+OS: 
+OS Details: win2k pro SP3
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: weilu@21cn.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mono remoting error
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+.NET remoting program assert fails when exit.
+
+Steps to reproduce the problem:
+1. 
+//mcs -r:ServerObject.dll -r:System.Runtime.Remoting.dll RemotingServer.cs
+using System;
+using System.Runtime.Remoting;
+using System.Runtime.Remoting.Channels;
+using System.Runtime.Remoting.Channels.Tcp;
+
+namespace RemotingTest
+{
+        class RemotingServer
+        {
+                static int Main () 
+                {
+                        Console.WriteLine("Starting Server");
+                        TcpChannel ch = new TcpChannel(1122);
+                        ChannelServices.RegisterChannel (ch);
+
+                        ServerList ser = new ServerList();
+                        RemotingServices.Marshal(ser,"test.rem");
+
+                        Console.WriteLine("Server Running ...");
+                        Console.ReadLine();
+
+                        ch.StopListening (null);
+
+                        return 0;
+                }
+        }
+}
+
+it runs well. but when i press enter to terminate it, even without any
+client access ever, an error dialog pops:
+*** ERROR ***: file threads.c: line 885
+(ves_icall_System_Threading_Thread_Abort): should not be reached aborting...
+
+if i comment the line: ch.StopListening (null);
+the error message in console becomes:
+** (remotingserver.exe:18668): CRITICAL **: file mono-hash.c: line 396
+(mono_g_h
+ash_table_remove): assertion `hash_table != NULL' failed
+
+Actual Results:
+Expected Results:
+
+How often does this happen? 
+every time
+
+Additional Information:
+
+this is what i'm using:
+Mono JIT compiler version 0.25, (C) 2002, 2003 Ximian, Inc.
+on Windows 2000 Pro SP3.
+
+The ServerObject used in above problem is as follows.
+
+//mcs -t:library ServerObject.cs
+using System;
+using System.Runtime.Remoting;
+using System.Collections;
+
+namespace RemotingTest
+{
+        // A list of ServerObject instances
+
+        public class ServerList: MarshalByRefObject
+        {
+                ArrayList values = new ArrayList();
+
+                public void Add (ServerObject v)
+                {
+                        values.Add (v);
+                        System.Console.WriteLine ("Added " + v.Name);
+                }
+
+                public void ProcessItems ()
+                {
+                        System.Console.WriteLine ("Processing...");
+
+                        int total = 0;
+                        foreach (ServerObject ob in values)
+                                total += ob.GetValue();
+
+                        System.Console.WriteLine ("Total: " + total);
+                }
+
+                public void Clear()
+                {
+                        values.Clear();
+                }
+                
+                public ServerObject NewItem(string name)
+                {
+                        ServerObject obj = new ServerObject(name);
+                        Add (obj);
+                        return obj;
+                }
+
+                public ComplexData SetComplexData (ComplexData data)
+                {
+                        System.Console.WriteLine ("Showing content of
+ComplexData");
+                        data.Dump ();
+                        return data;
+                }
+        }
+                
+        // A remotable object
+
+        public class ServerObject: MarshalByRefObject
+        {
+                int _value;
+                string _name;
+
+                public ServerObject (string name)
+                {
+                        _name = name;
+                }
+
+                public string Name
+                {
+                        get { return _name; }
+                }
+
+                public void SetValue (int v)
+                {
+                        System.Console.WriteLine ("ServerObject " + _name +
+": setting " + v);
+                        _value = v;
+                }
+
+                public int GetValue ()
+                {
+                        System.Console.WriteLine ("ServerObject " + _name +
+": getting " + _value);
+                        return _value;
+                }
+        }
+
+        // Some complex data for testing serialization
+
+        public enum AnEnum { a,b,c,d,e };
+
+        [Serializable]
+        public class ComplexData
+        {
+                public AnEnum Val = AnEnum.a;
+                public object[] Info;
+
+                public ComplexData (AnEnum va, object[] info)
+                {
+                        Info = info;
+                        Val = va;
+                }
+
+                public void Dump ()
+                {
+                        System.Console.WriteLine ("Content:");
+                        System.Console.WriteLine ("Val: " + Val);
+                        foreach (object ob in Info)
+                                System.Console.WriteLine ("Array item: " + ob);
+                }
+        }
+}