[Mono-dev] Alternative for monodis?

Markku Tavasti tavasti at tavasti.fi
Thu Feb 23 12:39:02 UTC 2012


On 02/23/2012 12:35 PM, Rolf Bjarne Kvinge wrote:
> monodis usually works if you set MONO_PATH to the directory where the
> platform assemblies are, something like this for 4.0 assemblies:
> 
> MONO_PATH=/usr/local/lib/mono/gac/4.0 monodis <yourassembly.dll>

It helps a bit, gettin more information, but still monodis crashes on
seg fault.

But now rises question, is there something wrong with those dll's I am
checking? They are here: http://tavasti.fi/~tavasti/mono/monodis_crash/

Are the specifications for .NET dll format publicly available, so I
could check

Some output from gdb session:

        IL_003d:  ldarg.1
        IL_003e:  ldarg.0
        IL_003f:  call instance class System.Windows.Controls.DataGrid
class System.Windows.Controls.DataGridColumn::get_OwningGrid()
        IL_0044:  callvirt Could not load signature of
System.Windows.Controls.DataGrid:get_Columns due to:

Program received signal SIGSEGV, Segmentation fault.
0x0805b44c in get_method_core (m=0x8097fc0, token=100663565, fullsig=1,
    container=0x0) at get.c:1909
1909                    if (mono_method_signature (mh)->is_inflated)
(gdb) l
1904            MonoMethod *mh;
1905            MonoGenericContainer *type_container = container;
1906
1907            mh = mono_get_method_full (m, token, NULL,
(MonoGenericContext *) container);
1908            if (mh) {
1909                    if (mono_method_signature (mh)->is_inflated)
1910                            container =
mono_method_get_generic_container (((MonoMethodInflated *) mh)->declaring);
1911                    esname = get_escaped_name (mh->name);
1912                    sig = dis_stringify_type (m,
&mh->klass->byval_arg, TRUE);
1913                    if (show_tokens)
(gdb) bt
#0  0x0805b44c in get_method_core (m=0x8097fc0, token=100663565, fullsig=1,
    container=0x0) at get.c:1909
#1  0x0805c935 in disassemble_cil (m=0x8097fc0, mh=0x80b26d8, container=0x0)
    at dis-cil.c:180
#2  0x0804fcbd in dis_code (container=<optimized out>, rva=<optimized out>,
    token=<optimized out>, m=<optimized out>) at main.c:695
#3  dis_method_list (klass_name=0xb717d877 "DataGridColumn", m=0x8097fc0,
    start=<optimized out>, end=70, type_container=0x0) at main.c:898
#4  0x08050e64 in dis_type (m=0x8097fc0, n=1, is_nested=<optimized out>,
    forward=0) at main.c:1244
#5  0x08050fdf in dis_types (m=0x8097fc0, forward=0) at main.c:1470
#6  0x08051bfb in disassemble_file (file=<optimized out>) at main.c:1629
#7  0x080521f2 in main (argc=2, argv=0xbffff474) at main.c:2003
(gdb) p *mh
$16 = {flags = 2182, iflags = 0, token = 100663565, klass = 0x80b0214,
  signature = 0x0, name = 0xb7180ad2 "get_Columns", inline_info = 0,
  inline_failure = 0, wrapper_type = 0, string_ctor = 0, save_lmf = 0,
  dynamic = 0, sre_method = 0, is_generic = 0, is_inflated = 0,
  skip_visibility = 0, verification_success = 0, is_mb_open = 0, slot = -1}
(gdb) p mono_method_signature (mh)
Could not load signature of System.Windows.Controls.DataGrid:get_Columns
due to:
$17 = (MonoMethodSignature *) 0x0

So when Method Signature is NULL, monodis crashes.

-- 
M. Tavasti /  tavasti at tavasti.fi  /   +358-40-5078254


More information about the Mono-devel-list mailing list