[Mono-dev] Problem with mono default profiler

Michael Baker mbsmtp at gmail.com
Tue Mar 17 11:53:36 EDT 2009


Hi All,

I am trying to profile a mixed Java/C# application running on Linux (Fedora
Core 10) using the Mono default profiler.
(I have not had any luck using the Mono Logging profiler or Valgrind.)
Please see my system information and stack trace below.

My run script looks like the following:

#!/bin/sh
export MONO_IOMAP=all
export MONO_REGISTRY_PATH=/home/mbaker/.mono/registry
mono --trace=M:Microsoft.Win32.KeyHandler:Drop --debug --verbose
--profile=default:stat,alloc,file=prof.out hrc.exe

I don't think either Mono environment variable has an affect on my run.

I think my program is dying on the first line of this method (quoted below),
but I don't know the cause.

Since my program does not exit cleanly, I do not get the profiler output.
Any help or insight is greatly appreciated.

Mike

**************************************************

		public static void Drop <javascript:searchRef('Drop')> (RegistryKey
<javascript:searchRef('RegistryKey')> rkey
<javascript:searchRef('rkey')>)
		{
			lock (typeof (KeyHandler <javascript:searchRef('KeyHandler')>)) {
				KeyHandler <javascript:searchRef('KeyHandler')> k
<javascript:searchRef('k')> = (KeyHandler
<javascript:searchRef('KeyHandler')>) key_to_handler
<javascript:searchRef('key_to_handler')> [rkey
<javascript:searchRef('rkey')>];
				if (k <javascript:searchRef('k')> == null)
					return;
				key_to_handler <javascript:searchRef('key_to_handler')>.Remove
<javascript:searchRef('Remove')> (rkey
<javascript:searchRef('rkey')>);

				// remove cached KeyHandler if no other keys reference it
				int refCount <javascript:searchRef('refCount')> = 0;
				foreach (DictionaryEntry <javascript:searchRef('DictionaryEntry')>
de <javascript:searchRef('de')> in key_to_handler
<javascript:searchRef('key_to_handler')>)
					if (de <javascript:searchRef('de')>.Value
<javascript:searchRef('Value')> == k <javascript:searchRef('k')>)
						refCount <javascript:searchRef('refCount')>++;
				if (refCount <javascript:searchRef('refCount')> == 0)
					dir_to_handler <javascript:searchRef('dir_to_handler')>.Remove
<javascript:searchRef('Remove')> (k <javascript:searchRef('k')>.Dir
<javascript:searchRef('Dir')>);
			}
		}


*************************************************

$ uname -a
Linux localhost.localdomain 2.6.27.19-170.2.35.fc10.x86_64 #1 SMP Mon Feb 23
13:00:23 EST 2009 x86_64 x86_64 x86_64 GNU/Linux

$ mono ikvm.exe -version
IKVM.NET Launcher version 0.38.0.2
Copyright (C) 2002-2008 Jeroen Frijters
http://www.ikvm.net/

CLR version: 2.0.50727.1433 (64 bit)
Mono version: Mono 2.2
System: 2.0.0.0
IKVM.OpenJDK.ClassLibrary: 0.38.0.2
IKVM.Runtime: 0.38.0.2
ikvm: 0.38.0.2
mscorlib: 2.0.0.0
GNU Classpath version: 0.95
OpenJDK version: OpenJDK 6 b12


