Bug 342211

Summary: Several remoting issues
Product: [Mono] Mono: Runtime Reporter: Johannes Paschold <oldpasch>
Component: remotingAssignee: Lluis Sanchez <lluis>
Status: RESOLVED DUPLICATE QA Contact: Mono Bugs <mono-bugs>
Severity: Normal    
Priority: P5 - None CC: robertj
Version: 1.2.5   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: c-sharp solution
sources

Description Johannes Paschold 2007-11-16 15:15:36 UTC
Created attachment 183707 [details]
c-sharp solution

This week i wrote a little test example to check mono's remoting capabilities. I found some strange behaviours which i'm not able to explain, so i just post my findings here - including a small c-sharp solution.

I used a mono 1.2.5 installation with fresh mono-charge package from 15th of november 07.

The test example constists of a server and a client. The server provides a simple service function GetString() and an event. When a client subscribes to the event, the server begins raising events via remoting.
Despite the fact that there obviously are errors when remoting between linux and windows it also shows that there seem to be differences in the ppc implementation of remoting which lead to different error patterns.

Test 1: works
------------------------------------------------------------------
- server compiled against mono, runs on linux-x86
- client compile against mono, runs on linux-x86

Test 2: does not work -> TypeLoadException at Activator.GetObject() (Error in this test case 2 may be relatet to #323447)
------------------------------------------------------------------
- server compiled against mono, runs on linux-x86
- client compiled against mono, runs on windows

Test 3: works
------------------------------------------------------------------
- server compiled against mono, runs on windows
- client compiled against mono, runs on windows

Test 4: works
------------------------------------------------------------------
- server compiled against mono, runs on windows
- client compiled against mono, runs on linux-x86


Things get even whorser when mono runs on ppc:


Test 5: does not work Activator.GetObject() returns null
------------------------------------------------------------------
- server compiled againgst mono, runs on linux-x86
- client compiled against mono, runs on linux-ppc


Test 6: does not work Activator.GetObject() returns null
------------------------------------------------------------------
- server compiled againgst mono, runs on windows
- client compiled against mono, runs on linux-ppc

Test 7: does not work, see detailed error description
------------------------------------------------------------------
- server compiled against mono, runs on linux-ppc
- client compiled against mono, runs on linux-x86

This test case is somewhat different to all: The connection is established. The simple Remoting function GetString() works, i.e. the client gets a string from the server.
Remoting in the other direction does NOT work, i.e. when the server raises an event, it catches a RemotingException ("Network is unreachable") and as a consequence the handler is not called in the client. Don't know whats going wrong there. Maybe this is a configuration problem??

Test 8: does not work -> TypeLoadException at Activator.GetObject() (Error in this test case may be relatet to #323447)
------------------------------------------------------------------
- server compiled against mono, runs on linux-ppc
- client compiled against mono, runs on windows


Hope someone can check whats going wrong there!

Regards,
jOe
Comment 1 Johannes Paschold 2007-11-16 15:20:19 UTC
Created attachment 183712 [details]
sources

original attachment was deleted??
Comment 2 Johannes Paschold 2007-11-16 15:23:16 UTC
if somone tests this:

run the server providing the ip the tcp channel should be bound to, e.g.

mono RemoteEventsTestServer.exe 192.168.0.1

run the client, providing the server ip to connect to, e.g.

mono RemoteEventsTestClient.exe 192.168.0.1

Thats, all.
Comment 3 Robert Jordan 2007-11-16 16:48:09 UTC
Support for remoting events between MS.NET and Mono has been implemented
after 1.2.5.

Please run your tests with 1.2.6, when it will be available.
Mono charges won't help, because they don't update the runtime.
Comment 4 Johannes Paschold 2008-01-16 15:59:08 UTC
Tested this with mono 1.2.6. Results are even worser!
Again, throwing and receiveing events over remoting does not work!

Results with 1.2.6:

Remoting server on linux, client on windows:
   - server starts and gets connection from client
   - client subscribes to event from server
   - server throws RemotingException (network unavailable) when trying to throw an event (though the connection from the client did succeed)
   - client does not receive results as a consequence

remoting server on window, client on linux:
   - server starts and gets connection from client
   - client subscribes to event from server
   - server throws SocketException when trying to throw an event
   - client crashes with System.ExecutionEngineException (SIGILL)

same happens when running both server and client on linux machines. there is no difference between ppc and x86 linux machines how ever it does not work though.
Could someone test this with the attached solution and make a proposal whats going wrong here?
Comment 5 Robert Jordan 2008-01-16 17:17:35 UTC
This is a dupe of the last part of bug #323447.

Your code is using generic event handlers which do not work in Mono
due to the mentioned bug.

Nevertheless, I'm looking at the PPC issue, since the runtime should
not be crashing like this.

BTW, you should rethink employing events in remoting according to this
document:

http://www.thinktecture.com/resourcearchive/net-remoting-faq/remotingusecases

Additionally, using generics in remoting interfaces is limiting
your channel+formatter choices: only the binary formatter is supporting
generics, regardless of the runtime (MS or Mono).
Comment 6 Robert Jordan 2008-01-16 18:18:53 UTC
I cannot reproduce it on Win32 and Linux with Mono 1.2.6. All cross test
combination are working as expected.

Are you sure you've disabled the firewall on all systems during your tests?
Events need bidirectional connections.

Still need to test on Mac PPC, but don't hold your breath on it as I don't
have access to PPC ATM.
Comment 7 Johannes Paschold 2008-01-17 07:22:20 UTC
Robert: You are right. I must have messed up something in my last post. It works between windows and linux x86. The problem does only show up on

  - linux ppc to win32
  - linux ppc to linux x86

regardless of which one is server or client. You are right, that using events via remoting is not a good practice but it should work as expected though.

So long story short: this seems to be an issue only affecting the ppc implementation. Since mine is running on an embedded platform, i'm not sure if there are maybe slight differences in the linux subsystem causing the issue, so it would be nice to have test on a "real" ppc.

regards
jOe




  
Comment 8 Robert Jordan 2008-01-17 14:27:27 UTC
Joe, the System.ExecutionEngineException (SIGILL) might be bug #350649, which
is fixed in SVN HEAD and the 1.2.6 branch.
Comment 9 Robert Jordan 2008-01-22 22:43:08 UTC
Please try again with the new[1] mono 1.2.6 for PPC.

[1]
http://permalink.gmane.org/gmane.comp.gnome.mono.general/32769
http://mono-project.com/Downloads


*** This bug has been marked as a duplicate of bug 350649 ***