Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report for Bug 51658 on
GitHub or Developer Community if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
Created attachment 19413 [details]
Test case to reproduce issue
BeginInvoke does not work over RealProxy if the following conditions are met:
- the server runs under Mono
- the client runs under the .NET runtime
- the function being called has no out or ref parameters
All other combinations of Mono/.NET for the client and the server appear to work properly. Likewise, if at least one parameter of the function has an out or ref attribute, everything works as expected.
Attached is a test case (based on the Microsoft sample found at https://msdn.microsoft.com/en-us/library/ms973857.aspx). In order to test it, run server.exe without arguments, then run client.exe with the server’s IP address as its argument.
Actual output (when the client runs on Windows):
Unhandled Exception: System.OverflowException: Arithmetic operation resulted in an overflow.
at System.Runtime.Remoting.Proxies.RealProxy.PropagateOutParameters(IMessage msg, Object outArgs, Object returnValue)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at RemotingBug.Client.HelloMethodDelegate.EndInvoke(IAsyncResult result)
at RemotingBug.Client.Main(String args)
When investigating this issue I found an obvious bug in mcs/class/System.ServiceModel/System.ServiceModel/ClientRealProxy.cs where the variable outArgs is never actually constructed, but is used to build a return value. I also found about this bug and associated patch: https://bugzilla.xamarin.com/show_bug.cgi?id=11414 which might be related.