[Mono-bugs] [Bug 555004] Crash after AppDomain loads dll with missing dependency

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Nov 22 20:22:54 EST 2009


http://bugzilla.novell.com/show_bug.cgi?id=555004

http://bugzilla.novell.com/show_bug.cgi?id=555004#c2


Brett Kiefer <brett at fogcreek.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #327215|0                           |1
        is obsolete|                            |

--- Comment #2 from Brett Kiefer <brett at fogcreek.com> 2009-11-23 01:22:43 UTC ---
Created an attachment (id=328887)
 --> (http://bugzilla.novell.com/attachment.cgi?id=328887)
A test app that demonstrates the crash from the command line as well as from
mod_mono

Here is a modified version of the test case that does the assembly load twice
in a row from in both the command-line and mod_mono cases; this causes both to
segfault immediately in mono 2.4.2.3. This version t also sets the app path in
a more standard way, so you don't need to copy the .dlls to /tmp.

I see the crash when I run the command-line app under mono 2.4.2.3 after
deleting FiveMaker.dll, but NOT when I run it under Mono 1.2.6, so that may be
a clue for trying to bisect this out. Mono 1.2.6 just gives me the expected
loader exceptions and exits politely.

Both 2.4.2.4 and 1.2.6 show the proper 2+2=5 output before I delete
FiveMaker.dll.

Here is my session using Mono 2.4.2.3, with the good run, the .dll removal, and
the stack trace:

$ mono_2.4.2.3 Work.exe
2 + 2 = 5
-------- DONE WITH TEST 1 ----------
2 + 2 = 5
-------- DONE WITH TEST 2 ----------
$ rm FiveMaker.dll
$ mono_2.4.2.3 Work.exe
The following assembly referenced from /home/brett/worktest/bin/Worker.dll
could not be loaded:
     Assembly:   FiveMaker    (assemblyref_index=1)
     Version:    0.0.0.0
     Public Key: (none)
The assembly was not found in the Global Assembly Cache, a path listed in the
MONO_PATH environment variable, or in the location of the executing assembly
(/home/brett/worktest/bin/).
System.IO.FileNotFoundException: Could not load file or assembly 'FiveMaker,
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its
dependencies.
File name: 'FiveMaker, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
  at (wrapper xdomain-invoke) WorkSpace.Worker:Five ()
  at WorkTest.HttpHandler.Work (System.String appPath) [0x00000]
  at WorkTest.HttpHandler.WorkTest (System.String appPath) [0x00000]
  at WorkTest.HttpHandler.TestWithCatch (System.String appPath) [0x00000]
-------- DONE WITH TEST 1 ----------
Stacktrace:

  at (wrapper remoting-invoke-with-check) WorkSpace.Worker.Five () <0x00054>
  at (wrapper remoting-invoke-with-check) WorkSpace.Worker.Five () <0xffffffff>
  at (wrapper xdomain-dispatch) WorkSpace.Worker.Five (object,byte[]&,byte[]&)
<0xffffffff>
  at (wrapper xdomain-invoke) WorkSpace.Worker.Five () <0xffffffff>
  at WorkTest.HttpHandler.Work (string) <0x00114>
  at WorkTest.HttpHandler.WorkTest (string) <0x00010>
  at WorkTest.HttpHandler.TestWithCatch (string) <0x0001e>
  at WorkTest.HttpHandler.Main () <0x00043>
  at (wrapper runtime-invoke) object.runtime_invoke_void
(object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

 /opt/fogbugz/runtime/bin/mono [0x80cdfc8]
 /opt/fogbugz/runtime/bin/mono [0x80f82d3]
 [0xffffe600]
 /opt/fogbugz/runtime/bin/mono(mono_exception_from_name_domain+0x2f)
[0x815f67f]
 /opt/fogbugz/runtime/bin/mono(mono_exception_from_name+0x28) [0x815f701]
 /opt/fogbugz/runtime/bin/mono(mono_exception_from_name_msg+0x24) [0x815f8b6]
 /opt/fogbugz/runtime/bin/mono [0x805facb]
 /opt/fogbugz/runtime/bin/mono [0x80d5d81]
 [0xf7c90066]
 [0xf7128887]
 [0xf72988a7]
 [0xf7a0648d]
 [0xf7a06319]
 [0xf7a062af]
 [0xf7a06244]
 [0xf7a061c2]
 /opt/fogbugz/runtime/bin/mono(mono_runtime_exec_main+0xe4) [0x8114392]
 /opt/fogbugz/runtime/bin/mono(mono_runtime_run_main+0x17e) [0x8117006]
 /opt/fogbugz/runtime/bin/mono(mono_main+0x1431) [0x80b3dcc]
 /lib32/libc.so.6(__libc_start_main+0xe0) [0xf7dd7450]
 /opt/fogbugz/runtime/bin/mono(dl_iterate_phdr+0x119) [0x8056e21]

Debug info from gdb:

warning: Lowest section in system-supplied DSO at 0xffffe000 is .hash at
ffffe0b4
[Thread debugging using libthread_db enabled]
[New Thread 0xf7dc0950 (LWP 14730)]
[New Thread 0xf6fffb90 (LWP 14736)]
[New Thread 0xf727bb90 (LWP 14733)]
[New Thread 0xf7648b90 (LWP 14732)]
[New Thread 0xf766cb90 (LWP 14731)]
0xffffe410 in __kernel_vsyscall ()
  5 Thread 0xf766cb90 (LWP 14731)  0xffffe410 in __kernel_vsyscall ()
  4 Thread 0xf7648b90 (LWP 14732)  0xffffe410 in __kernel_vsyscall ()
  3 Thread 0xf727bb90 (LWP 14733)  0xffffe410 in __kernel_vsyscall ()
  2 Thread 0xf6fffb90 (LWP 14736)  0xffffe410 in __kernel_vsyscall ()
  1 Thread 0xf7dc0950 (LWP 14730)  0xffffe410 in __kernel_vsyscall ()

Thread 5 (Thread 0xf766cb90 (LWP 14731)):
#0  0xffffe410 in __kernel_vsyscall ()
#1  0xf7f42606 in nanosleep () from /lib32/libpthread.so.0
#2  0x081a6cbf in collection_thread (unused=0x0) at collection.c:34
#3  0xf7f3a4fb in start_thread () from /lib32/libpthread.so.0
#4  0xf7e9a08e in clone () from /lib32/libc.so.6

Thread 4 (Thread 0xf7648b90 (LWP 14732)):
#0  0xffffe410 in __kernel_vsyscall ()
#1  0xf7f41175 in sem_wait@@GLIBC_2.1 () from /lib32/libpthread.so.0
#2  0x08130722 in finalizer_thread (unused=0x0) at gc.c:1058
#3  0x08155077 in start_wrapper (data=0x83183c0) at threads.c:623
#4  0x081c3c18 in thread_start_routine (args=0x830b24c) at threads.c:286
#5  0x081edd50 in GC_start_routine (arg=0x56fe0) at pthread_support.c:1382
#6  0xf7f3a4fb in start_thread () from /lib32/libpthread.so.0
#7  0xf7e9a08e in clone () from /lib32/libc.so.6

Thread 3 (Thread 0xf727bb90 (LWP 14733)):
#0  0xffffe410 in __kernel_vsyscall ()
#1  0xf7f3f242 in pthread_cond_timedwait@@GLIBC_2.3.2 () from
/lib32/libpthread.so.0
#2  0x081ad044 in _wapi_handle_timedwait_signal_handle (handle=0x40a,
timeout=0xf727b044, alertable=1, poll=0)
    at handles.c:1603
#3  0x081c748a in WaitForSingleObjectEx (handle=0x40a, timeout=4495,
alertable=1) at wait.c:207
#4  0x08153a42 in ves_icall_System_Threading_WaitHandle_WaitOne_internal
(this=0xf4990, handle=0xfffffdfc, ms=-516,
    exitContext=1) at threads.c:1446
