[Mono-list] mono-service2 debugging issues

Abe Gillespie abe.gillespie at gmail.com
Wed Dec 8 14:25:27 EST 2010


Ah, I see, I assumed mono-service was for .Net 1.x.  Like how there's
mod-mono-server, mod-mono-server2, and mod-mono-server4.

Thanks for the tip!
-Abe

On Wed, Dec 8, 2010 at 2:10 PM, Robert Jordan <robertj at gmx.net> wrote:
> On 08.12.2010 19:48, Abe Gillespie wrote:
>> Oh, shoot, I forgot to circle back on this one.  My apologies, I had a
>> couple of threads going concurrently.  I debugged the old fashion way
>> and finally figured out this is what I needed:
>
> Heh, no :) You want "mono-service", which defaults to 4.0.
> Mono-service2 is for .NET 2.0, as you already discovered.
>
> Robert
>
>>
>> #!/bin/bash
>> export MONO_OPTIONS=--runtime=v4.0.30319
>> export LD_LIBRARY_PATH=.:/usr/local/mono/2.8/lib/:$LD_LIBRARY_PATH
>> /usr/local/mono/2.8/bin/mono-service2 -d:/service-home Service.exe
>>
>> The key being setting the runtime version.  Mono was unable to
>> autodetect it ... perhaps due to use of IoC?  BTW, is there a way to
>> list available runtime versions?  I happened upon that random version
>> number thanks to StackOverflow.
>>
>> Thanks, all.
>> -Abe
>>
>> 2010/12/8 "Andrés G. Aragoneses"<knocte at gmail.com>:
>>>
>>> It may be some internal problem on how Mono manages the appdomains of
>>> your service. IIRC Mono uses Remoting internally for the communication
>>> between them.
>>>
>>>
>>> On 06/12/10 06:56, Abe Gillespie wrote:
>>>> Yeah, --debug didn't seem to help.  However, as luck would have it,
>>>> Bojan's answer to the JSON.NET thread gave me this little nugget:
>>>> --trace=E:all
>>>>
>>>> However, now that I have the exception stack trace I'm still baffled.
>>>> Anyone know what's going on below?  Does running via mono-service
>>>> automatically require Remoting?  Because my service certainly is not
>>>> using any Remoting stuff.  Now I do have an IMessage interface I use
>>>> that's defined in my namespace ... could that possibly cause some
>>>> weird type loading confusion?
>>>>
>>>> EXCEPTION handling: System.TypeLoadException: A type load exception
>>>> has occurred.
>>>>
>>>> "<unnamed thread>" tid=0x0x7fcbc4cef730 this=0x0x7fcbc0e15e60 thread
>>>> handle 0x403 state : not waiting owns ()
>>>>     at (wrapper remoting-invoke-with-check) Service..ctor ()<0x0003a>
>>>>     at (wrapper remoting-invoke-with-check) Service..ctor ()<0x0003a>
>>>>     at Service.Program.Main ()<0x0004d>
>>>>     at (wrapper runtime-invoke) object.runtime_invoke_void
>>>> (object,intptr,intptr,intptr)<0x0007b>
>>>>     at (wrapper managed-to-native) System.AppDomain.ExecuteAssembly
>>>> (System.AppDomain*,System.Reflection.Assembly,string[])<0x00073>
>>>>     at (wrapper managed-to-native) System.AppDomain.ExecuteAssembly
>>>> (System.AppDomain*,System.Reflection.Assembly,string[])<0x00073>
>>>>     at System.AppDomain.ExecuteAssemblyInternal
>>>> (System.Reflection.Assembly,string[])<0x00043>
>>>>     at System.AppDomain.ExecuteAssembly
>>>> (string,System.Security.Policy.Evidence,string[])<0x00044>
>>>>     at (wrapper remoting-invoke-with-check)
>>>> System.AppDomain.ExecuteAssembly
>>>> (string,System.Security.Policy.Evidence,string[])<0x0009a>
>>>>     at System.AppDomain.ExecuteAssembly
>>>> (string,System.Security.Policy.Evidence)<0x00028>
>>>>     at (wrapper remoting-invoke-with-check)
>>>> System.AppDomain.ExecuteAssembly
>>>> (string,System.Security.Policy.Evidence)<0x00088>
>>>>     at MonoServiceRunner.StartService ()<0x00500>
>>>>     at (wrapper runtime-invoke)<Module>.runtime_invoke_int__this__
>>>> (object,intptr,intptr,intptr)<0x000ad>
>>>>     at (wrapper managed-to-native)
>>>> System.Runtime.Remoting.RemotingServices.InternalExecute
>>>> (System.Reflection.MethodBase,object,object[],object[]&)<0x00064>
>>>>     at (wrapper managed-to-native)
>>>> System.Runtime.Remoting.RemotingServices.InternalExecute
>>>> (System.Reflection.MethodBase,object,object[],object[]&)<0x00064>
>>>>     at System.Runtime.Remoting.RemotingServices.InternalExecuteMessage
>>>> (System.MarshalByRefObject,System.Runtime.Remoting.Messaging.IMethodCallMessage)
>>>> <0x0022f>
>>>>     at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage
>>>> (System.Runtime.Remoting.Messaging.IMessage)<0x000e8>
>>>>     at System.Runtime.Remoting.Messaging.ServerObjectTerminatorSink.SyncProcessMessage
>>>> (System.Runtime.Remoting.Messaging.IMessage)<0x00086>
>>>>     at System.Runtime.Remoting.Lifetime.LeaseSink.SyncProcessMessage
>>>> (System.Runtime.Remoting.Messaging.IMessage)<0x00035>
>>>>     at System.Runtime.Remoting.ClientActivatedIdentity.SyncObjectProcessMessage
>>>> (System.Runtime.Remoting.Messaging.IMessage)<0x0009c>
>>>>     at System.Runtime.Remoting.Messaging.ServerContextTerminatorSink.SyncProcessMessage
>>>> (System.Runtime.Remoting.Messaging.IMessage)<0x001b1>
>>>>     at System.Runtime.Remoting.Contexts.CrossContextChannel.SyncProcessMessage
>>>> (System.Runtime.Remoting.Messaging.IMessage)<0x00126>
>>>>     at System.Runtime.Remoting.Channels.ChannelServices.SyncDispatchMessage
>>>> (System.Runtime.Remoting.Messaging.IMessage)<0x0005c>
>>>>     at System.AppDomain.ProcessMessageInDomain
>>>> (byte[],System.Runtime.Remoting.Messaging.CADMethodCallMessage,byte[]&,System.Runtime.Remoting.Messaging.CADMethodReturnMessage&)
>>>> <0x000bf>
>>>>     at (wrapper remoting-invoke-with-check)
>>>> System.AppDomain.ProcessMessageInDomain
>>>> (byte[],System.Runtime.Remoting.Messaging.CADMethodCallMessage,byte[]&,System.Runtime.Remoting.Messaging.CADMethodReturnMessage&)
>>>> <0x000a9>
>>>>     at System.Runtime.Remoting.Channels.CrossAppDomainSink.ProcessMessageInDomain
>>>> (byte[],System.Runtime.Remoting.Messaging.CADMethodCallMessage)
>>>> <0x0006a>
>>>>     at (wrapper runtime-invoke)
>>>> <Module>.runtime_invoke_CrossAppDomainSink/ProcessMessageRes_object_object
>>>> (object,intptr,intptr,intptr)<0x000ce>
>>>>     at (wrapper managed-to-native)
>>>> System.Reflection.MonoMethod.InternalInvoke
>>>> (System.Reflection.MonoMethod*,object,object[],System.Exception&)
>>>> <0x00079>
>>>>     at (wrapper managed-to-native)
>>>> System.Reflection.MonoMethod.InternalInvoke
>>>> (System.Reflection.MonoMethod*,object,object[],System.Exception&)
>>>> <0x00079>
>>>>     at System.AppDomain.InvokeInDomainByID
>>>> (int,System.Reflection.MethodInfo,object,object[])<0x0009c>
>>>>     at System.Runtime.Remoting.Channels.CrossAppDomainSink.SyncProcessMessage
>>>> (System.Runtime.Remoting.Messaging.IMessage)<0x000fb>
>>>>     at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke
>>>> (System.Runtime.Remoting.Messaging.IMessage)<0x00342>
>>>>     at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke
>>>> (System.Runtime.Remoting.Proxies.RealProxy,System.Runtime.Remoting.Messaging.IMessage,System.Exception&,object[]&)
>>>> <0x003fa>
>>>>     at (wrapper runtime-invoke)
>>>> <Module>.runtime_invoke_object_object_object_Exception&_object[]&
>>>> (object,intptr,intptr,intptr)<0x0005c>
>>>>     at (wrapper managed-to-native)
>>>> object.__icall_wrapper_mono_remoting_wrapper (intptr,intptr)<0x0005e>
>>>>     at (wrapper managed-to-native)
>>>> object.__icall_wrapper_mono_remoting_wrapper (intptr,intptr)<0x0005e>
>>>>     at (wrapper remoting-invoke) MonoServiceRunner.StartService ()<0x00079>
>>>>     at (wrapper xdomain-invoke) MonoServiceRunner.StartService ()<0x000ce>
>>>>     at (wrapper remoting-invoke-with-check)
>>>> MonoServiceRunner.StartService ()<0x00041>
>>>>     at MonoServiceRunner.Main (string[])<0x00823>
>>>>     at (wrapper runtime-invoke)<Module>.runtime_invoke_int_object
>>>> (object,intptr,intptr,intptr)<0x000ad>
>>>>
>>>>
>>>> On Mon, Dec 6, 2010 at 12:27 AM, David Jagoe<davidjagoe at gmail.com>    wrote:
>>>>> G'day,
>>>>>
>>>>> On Monday, 6 December 2010, Abe Gillespie<abe.gillespie at gmail.com>    wrote:
>>>>>> Hello,
>>>>>>
>>>>>> I'm trying to run my service as a daemon.  It doesn't run and the only
>>>>>> thing I get in the system log is:
>>>>>>
>>>>>> Dec  6 05:04:22 machine mono: Service.exe: A type load exception has occurred.
>>>>>>
>>>>>> I've tried a number of things to coerce more info out of mono but I
>>>>>> can't seem to.  Is there any way to get the full exception message /
>>>>>> stack trace?  Also, the service runs fine if I run it directly instead
>>>>>> of through mono-service.
>>>>>
>>>>> I've battled with this a few weeks ago. In answer to your first
>>>>> question, try running mono-service2 with the --debug option. That
>>>>> should print stack traces.
>>>>>
>>>>> Hopefully once you see stack trace you'll be able to figure out why
>>>>> there is a difference when running as a service. In my case the
>>>>> problem appeared to be importing code from a different filesystem.
>>>>>
>>>>>
>>>>> Cheers,
>>>>> David
>>>>>
>>>>>>
>>>>>> Thanks.
>>>>>> -Abe
>>>>>> _______________________________________________
>>>>>> Mono-list maillist  -  Mono-list at lists.ximian.com
>>>>>> http://lists.ximian.com/mailman/listinfo/mono-list
>>>>>>
>>>>>
>>>> _______________________________________________
>>>> Mono-list maillist  -  Mono-list at lists.ximian.com
>>>> http://lists.ximian.com/mailman/listinfo/mono-list
>>>>
>>>
>>>
>>> _______________________________________________
>>> Mono-list maillist  -  Mono-list at lists.ximian.com
>>> http://lists.ximian.com/mailman/listinfo/mono-list
>>>
>> _______________________________________________
>> Mono-list maillist  -  Mono-list at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-list
>>
>
>
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>


More information about the Mono-list mailing list