AW: [Mono-dev] Mono remoting on an embedded arm system

FALE(Leopold Faschalek) FALE at skidata.com
Thu May 18 05:25:20 EDT 2006


> Von: Miguel de Icaza [mailto:miguel at ximian.com] 
> Gesendet: Donnerstag, 18. Mai 2006 01:15
> An: FALE(Leopold Faschalek)
> Cc: mono-devel-list at lists.ximian.com
> Betreff: Re: [Mono-dev] Mono remoting on an embedded arm system
> 
> hello,
> 
> > we are running mono 1.1.14 on an embedded arm system with remoting 
> > services to communicate with a host system.
> 
> This does not ring any bells;   Could you cook a small test 
> case, maybe
> include the exception, stack traces produced?
> 
Hello,

I have made 3 runs with different debug/trace options
1) # mono --debug server.exe
2) # mono --trace=CommonLib --debug server.exe
3) # mono --trace=N:System.Runtime.Remoting --debug server.exe

In the 3. trace you see that RemotingServices:InternalExecute() which
has a 
try/catch block, doesn't resume execution.

Could you give me information to produce more infos on the exception
handling?

I append also the 3 sourcefiles

Greetings Leopold


========================================== OUTPUT 1
==============================================
# mono --debug server.exe
creating channel at port 9000
registering channel
Starting Server
Server serving at port 9000...
InfoDisplay.Show was called
toDevice called

Unhandled Exception: System.Exception: Hello World!
in [0x00042] (at /CommonLib.cs:25) CommonLib.InfoDisplay:toDevice (Byte
bitsToSet)
in [0x0000c] (at /CommonLib.cs:12) CommonLib.InfoDisplay:Show (Byte
bitsToSet)
in <0x00000> <unknown method>

========================================== OUTPUT 2
==============================================
# mono --trace=CommonLib server.exe
ENTER: (wrapper remoting-invoke-with-check) CommonLib.InfoDisplay:.ctor
()() ip: (nil)
. ENTER: CommonLib.InfoDisplay:.ctor ()() ip: (nil)
. LEAVE: CommonLib.InfoDisplay:.ctor ()
LEAVE: (wrapper remoting-invoke-with-check) CommonLib.InfoDisplay:.ctor
()
creating channel at port 9000
EXCEPTION handling: FormatException
EXCEPTION handling: FormatException
EXCEPTION handling: FormatException
registering channel
Starting Server
Server serving at port 9000...
ENTER: CommonLib.InfoDisplay:Show (byte)() ip: (nil)
InfoDisplay.Show was called
. ENTER: CommonLib.InfoDisplay:toDevice (byte)() ip: (nil)
toDevice called
EXCEPTION handling: Exception

Unhandled Exception: System.Exception: Hello World!
in <0x000e0> CommonLib.InfoDisplay:toDevice (Byte bitsToSet)
in <0x00057> CommonLib.InfoDisplay:Show (Byte bitsToSet)
in <0x00000> <unknown method>
========================================== OUTPUT 3
==============================================
# mono --trace=N:System.Runtime.Remoting --debug server.exe
<snip/>
ENTER: System.Runtime.Remoting.RemotingServices:SetMessageTargetIdentity
(System.Runtime.Remoting.Messaging.IMessage,)
LEAVE: System.Runtime.Remoting.RemotingServices:SetMessageTargetIdentity
(System.Runtime.Remoting.Messaging.IMessage,)
ENTER: System.Runtime.Remoting.RemotingServices:GetMessageTargetIdentity
(System.Runtime.Remoting.Messaging.IMessage))
LEAVE: System.Runtime.Remoting.RemotingServices:GetMessageTargetIdentity
(System.Runtime.Remoting.Messaging.IMessage)]
ENTER: System.Runtime.Remoting.ServerIdentity:get_Context ()() ip: (nil)
LEAVE: System.Runtime.Remoting.ServerIdentity:get_Context
()[System.Runtime.Remoting.Contexts.Context:0x291fc0]
ENTER: System.Runtime.Remoting.ServerIdentity:get_Context ()() ip: (nil)
LEAVE: System.Runtime.Remoting.ServerIdentity:get_Context
()[System.Runtime.Remoting.Contexts.Context:0x291fc0]
ENTER: System.Runtime.Remoting.RemotingServices:GetMessageTargetIdentity
(System.Runtime.Remoting.Messaging.IMessage))
LEAVE: System.Runtime.Remoting.RemotingServices:GetMessageTargetIdentity
(System.Runtime.Remoting.Messaging.IMessage)]
ENTER:
System.Runtime.Remoting.ClientActivatedIdentity:SyncObjectProcessMessage
(System.Runtime.Remoting.Messaging.IM)
. ENTER: (wrapper managed-to-native)
System.Runtime.Remoting.RemotingServices:IsTransparentProxy (object)()
ip: (nil)
. LEAVE: (wrapper managed-to-native)
System.Runtime.Remoting.RemotingServices:IsTransparentProxy
(object)FALSE
. ENTER:
System.Runtime.Remoting.RemotingServices:GetMessageTargetIdentity
(System.Runtime.Remoting.Messaging.IMessag)
. LEAVE:
System.Runtime.Remoting.RemotingServices:GetMessageTargetIdentity
(System.Runtime.Remoting.Messaging.IMessag]
. ENTER: System.Runtime.Remoting.ServerIdentity:get_Lease ()() ip: (nil)
. LEAVE: System.Runtime.Remoting.ServerIdentity:get_Lease
()[System.Runtime.Remoting.Lifetime.Lease:0x25be40]
. ENTER:
System.Runtime.Remoting.RemotingServices:GetMessageTargetIdentity
(System.Runtime.Remoting.Messaging.IMessag)
. LEAVE:
System.Runtime.Remoting.RemotingServices:GetMessageTargetIdentity
(System.Runtime.Remoting.Messaging.IMessag]
. ENTER: System.Runtime.Remoting.Identity:NotifyServerDynamicSinks
(bool,System.Runtime.Remoting.Messaging.IMessage,b)
. LEAVE: System.Runtime.Remoting.Identity:NotifyServerDynamicSinks
(bool,System.Runtime.Remoting.Messaging.IMessage,b)
. ENTER: System.Runtime.Remoting.RemotingServices:InternalExecuteMessage
(System.MarshalByRefObject,System.Runtime.Re)
. . ENTER: (wrapper managed-to-native)
System.Runtime.Remoting.RemotingServices:InternalExecute
(System.Reflection.Me)
InfoDisplay.Show was called
toDevice called
EXCEPTION handling: Exception

