[Mono-bugs] [Bug 422491] New: Remoting: Passing ObjRef from Windows to Mono throws " Object type System.Int64 cannot be converted to target type: System.Int32"

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Sep 3 06:50:58 EDT 2008


           Summary: Remoting:  Passing ObjRef from Windows to Mono throws
                    "Object type System.Int64 cannot be converted to target
                    type: System.Int32"
           Product: Mono: Runtime
           Version: SVN
          Platform: 64bit
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: remoting
        AssignedTo: lluis at novell.com
        ReportedBy: steffen.enni at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

Created an attachment (id=237057)
 --> (https://bugzilla.novell.com/attachment.cgi?id=237057)
Example reproducing the behavior.

I have a server and a client, both implementing the below IHello interface. 
When the client calls HelloWithCallback() the server performs a callback on
remoteRef.Hello() to the client.

Client                             Server
 ---(return from Hello)------------->
 <--(return from HelloWithCallback)--

    public interface IHello
        void HelloWithCallback(string sender, IHello remoteRef);
        void Hello(string sender);

When both Client and Server runs on Mono (or both on Windows) this works.
Likewise the Client on mono and server on windows it also works.

But when the Server is on Mono and the Client is on windows the invocation of
HelloWithCallback() fails with the below exception:

I suspect this is similar to case 381555.

I've attached a case reproducing the behavior. It can be compiled on Mono using
MonoDevelop and on Windows using Visual Studio 2008.

Unhandled Exception: System.ArgumentException: Object type System.Int64 cannot
be converted to target type: System.Int32
Parameter name: val

Server stack trace:
  at System.Reflection.MonoField.SetValue (System.Object obj, System.Object
val, BindingFlags invokeAttr, System.Reflection.Binder binder, Syste
m.Globalization.CultureInfo culture) [0x00000]
  at System.Reflection.FieldInfo.SetValue (System.Object obj, System.Object
value) [0x00000]
  at System.Runtime.Serialization.FormatterServices.PopulateObjectMembers
(System.Object obj, System.Reflection.MemberInfo[] members, System.Obj
ect[] data) [0x00000]
(System.Object obj, Int64 id, System.Boolean& hasFixup) [0x
  at System.Runtime.Serialization.Formatters.Soap.SoapReader.DeserializeObject
(System.Type type, Int64 id, Int64 parentId, System.Reflection.Me
mberInfo parentMemberInfo, System.Int32[] indices) [0x00000]
  at System.Runtime.Serialization.Formatters.Soap.SoapReader.Deserialize ()
  at System.Runtime.Serialization.Formatters.Soap.SoapReader.Deserialize
(System.IO.Stream inStream, ISoapMessage soapMessage) [0x00000]
  at System.Runtime.Serialization.Formatters.Soap.SoapFormatter.Deserialize
(System.IO.Stream serializationStream, System.Runtime.Remoting.Messa
ging.HeaderHandler handler) [0x00000]
  at System.Runtime.Serialization.Formatters.Soap.SoapFormatter.Deserialize
(System.IO.Stream serializationStream) [0x00000]
  at System.Runtime.Remoting.Channels.SoapServerFormatterSink.ProcessMessage
(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransport
Headers requestHeaders, System.IO.Stream requestStream, IMessage& responseMsg,
ITransportHeaders& responseHeaders, System.IO.Stream& responseStr
eam) [0x00000]

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
msgData, Int32 type)
   at Interface.IHello.HelloWithCallback(String sender, IHello remoteRef)
   at Client.Program.Main(String[] args) in
D:\Projects\Constellation\mono\PassingObjRef\Client\Program.cs:line 46

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the mono-bugs mailing list