Method Microsoft.Win32.RegistryKey:Finalize () emitted at 0x4c9fe0 to
0x4ca046 (code length 102) [hrc.exe]
Method Microsoft.Win32.RegistryKey:Close () emitted at 0x4ca050 to 0x4ca0d6
(code length 134) [hrc.exe]
Method Microsoft.Win32.RegistryKey:Flush () emitted at 0x4ca0e0 to 0x4ca13e
(code length 94) [hrc.exe]
Method Microsoft.Win32.UnixRegistryApi:Flush (Microsoft.Win32.RegistryKey)
emitted at 0x4ca140 to 0x4ca19a (code length 90) [hrc.exe]
Method Microsoft.Win32.KeyHandler:Flush () emitted at 0x4ca1b0 to 0x4ca24a
(code length 154) [hrc.exe]
Method Microsoft.Win32.UnixRegistryApi:Close (Microsoft.Win32.RegistryKey)
emitted at 0x4ca260 to 0x4ca2a2 (code length 66) [hrc.exe]
Method Microsoft.Win32.KeyHandler:Drop (Microsoft.Win32.RegistryKey) emitted
at 0x4ca2b0 to 0x4ca5ee (code length 830) [hrc.exe]
[0x7fc9c1a6c950: 0.00000 0] ENTER: Microsoft.Win32.KeyHandler:Drop
(Microsoft.Win32.RegistryKey)([Microsoft.Win32.RegistryKey:0x7fc9be548c78],
)
[0x7fc9c1a6c950: 0.39365 0] LEAVE: Microsoft.Win32.KeyHandler:Drop
(Microsoft.Win32.RegistryKey)
[0x7fc9c1a6c950: 0.39379 0] ENTER: Microsoft.Win32.KeyHandler:Drop
(Microsoft.Win32.RegistryKey)([Microsoft.Win32.RegistryKey:0x7fc9bccaacb0],
)
[0x7fc9c1a6c950: 0.78490 0] LEAVE: Microsoft.Win32.KeyHandler:Drop
(Microsoft.Win32.RegistryKey)
[0x7fc9c1a6c950: 0.78558 0] ENTER: Microsoft.Win32.KeyHandler:Drop
(Microsoft.Win32.RegistryKey)([Microsoft.Win32.RegistryKey:0x7fc9bcbdcd90],
)
[0x7fc9c1a6c950: 1.18209 0] LEAVE: Microsoft.Win32.KeyHandler:Drop
(Microsoft.Win32.RegistryKey)
[0x7fc9c1a6c950: 1.18268 0] ENTER: Microsoft.Win32.KeyHandler:Drop
(Microsoft.Win32.RegistryKey)([Microsoft.Win32.RegistryKey:0x7fc9b5856d20],
)
[0x7fc9c1a6c950: 1.57726 0] LEAVE: Microsoft.Win32.KeyHandler:Drop
(Microsoft.Win32.RegistryKey)
[0x7fc9c1a6c950: 1.57735 0] ENTER: Microsoft.Win32.KeyHandler:Drop
(Microsoft.Win32.RegistryKey)([Microsoft.Win32.RegistryKey:0x7fc9b7c61428],
)
[0x7fc9c1a6c950: 1.96742 0] LEAVE: Microsoft.Win32.KeyHandler:Drop
(Microsoft.Win32.RegistryKey)
[0x7fc9c1a6c950: 1.96752 0] ENTER: Microsoft.Win32.KeyHandler:Drop
(Microsoft.Win32.RegistryKey)([Microsoft.Win32.RegistryKey:0x7fc9b5c335e8],
)
[0x7fc9c1a6c950: 2.36141 0] LEAVE: Microsoft.Win32.KeyHandler:Drop
(Microsoft.Win32.RegistryKey)
[0x7fc9c1a6c950: 2.36150 0] ENTER: Microsoft.Win32.KeyHandler:Drop
(Microsoft.Win32.RegistryKey)([Microsoft.Win32.RegistryKey:0x7fc9b7d58658],
)
[0x7fc9c1a6c950: 2.78386 0] LEAVE: Microsoft.Win32.KeyHandler:Drop
(Microsoft.Win32.RegistryKey)
[0x7fc9c1a6c950: 2.78437 0] ENTER: Microsoft.Win32.KeyHandler:Drop
(Microsoft.Win32.RegistryKey)([Microsoft.Win32.RegistryKey:0x7fc9b5788e00],
)
[0x7fc9c1a6c950: 3.17805 0] LEAVE: Microsoft.Win32.KeyHandler:Drop
(Microsoft.Win32.RegistryKey)
[0x7fc9c1a6c950: 3.17815 0] ENTER: Microsoft.Win32.KeyHandler:Drop
(Microsoft.Win32.RegistryKey)([Microsoft.Win32.RegistryKey:0x7fc9bccfd2d8],
)
[0x7fc9c1a6c950: 3.57094 0] LEAVE: Microsoft.Win32.KeyHandler:Drop
(Microsoft.Win32.RegistryKey)
[0x7fc9c1a6c950: 3.57103 0] ENTER: Microsoft.Win32.KeyHandler:Drop
(Microsoft.Win32.RegistryKey)([Microsoft.Win32.RegistryKey:0x7fc9b5880038],
)
[0x7fc9c1a6c950: 3.96326 0] LEAVE: Microsoft.Win32.KeyHandler:Drop
(Microsoft.Win32.RegistryKey)
[0x7fc9c1a6c950: 3.96336 0] ENTER: Microsoft.Win32.KeyHandler:Drop
(Microsoft.Win32.RegistryKey)([Microsoft.Win32.RegistryKey:0x7fc9b59a0578],
)

** (hrc.exe:3319): WARNING **: Shutting down finalizer thread timed out.
**
ERROR:error.c:70:SetLastError: assertion failed: (ret == 0)
Stacktrace:

  at Microsoft.Win32.KeyHandler.Drop (Microsoft.Win32.RegistryKey) [0x000b2]
in
/builddir/build/BUILD/mono-2.2/mcs/class/corlib/Microsoft.Win32/UnixRegistryApi.cs:287
  at Microsoft.Win32.KeyHandler.Drop (Microsoft.Win32.RegistryKey) [0x00096]
in
/builddir/build/BUILD/mono-2.2/mcs/class/corlib/Microsoft.Win32/UnixRegistryApi.cs:285
  at Microsoft.Win32.UnixRegistryApi.Close (Microsoft.Win32.RegistryKey)
[0x00000] in
/builddir/build/BUILD/mono-2.2/mcs/class/corlib/Microsoft.Win32/UnixRegistryApi.cs:617
  at Microsoft.Win32.RegistryKey.Close () [0x0001d] in
/builddir/build/BUILD/mono-2.2/mcs/class/corlib/Microsoft.Win32/RegistryKey.cs:158
  at Microsoft.Win32.RegistryKey.Finalize () [0x00000] in
/builddir/build/BUILD/mono-2.2/mcs/class/corlib/Microsoft.Win32/RegistryKey.cs:124
  at (wrapper runtime-invoke) object.runtime_invoke_void__this__
(object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

    /usr/lib64/libmono.so.0 [0x6c7ab0]
    /lib64/libpthread.so.0 [0x3f3a60f0f0]
    /lib64/libc.so.6(gsignal+0x35) [0x3f39a32f05]
    /lib64/libc.so.6(abort+0x183) [0x3f39a34a73]
    /lib64/libglib-2.0.so.0(g_assertion_message+0x113) [0x3f3b25d803]
    /lib64/libglib-2.0.so.0 [0x3f3b25dca2]
    /usr/lib64/libmono.so.0(SetLastError+0x48) [0x7c0cb8]
    /usr/lib64/libmono.so.0(WaitForSingleObjectEx+0x21f) [0x7ddc6f]
    /usr/lib64/libmono.so.0 [0x76cee1]
    /usr/lib64/libmono.so.0 [0x76d2a9]
    [0x222818]

Debug info from gdb:

ptrace: No such process.
No registers.
No registers.

=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

Aborted
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20090317/f883f6c7/attachment-0001.html 


More information about the Mono-devel-list mailing list