#5  0xf728a48d in ?? ()
#6  0xf728a00e in ?? ()
#7  0xf72886ac in ?? ()
#8  0xf72e2d60 in ?? ()
#9  0x0811153a in mono_runtime_delegate_invoke (delegate=0x0,
params=0xfffffdfc, exc=0xfffffdfc) at object.c:2943
#10 0x081550d1 in start_wrapper (data=0x0) at threads.c:629
#11 0x081c3c18 in thread_start_routine (args=0x830b3e4) at threads.c:286
#12 0x081edd50 in GC_start_routine (arg=0xfbfe0) at pthread_support.c:1382
#13 0xf7f3a4fb in start_thread () from /lib32/libpthread.so.0
#14 0xf7e9a08e in clone () from /lib32/libc.so.6

Thread 2 (Thread 0xf6fffb90 (LWP 14736)):
#0  0xffffe410 in __kernel_vsyscall ()
#1  0xf7f3f242 in pthread_cond_timedwait@@GLIBC_2.3.2 () from
/lib32/libpthread.so.0
#2  0x081ad044 in _wapi_handle_timedwait_signal_handle (handle=0x40d,
timeout=0xf6fff044, alertable=1, poll=0)
    at handles.c:1603
#3  0x081c748a in WaitForSingleObjectEx (handle=0x40d, timeout=4497,
alertable=1) at wait.c:207
#4  0x08153a42 in ves_icall_System_Threading_WaitHandle_WaitOne_internal
(this=0x114420, handle=0xfffffdfc, ms=-516,
    exitContext=1) at threads.c:1446