Unhandled Exception: System.Exception: Hello World!
in [0x00042] (at /CommonLib.cs:25) CommonLib.InfoDisplay:toDevice (Byte
bitsToSet)
in [0x0000c] (at /CommonLib.cs:12) CommonLib.InfoDisplay:Show (Byte
bitsToSet)
in <0x00000> <unknown method>
. . . ENTER: System.Runtime.Remoting.ServerIdentity:get_Lease ()() ip:
(nil)
. . . LEAVE: System.Runtime.Remoting.ServerIdentity:get_Lease
()[System.Runtime.Remoting.Lifetime.Lease:0x25be40]
. . . ENTER: System.Runtime.Remoting.ServerIdentity:get_Lease ()() ip:
(nil)
. . . LEAVE: System.Runtime.Remoting.ServerIdentity:get_Lease
()[System.Runtime.Remoting.Lifetime.Lease:0x25be40]

==================================== client.cs
===================================
using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
using CommonLib;

namespace InfoDisplayClient
{
        class Client 
        {
                static void Main () 
                {
                        //TcpChannel ch = new TcpChannel(0);
                        //ChannelServices.RegisterChannel (ch);
                        string serverIP = "127.0.0.1";
                        if
(System.Environment.GetCommandLineArgs().Length==2)
                                serverIP
=System.Environment.GetCommandLineArgs()[1];
                        Console.WriteLine("Getting an InfoDisplay
instance from "+serverIP+":9000/test.rem");
                        try
                        {
                                object remOb = 
 
Activator.GetObject(typeof(InfoDisplay),"tcp://"+serverIP+":9000/test.re
m");
                                if (remOb==null)
                                        Console.WriteLine("remOb=null");
                                else
                                {
                                        Console.WriteLine("got an
instance, calling Show");
                                        InfoDisplay display =
(InfoDisplay)remOb;
                                        display.Show(10);
                                }
                        }
                        catch (Exception e)
                        {
                                Console.WriteLine("Exception occured:
"+e.ToString());
                        }
                }
        }
}
===================================== server.cs
===================================
using System;
using System.Net;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
using CommonLib;


namespace InfoDisplayServer
{
        class App
        {
                [STAThread]
                static void Main(string[] args)
                {
/*
                        IPHostEntry he = Dns.GetHostByName("localhost");
                        Console.WriteLine("{0}",he);
                        string[] aliases = he.Aliases;
                        IPAddress[] adresses = he.AddressList;
                        for (int i=0; i<adresses.Length; i++)
                                Console.WriteLine("Alias {0} ==
{1}",aliases[i],adresses[i]);
*/
                        try
                        {
                                InfoDisplay infoDisplay = new
InfoDisplay();
                                // infoDisplay.Show(65);

                                Console.WriteLine("creating channel at
port 9000");
                                TcpChannel ch = new TcpChannel(9000);

                                Console.WriteLine("registering
channel");
                                ChannelServices.RegisterChannel (ch);

                                Console.WriteLine("Starting Server");
 
RemotingServices.Marshal(infoDisplay,"test.rem");

                                Console.WriteLine("Server serving at
port 9000...");
                                Console.ReadLine();

                                ch.StopListening (null);
                        }
                        catch (Exception e)
                        {
                                System.Console.WriteLine(e.ToString());
                        }
                }
        }
}
================================== CommonLib.cs
==================================
using System;
using System.IO;

namespace CommonLib
{
        public class InfoDisplay : MarshalByRefObject
        {
                public void Show(byte bitsToSet)
                {
                        Console.WriteLine("InfoDisplay.Show was
called");
                        this.toDevice(bitsToSet);
                }
                protected void toDevice(byte bitsToSet)
                {
                        Console.WriteLine("toDevice called");

                        throw new System.Exception("Hello World!");
                }
        }
}




More information about the Mono-devel-list mailing list