[Mono-devel-list] embedding mono with threads

Mohammad DAMT mdamt at bisnisweb.com
Wed Jul 23 12:26:17 EDT 2003


On 2003.07.21 22:49, eric lindvall wrote:
> who do i need to talk to, or what do i need to do to find out how to
> fix
> this?

Perhaps this is helping you guys tracing what's wrong with 
mono_jit_init in a
thread.

Using gdb this is backtrace of oxide-3 core dump:
[mdamt at gordon oxide_test]$ gdb ./oxide-3 core.28509
GNU gdb 5.3-22mdk (Mandrake Linux)
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and 
you are
welcome to change it and/or distribute copies of it under certain 
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for 
details.
This GDB was configured as "i586-mandrake-linux-gnu"...
Core was generated by `./oxide-3'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /opt/mono/lib/libmono.so.0...done.
Loaded symbols for /opt/mono/lib/libmono.so.0
Reading symbols from /lib/i686/libpthread.so.0...done.
Loaded symbols for /lib/i686/libpthread.so.0
Reading symbols from /lib/i686/libm.so.6...done.
Loaded symbols for /lib/i686/libm.so.6
Reading symbols from /usr/lib/libgmodule-2.0.so.0...done.
Loaded symbols for /usr/lib/libgmodule-2.0.so.0
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /usr/lib/libglib-2.0.so.0...done.
Loaded symbols for /usr/lib/libglib-2.0.so.0
Reading symbols from /lib/i686/libc.so.6...done.
Loaded symbols for /lib/i686/libc.so.6
Reading symbols from /opt/mono/lib/libmonogc.so.1...done.
Loaded symbols for /opt/mono/lib/libmonogc.so.1
Reading symbols from /lib/libnsl.so.1...done.
Loaded symbols for /lib/libnsl.so.1
Reading symbols from /lib/i686/librt.so.1...done.
Loaded symbols for /lib/i686/librt.so.1
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
#0  0x40370ef3 in GC_mark_from (mark_stack_top=0x8053110, 
mark_stack=0x80530a8,
mark_stack_limit=0x805b0a8) at mark.c:647
647               deferred = *limit;
(gdb) bt
#0  0x40370ef3 in GC_mark_from (mark_stack_top=0x8053110, 
mark_stack=0x80530a8,
mark_stack_limit=0x805b0a8) at mark.c:647
#1  0x40370bae in GC_mark_some (cold_gc_frame=0x40bb38b0 "??") at mark.
c:374
#2  0x40368e96 in GC_stopped_mark (stop_func=0x40368700 
<GC_never_stop_func>)
at alloc.c:500
#3  0x40368b63 in GC_try_to_collect_inner (stop_func=0x40368700
<GC_never_stop_func>) at alloc.c:353
#4  0x40373528 in GC_init_inner () at misc.c:703
#5  0x4036f3b5 in GC_generic_malloc_inner (lb=28, k=1) at malloc.c:123
#6  0x4036f503 in GC_generic_malloc (lb=28, k=1) at malloc.c:190
#7  0x4036f7e5 in GC_malloc (lb=28) at malloc.c:295
#8  0x400f4fac in mono_g_hash_table_new_full (hash_func=0x402053f0
<g_direct_hash>, key_equal_func=0x40205400 <g_direct_equal>,
     key_destroy_func=0, value_destroy_func=0) at mono-hash.c:152
#9  0x400f4f86 in mono_g_hash_table_new (hash_func=0x402053f0 
<g_direct_hash>,
key_equal_func=0x40205400 <g_direct_equal>) at mono-hash.c:122
#10 0x400f3ce7 in TlsSetValue (idx=0, value=0x804c738) at threads.c:795
#11 0x4004fe81 in mono_thread_start_cb (tid=16386, 
stack_start=0xffffffff,
func=0x0) at mini.c:5543
#12 0x40053109 in mini_init (filename=0x8049260 "oxide-domain") at 
mini.c:6943
#13 0x4007640e in mono_jit_init (file=0x8049260 "oxide-domain") at 
driver.c:777
#14 0x08048d3a in oxideInit (p=0x0) at src/oxide-3.c:72
#15 0x4014d811 in pthread_start_thread () from /lib/i686/libpthread.
so.0


Is this a gc issue?
If I build mono without gc (--with-gc=none) I was able to run oxide-3
just to make sure that mono_jit_init () doesnt segfault or hangs, (then 
the exception
backtrace below is not important).

FYI, mod_mono hangs on mono_jit_init if I switch to Apache with 
prechild MPM
(threaded too).

$ ./oxide-3

Your mono runtime and corlib are out of sync.
Corlib is: /opt/mono/lib/corlib.dll

When you update one from cvs you need to update, compile and install
the other too.
Do not report this as a bug unless you're sure you have updated 
correctly:
you probably have a broken mono install.
If you see other errors or faults after this message they are probably 
related
and you need to fix your mono install first.
OXIDE: loaded assembly: oxide.dll
OXIDE: exit code: 0
OXIDE: successfully started.
OXIDE: calling mono_thread_attach (0x804c848)

** (process:29209): WARNING **: cant resolve internal call to "System.
Reflection.MonoFieldInfo::get_field_info(System.Reflection.MonoField,
System.Reflection.MonoFieldInfo&)" (tested without signature also)

Unhandled Exception: System.NullReferenceException: A null value was 
found where an object instance was required
in (unmanaged) /lib/i686/libc.so.6 [0x4029df80]
in (unmanaged) /lib/i686/libc.so.6(__libc_free+0x7c) [0x4029cdfc]
in (unmanaged) /usr/lib/libglib-2.0.so.0(g_free+0x23) [0x401e7ce3]
in (unmanaged) /opt/mono/lib/libmono.so.0(mono_class_setup_vtable
+0x117) [0x400e1180]
in (unmanaged) /opt/mono/lib/libmono.so.0(mono_class_init+0x49e) 
[0x400e2638]
in (unmanaged) /opt/mono/lib/libmono.so.0(mono_class_vtable+0xdf) 
[0x4009e39e]
in (unmanaged) /opt/mono/lib/libmono.so.0(mono_array_new+0x74) 
[0x400a0465]
in (unmanaged) /opt/mono/lib/libmono.so.0 [0x400a657e]



-- 
Mohammad DAMT <mdamt at bisnisweb.com>



More information about the Mono-devel-list mailing list