[Mono-bugs] [Bug 77191][Nor] New - Mono remoting runtime can not
resolve overload method during remote request method call
processing.
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Mon Jan 9 11:53:17 EST 2006
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 alex.gap at mail.ru.
http://bugzilla.ximian.com/show_bug.cgi?id=77191
--- shadow/77191 2006-01-09 11:53:17.000000000 -0500
+++ shadow/77191.tmp.28551 2006-01-09 11:53:17.000000000 -0500
@@ -0,0 +1,221 @@
+Bug#: 77191
+Product: Mono: Runtime
+Version: unspecified
+OS: GNU/Linux [Other]
+OS Details: Linux g2 2.6.12.1 #12 Wed Oct 26 02:26:02 EEST 2005 i686 unknown
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: remoting
+AssignedTo: lluis at ximian.com
+ReportedBy: alex.gap at mail.ru
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Summary: Mono remoting runtime can not resolve overload method during remote request method call processing.
+
+Description of Problem:
+Mono remoting runtime can not resolve overload method during remote request
+method call processing. Microsoft .NET implementation works with success
+for this case.
+
+Steps to reproduce the problem:
+Compile this file with gmcs (don't forget /r:System.Runtime.Remoting). Then
+run with mono <file.exe>:
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Runtime.Remoting.Channels;
+using System.Runtime.Remoting.Channels.Tcp;
+using System.Runtime.Remoting;
+using System.Net.Sockets;
+using System.Net;
+
+namespace MonoRemotingBug
+{
+ interface I1 : IDisposable
+ {
+ void Test1();
+ }
+
+ interface I2
+ {
+ void Test2();
+ void Test2(bool argument);
+ }
+
+ interface I3 : I1, I2
+ {
+ }
+
+ interface I4 : I1
+ {
+ }
+
+ interface I5 : I4, I3
+ {
+ }
+
+ class RemotedClass : MarshalByRefObject, I5
+ {
+ ~RemotedClass()
+ {
+ Dispose(false);
+ }
+
+ public void Test1()
+ {
+ Console.WriteLine("Test1 OK.");
+ }
+
+ public void Test2()
+ {
+ Console.WriteLine("Test2.1 OK");
+ }
+
+ public void Test2(bool argument)
+ {
+ Console.WriteLine("Test2.2 OK");
+ }
+
+ #region IDisposable Members
+
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ #endregion
+
+ protected virtual void Dispose(bool disposing)
+ {
+ if (disposing)
+ Console.WriteLine("Test3 OK");
+ }
+ }
+
+ class Program
+ {
+ static int FindFreePort()
+ {
+ Socket socket = new Socket(AddressFamily.InterNetwork,
+SocketType.Stream, ProtocolType.Tcp);
+ try
+ {
+ socket.Bind(new IPEndPoint(IPAddress.Any, 0));
+ return ((IPEndPoint)socket.LocalEndPoint).Port;
+ }
+ finally
+ {
+ socket.Close();
+ }
+ }
+
+ static void Main(string[] args)
+ {
+ try
+ {
+ int port = FindFreePort();
+ ChannelServices.RegisterChannel(new TcpChannel(port));
+ RemotedClass remotedClass = new RemotedClass();
+ RemotingServices.Marshal(remotedClass, "Root");
+ Console.WriteLine("Server started.");
+ try
+ {
+ I5 i = (I5)RemotingServices.Connect(typeof(I5),
+ string.Format("tcp://localhost:{0}/Root", port));
+ try
+ {
+ i.Test1();
+ i.Test2();
+ i.Test2(true);
+ i.Dispose();
+ }
+ catch
+ {
+ Console.WriteLine("Some test have failed. See
+pending error messages for details.");
+ throw;
+ }
+ Console.WriteLine("All OK, congradulations!");
+ }
+ finally
+ {
+ RemotingServices.Disconnect(remotedClass);
+ Console.WriteLine("Server stopped.");
+ }
+ }
+ catch (Exception e)
+ {
+ Console.Error.WriteLine(e);
+ }
+ }
+ }
+}
+
+Actual Results:
+Server started.
+Test1 OK.
+Test2.1 OK
+Test2.2 OK
+Some test have failed. See pending error messages for details.
+Server stopped.
+System.Reflection.AmbiguousMatchException: Ambiguous matching in method
+resolution
+
+Server stack trace:
+in <0x000a4> System.Reflection.Binder:FindMostDerivedMatch
+(System.Reflection.MethodBase[] match)
+in <0x0020a> System.MonoType:GetMethodImpl (System.String name,
+BindingFlags bindingAttr, System.Reflection.Binder binder,
+CallingConventions callConvention, System.Type[] types,
+System.Reflection.ParameterModifier[] modifiers)
+in <0x00023> System.Type:GetMethod (System.String name, BindingFlags
+bindingAttr)
+in <0x00051> System.Runtime.Remoting.RemotingServices:GetMethodBaseFromName
+(System.Type type, System.String methodName, System.Type[] signature)
+in <0x00058> System.Runtime.Remoting.Messaging.MethodCall:ResolveMethod ()
+in <0x0007e> System.Runtime.Remoting.Messaging.MethodCall:.ctor
+(System.Runtime.Remoting.Messaging.Header[] headers)
+in <0x005e6>
+System.Runtime.Serialization.Formatters.Binary.MessageFormatter:ReadMethodCall
+(System.IO.BinaryReader reader, Boolean hasHeaders,
+System.Runtime.Remoting.Messaging.HeaderHandler headerHandler,
+System.Runtime.Serialization.Formatters.Binary.BinaryFormatter formatter)
+in <0x000ba>
+System.Runtime.Serialization.Formatters.Binary.BinaryFormatter:NoCheckDeserialize
+(System.IO.Stream serializationStream,
+System.Runtime.Remoting.Messaging.HeaderHandler handler)
+in <0x00010>
+System.Runtime.Serialization.Formatters.Binary.BinaryFormatter:Deserialize
+(System.IO.Stream serializationStream,
+System.Runtime.Remoting.Messaging.HeaderHandler handler)
+in <0x00248>
+System.Runtime.Remoting.Channels.BinaryServerFormatterSink:ProcessMessage
+(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders
+requestHeaders, System.IO.Stream requestStream, IMessage responseMsg,
+ITransportHeaders responseHeaders, System.IO.Stream responseStream)
+
+Exception rethrown at [0]:
+
+in <0x006dc> System.Runtime.Remoting.Proxies.RealProxy:PrivateInvoke
+(System.Runtime.Remoting.Proxies.RealProxy rp, IMessage msg,
+System.Exception exc, System.Object[] out_args)
+
+
+Expected Results:
+Server started.
+Test1 OK.
+Test2.1 OK
+Test2.2 OK
+Test3 OK
+All OK, congradulations!
+Server stopped.
+
+How often does this happen?
+Always
+
+Additional Information:
More information about the mono-bugs
mailing list