Bug 319251 (MONO76390) - [GMCS]: problem when running with --profile=heap-buddy
Summary: [GMCS]: problem when running with --profile=heap-buddy
Status: RESOLVED FIXED
Alias: MONO76390
Product: Mono: Runtime
Classification: Mono
Component: misc (show other bugs)
Version: 1.1
Hardware: Other Other
: P3 - Medium : Minor
Target Milestone: ---
Assignee: Martin Baulig
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-09 22:10 UTC by Miguel de Icaza
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 19:34:16 UTC


---- Reported by miguel@ximian.com 2005-10-09 15:10:19 MST ----

This problem happens with profilers (module: heap-buddy).

Try profiling the included program, and it will produce:

mono$ mono --profile=heap-buddy /tmp/a.exe
*** Running with heap-buddy ***

** (/tmp/a.exe:30917): WARNING **: implement me 0x00


** ERROR **: file class.c: line 3030 (mono_class_from_mono_type): should
not be reached
aborting...
Aborted

using System;
using System.Collections.Generic;

class Demo<T> {
        T variable;

        public Demo (T x)
        {
                variable = x;
        }

        public void Pinta ()
        {
                Console.WriteLine ("El valor es: {0} y el tipo es: {1}",
variable, variable.GetType ());
        }
}

class X {
        static void Main ()
        {
                List<object> a = new List<object> ();
                a.Add (1);
                a.Add ("hola");
        }
}



---- Additional Comments From miguel@ximian.com 2005-10-20 15:04:49 MST ----

Please do not reset the title, the title was correct.

The same crash that happens with heap-buddy (or any other profiler
that tries to get a stringified representation) crashes things like
Monodis.

So it is not a "problem when running with --profile=heap-buddy" as you
put on the summary line, it is a problem with any code that tries to
render a stringified version of a type and reaches that assertion.



---- Additional Comments From martin@ximian.com 2005-10-21 13:16:01 MST ----

Dude,
a) `Generics:' is not an allowed title - it's called [GMCS]
b) The new title was correct
Please don't waste my time by having me view this https://bugzilla.novell.com/show_bug.cgi?id=MONO20 times just to
figure out "ah, it's that heap-buddy" problems.  The purpose of the
subject is allowing you to easily remember which bug that is.



---- Additional Comments From miguel@ximian.com 2005-10-21 18:35:10 MST ----

#0  0xffffe410 in __kernel_vsyscall ()
#1  0x40142501 in raise () from /lib/tls/libc.so.6
#2  0x40143d7b in abort () from /lib/tls/libc.so.6
#3  0x4006d120 in g_logv () from /opt/gnome/lib/libglib-2.0.so.0
#4  0x4006d165 in g_log () from /opt/gnome/lib/libglib-2.0.so.0
#5  0x4006d1e1 in g_assert_warning () from /opt/gnome/lib/libglib-2.0.so.0
#6  0x080de09c in mono_class_from_mono_type (type=0x0) at class.c:3030
#7  0x080df95c in mono_type_get_name_recurse (type=0x81d77e0,
str=0x81c4368, is_recursed=0, format=MONO_TYPE_NAME_FORMAT_REFLECTION)
    at class.c:230
#8  0x080e00c5 in mono_type_get_name_full (type=0x81d77e0,
format=MONO_TYPE_NAME_FORMAT_REFLECTION) at class.c:338
#9  0x080e1509 in mono_type_get_full_name (class=0x81d7748) at class.c:356
#10 0x4002893c in outfile_writer_add_accountant (ofw=0x81c0960,
acct=0x81f43e8) at outfile-writer.c:176
#11 0x40028c21 in heap_buddy_alloc_func (p=0x81c0cd0, obj=0x2bff0,
klass=0x81d76b0) at heap-buddy.c:82
#12 0x080c29a9 in mono_profiler_allocation (obj=0x2bff0,
klass=0x81d76b0) at profiler.c:211
#13 0x08091134 in mono_object_new_alloc_specific (vtable=0x81c2220) at
object.c:2308
#14 0x080911db in mono_object_new_specific (vtable=0x81c2220) at
object.c:2289
#15 0x0813dba4 in mono_type_get_object (domain=0x21f00,
type=0x81d78c8) at reflection.c:5426
#16 0x0808f01d in mono_class_vtable (domain=0x21f00, class=0x81d7830)
at object.c:881
#17 0x0808f006 in mono_class_vtable (domain=0x21f00, class=0x81d7770)
at object.c:879
#18 0x0808f006 in mono_class_vtable (domain=0x21f00, class=0x81d76b0)
at object.c:879
#19 0x08091273 in mono_object_new (domain=0x21f00, klass=0x81d76b0) at
object.c:2250
#20 0x0813dba4 in mono_type_get_object (domain=0x21f00,
type=0x81d2ff0) at reflection.c:5426
#21 0x0808f01d in mono_class_vtable (domain=0x21f00, class=0x81d2f58)
at object.c:881
#22 0x0808f006 in mono_class_vtable (domain=0x21f00, class=0x81e6798)
at object.c:879
#23 0x08091273 in mono_object_new (domain=0x21f00, klass=0x81e6798) at
object.c:2250
#24 0x080bf13e in mono_runtime_init (domain=0x21f00,
start_cb=0x8151247 <__PRETTY_FUNCTION__.21631+1354>, attach_cb=0x81c8268)
    at appdomain.c:102
#25 0x0810ccb9 in mini_init (filename=0xbfcacc87 "pp.exe") at mini.c:10342
#26 0x0805c4ba in mono_main (argc=3, argv=0xbfcaadd4) at driver.c:845
#27 0x4012fe60 in __libc_start_main () from /lib/tls/libc.so.6
#28 0x0805be11 in _start () at start.S:119




---- Additional Comments From miguel@ximian.com 2005-10-21 18:41:09 MST ----

This actually might be an issue with the profiler.



---- Additional Comments From miguel@ximian.com 2005-10-21 18:41:32 MST ----

In fact, its fixed with newer profilers


Unknown operating system unknown. Setting to default OS "Other".