#5  0xf7128e55 in ?? ()
#6  0xf7128bc6 in ?? ()
#7  0xf71276ac in ?? ()
#8  0xf714bd60 in ?? ()
#9  0x0811153a in mono_runtime_delegate_invoke (delegate=0x0,
params=0xfffffdfc, exc=0xfffffdfc) at object.c:2943
#10 0x081550d1 in start_wrapper (data=0x0) at threads.c:629
#11 0x081c3c18 in thread_start_routine (args=0x830b57c) at threads.c:286
#12 0x081edd50 in GC_start_routine (arg=0xfbfc0) at pthread_support.c:1382
#13 0xf7f3a4fb in start_thread () from /lib32/libpthread.so.0
#14 0xf7e9a08e in clone () from /lib32/libc.so.6

Thread 1 (Thread 0xf7dc0950 (LWP 14730)):
#0  0xffffe410 in __kernel_vsyscall ()
#1  0xf7f41e0b in read () from /lib32/libpthread.so.0
#2  0x080ce203 in mono_handle_native_sigsegv (signal=11, ctx=0xf7c8fd0c) at
mini-exceptions.c:1587
#3  0x080f82d3 in mono_arch_handle_altstack_exception (sigctx=0xf7c8fd0c,
fault_addr=0x1b, stack_ovf=0)
    at exceptions-x86.c:881
#4  <signal handler called>
#5  mono_object_new_specific (vtable=0x0) at object.c:3581
#6  0x0815f67f in mono_exception_from_name_domain (domain=0x0, image=0x0,
name_space=0x0, name=0x0) at exception.c:57
#7  0x0815f701 in mono_exception_from_name (image=0x0, name_space=0x0,
name=0x0) at exception.c:33
#8  0x0815f8b6 in mono_exception_from_name_msg (image=0x0, name_space=0x0,
name=0x0,
    msg=0x8491468 "Missing or incorrect header for method Five") at
exception.c:170
#9  0x0805facb in mono_jit_compile_method (method=0x84596dc) at mini.c:3881
#10 0x080d5d81 in mono_magic_trampoline (regs=0xff83bb38, code=0xf712898c
"\203Ä\020\215eü^ÉÃ", m=0x84596dc, tramp=0x0)
    at mini-trampolines.c:292
#11 0xf7c90066 in ?? ()
#12 0xf7128887 in ?? ()
#13 0xf72988a7 in ?? ()
#14 0xf7a0648d in ?? ()
#15 0xf7a06319 in ?? ()
#16 0xf7a062af in ?? ()
#17 0xf7a06244 in ?? ()
#18 0xf7a061c2 in ?? ()
#19 0x08114392 in mono_runtime_exec_main (method=0x118f20, args=0x3be60,
exc=0x0) at object.c:3309
#20 0x08117006 in mono_runtime_run_main (method=0x82f35c4, argc=0,
argv=0xff83c0e8, exc=0x0) at object.c:3089
#21 0x080b3dcc in mono_main (argc=2, argv=0xff83c0e4) at driver.c:972
#22 0xf7dd7450 in __libc_start_main () from /lib32/libc.so.6
#23 0x08056e21 in _start () at ../sysdeps/i386/elf/start.S:119
#0  0xffffe410 in __kernel_vsyscall ()

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

Could not load file or assembly 'FiveMaker, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null' or one of its dependencies.Could not load file or assembly
'FiveMaker, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of
its dependencies.Aborted

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list