[Mono-bugs] [Bug 566689] New: Ahead of time-compiled multithreaded app fails under Mono 2.6.1

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Dec 22 07:49:57 EST 2009


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

http://bugzilla.novell.com/show_bug.cgi?id=566689#c0


           Summary: Ahead of time-compiled multithreaded app fails under
                    Mono 2.6.1
    Classification: Mono
           Product: Mono: Runtime
           Version: 2.6.x
          Platform: x86-64
        OS/Version: Ubuntu
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: JIT
        AssignedTo: lupus at novell.com
        ReportedBy: apenn at hchb.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Created an attachment (id=333878)
 --> (http://bugzilla.novell.com/attachment.cgi?id=333878)
VS 2008 solution with sample app compiled in its bin\Debug folder

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.6)
Gecko/20091201 Firefox/3.5.6 (.NET CLR 3.5.30729)

We have several apps running under Mono 2.4.x using the SmartThreadPool
(http://www.codeplex.com/smartthreadpool). We have all of these exes and dlls
compiled using mono --aot *.exe *.dll. This works fine. However, under 2.6.1,
the apps using the SmartThreadPool fail if both the executable and the
SmartThreadPool.dll are precompiled with the above method. If neither or only
one are precompiled, the application works.

Sample application attached.

Stacktrace:

  at SmartThreadPoolTest.Program.DoWork (int[]) <0xffffffff>
  at SmartThreadPoolTest.Program.DoWork (int[]) <0x0009c>
  at SmartThreadPoolTest.Program.Main (string[]) <0x00045>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object
(object,intptr,intptr,intptr) <0x00054>

Native stacktrace:

        /usr/bin/cli [0x48a39e]
        /usr/bin/cli [0x4d356d]
        /lib/libpthread.so.0 [0x7f5bd3251080]
        /usr/bin/cli [0x47d3f0]
        /usr/bin/cli [0x47cccc]
        /usr/bin/cli [0x47ced1]
        /usr/bin/cli [0x47de31]
        /usr/bin/cli [0x47e051]
        /usr/bin/cli [0x481231]
        /usr/bin/cli [0x41f2db]
        /usr/bin/cli [0x41fb7e]
        /usr/bin/cli [0x48d3be]
        [0x40427168]

Debug info from gdb:

[Thread debugging using libthread_db enabled]
[New Thread 0x7f5bd3f45730 (LWP 9022)]
[New Thread 0x7f5bd0d65950 (LWP 9027)]
[New Thread 0x7f5bd137d950 (LWP 9026)]
[New Thread 0x7f5bd3db4950 (LWP 9025)]
[New Thread 0x7f5bd2a1a950 (LWP 9024)]
0x00007f5bd2d2d739 in syscall () from /lib/libc.so.6
  5 Thread 0x7f5bd2a1a950 (LWP 9024)  0x00007f5bd324d2e9 in
pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
  4 Thread 0x7f5bd3db4950 (LWP 9025)  0x00007f5bd32507e1 in nanosleep ()
   from /lib/libpthread.so.0
  3 Thread 0x7f5bd137d950 (LWP 9026)  0x00007f5bd324f281 in sem_wait ()
   from /lib/libpthread.so.0
  2 Thread 0x7f5bd0d65950 (LWP 9027)  0x00007f5bd324d56d in
pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
  1 Thread 0x7f5bd3f45730 (LWP 9022)  0x00007f5bd2d2d739 in syscall ()
   from /lib/libc.so.6

Thread 5 (Thread 0x7f5bd2a1a950 (LWP 9024)):
#0  0x00007f5bd324d2e9 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib/libpthread.so.0
#1  0x00000000005a7649 in GC_wait_marker () at pthread_support.c:1785
#2  0x00000000005accab in GC_help_marker (my_mark_no=2) at mark.c:1116
#3  0x00000000005a62e4 in GC_mark_thread (id=0x0) at pthread_support.c:548
#4  0x00007f5bd32493ba in start_thread () from /lib/libpthread.so.0
#5  0x00007f5bd2d30fcd in clone () from /lib/libc.so.6
#6  0x0000000000000000 in ?? ()

Thread 4 (Thread 0x7f5bd3db4950 (LWP 9025)):
#0  0x00007f5bd32507e1 in nanosleep () from /lib/libpthread.so.0
#1  0x000000000058c142 in collection_thread (unused=<value optimized out>)
    at collection.c:34
#2  0x00007f5bd32493ba in start_thread () from /lib/libpthread.so.0
#3  0x00007f5bd2d30fcd in clone () from /lib/libc.so.6
#4  0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7f5bd137d950 (LWP 9026)):
#0  0x00007f5bd324f281 in sem_wait () from /lib/libpthread.so.0
#1  0x000000000054f680 in finalizer_thread (unused=<value optimized out>)
    at gc.c:1022
#2  0x0000000000532ba8 in start_wrapper (data=<value optimized out>)
    at threads.c:662
#3  0x0000000000591d0b in thread_start_routine (args=0xd5b598)
    at wthreads.c:286
#4  0x00000000005a72dc in GC_start_routine (arg=0x7f5bd3de6e70)
    at pthread_support.c:1390
#5  0x00007f5bd32493ba in start_thread () from /lib/libpthread.so.0
#6  0x00007f5bd2d30fcd in clone () from /lib/libc.so.6
#7  0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7f5bd0d65950 (LWP 9027)):
#0  0x00007f5bd324d56d in pthread_cond_timedwait@@GLIBC_2.3.2 ()
   from /lib/libpthread.so.0
#1  0x000000000058f733 in _wapi_handle_timedwait_signal_handle (handle=0x400,
    timeout=0x7f5bd0d64950, alertable=1, poll=14003968) at handles.c:1609
#2  0x000000000057e7f9 in WaitForMultipleObjectsEx (numobjects=2,
    handles=0xde01c0, waitall=0, timeout=60000, alertable=1) at wait.c:726
#3  0x00000000005319dd in
ves_icall_System_Threading_WaitHandle_WaitAny_internal (mono_handles=<value
optimized out>, ms=60000,
    exitContext=<value optimized out>) at threads.c:1532
#4  0x0000000040441821 in ?? ()
#5  0x0000000000de5570 in ?? ()
#6  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f5bd3f45730 (LWP 9022)):
#0  0x00007f5bd2d2d739 in syscall () from /lib/libc.so.6
#1  0x00000000004d8260 in mono_runtime_syscall_fork () at mini-posix.c:556
#2  0x000000000048a4ce in mono_handle_native_sigsegv (signal=-872384600,
    ctx=<value optimized out>) at mini-exceptions.c:1789
#3  0x00000000004d356d in mono_arch_handle_altstack_exception (
    sigctx=0x7f5bd3de0c40, fault_addr=<value optimized out>, stack_ovf=0)
    at exceptions-amd64.c:879
#4  <signal handler called>
#5  decode_klass_ref (module=0xd91eb0, buf=<value optimized out>,
    endbuf=0x7fffdbf53bd8) at aot-runtime.c:317
#6  0x000000000047cccc in decode_method_ref (module=0xd91eb0,
    token=0x7fffdbf53c34, method=0x7fffdbf53c28, no_aot_trampoline=0x0,
    buf=0x7f5bd3d5a70f "ÿþ", endbuf=0x7fffdbf53c60) at aot-runtime.c:587
#7  0x000000000047ced1 in decode_method_ref_2 (module=0xd91eb0,
    buf=<value optimized out>, endbuf=<value optimized out>)
    at aot-runtime.c:669
#8  0x000000000047de31 in find_extra_method_in_amodule (amodule=0xd91eb0,
    method=0x7f5bcc006ec0) at aot-runtime.c:2204
#9  0x000000000047e051 in find_extra_method (method=0x7f5bcc006ec0,
    out_amodule=0x7fffdbf53d78) at aot-runtime.c:2290
#10 0x0000000000481231 in mono_aot_get_method (domain=0x7f5bd3de5db0,
    method=0x7f5bcc006ec0) at aot-runtime.c:2351
#11 0x000000000041f2db in mono_jit_compile_method_with_opt (
    method=0x7f5bcc006ec0, opt=55667199, ex=0x7fffdbf53e58) at mini.c:4066
#12 0x000000000041fb7e in mono_jit_compile_method (method=0xd91eb0)
    at mini.c:4363
#13 0x000000000048d3be in mono_magic_trampoline (regs=0x7fffdbf540c8,
    code=0x40437b7c "ò\017\021EÈH\213EàH\213ø\2038",
    arg=<value optimized out>, tramp=<value optimized out>)
    at mini-trampolines.c:476
#14 0x0000000040427168 in ?? ()
#15 0x00007f5bd2fb91f0 in ?? () from /lib/libc.so.6
#16 0x0000000000000000 in ?? ()
#0  0x00007f5bd2d2d739 in syscall () from /lib/libc.so.6

=================================================================
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.
=================================================================

Aborted


Reproducible: Always

Steps to Reproduce:
1. Precompile the attached exe and dll with: mono --aot *.exe *.dll
2. Run the application. It takes no arguments.

Actual Results:  
Stacktrace:

  at SmartThreadPoolTest.Program.DoWork (int[]) <0xffffffff>
  at SmartThreadPoolTest.Program.DoWork (int[]) <0x0009c>
  at SmartThreadPoolTest.Program.Main (string[]) <0x00045>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object
(object,intptr,intptr,intptr) <0x00054>

Native stacktrace:

        /usr/bin/cli [0x48a39e]
        /usr/bin/cli [0x4d356d]
        /lib/libpthread.so.0 [0x7f5bd3251080]
        /usr/bin/cli [0x47d3f0]
        /usr/bin/cli [0x47cccc]
        /usr/bin/cli [0x47ced1]
        /usr/bin/cli [0x47de31]
        /usr/bin/cli [0x47e051]
        /usr/bin/cli [0x481231]
        /usr/bin/cli [0x41f2db]
        /usr/bin/cli [0x41fb7e]
        /usr/bin/cli [0x48d3be]
        [0x40427168]

Debug info from gdb:

[Thread debugging using libthread_db enabled]
[New Thread 0x7f5bd3f45730 (LWP 9022)]
[New Thread 0x7f5bd0d65950 (LWP 9027)]
[New Thread 0x7f5bd137d950 (LWP 9026)]
[New Thread 0x7f5bd3db4950 (LWP 9025)]
[New Thread 0x7f5bd2a1a950 (LWP 9024)]
0x00007f5bd2d2d739 in syscall () from /lib/libc.so.6
  5 Thread 0x7f5bd2a1a950 (LWP 9024)  0x00007f5bd324d2e9 in
pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
  4 Thread 0x7f5bd3db4950 (LWP 9025)  0x00007f5bd32507e1 in nanosleep ()
   from /lib/libpthread.so.0
  3 Thread 0x7f5bd137d950 (LWP 9026)  0x00007f5bd324f281 in sem_wait ()
   from /lib/libpthread.so.0
  2 Thread 0x7f5bd0d65950 (LWP 9027)  0x00007f5bd324d56d in
pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
  1 Thread 0x7f5bd3f45730 (LWP 9022)  0x00007f5bd2d2d739 in syscall ()
   from /lib/libc.so.6

Thread 5 (Thread 0x7f5bd2a1a950 (LWP 9024)):
#0  0x00007f5bd324d2e9 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib/libpthread.so.0
#1  0x00000000005a7649 in GC_wait_marker () at pthread_support.c:1785
#2  0x00000000005accab in GC_help_marker (my_mark_no=2) at mark.c:1116
#3  0x00000000005a62e4 in GC_mark_thread (id=0x0) at pthread_support.c:548
#4  0x00007f5bd32493ba in start_thread () from /lib/libpthread.so.0
#5  0x00007f5bd2d30fcd in clone () from /lib/libc.so.6
#6  0x0000000000000000 in ?? ()

Thread 4 (Thread 0x7f5bd3db4950 (LWP 9025)):
#0  0x00007f5bd32507e1 in nanosleep () from /lib/libpthread.so.0
#1  0x000000000058c142 in collection_thread (unused=<value optimized out>)
    at collection.c:34
#2  0x00007f5bd32493ba in start_thread () from /lib/libpthread.so.0
#3  0x00007f5bd2d30fcd in clone () from /lib/libc.so.6
#4  0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7f5bd137d950 (LWP 9026)):
#0  0x00007f5bd324f281 in sem_wait () from /lib/libpthread.so.0
#1  0x000000000054f680 in finalizer_thread (unused=<value optimized out>)
    at gc.c:1022
#2  0x0000000000532ba8 in start_wrapper (data=<value optimized out>)
    at threads.c:662
#3  0x0000000000591d0b in thread_start_routine (args=0xd5b598)
    at wthreads.c:286
#4  0x00000000005a72dc in GC_start_routine (arg=0x7f5bd3de6e70)
    at pthread_support.c:1390
#5  0x00007f5bd32493ba in start_thread () from /lib/libpthread.so.0
#6  0x00007f5bd2d30fcd in clone () from /lib/libc.so.6
#7  0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7f5bd0d65950 (LWP 9027)):
#0  0x00007f5bd324d56d in pthread_cond_timedwait@@GLIBC_2.3.2 ()
   from /lib/libpthread.so.0
#1  0x000000000058f733 in _wapi_handle_timedwait_signal_handle (handle=0x400,
    timeout=0x7f5bd0d64950, alertable=1, poll=14003968) at handles.c:1609
#2  0x000000000057e7f9 in WaitForMultipleObjectsEx (numobjects=2,
    handles=0xde01c0, waitall=0, timeout=60000, alertable=1) at wait.c:726
#3  0x00000000005319dd in
ves_icall_System_Threading_WaitHandle_WaitAny_internal (mono_handles=<value
optimized out>, ms=60000,
    exitContext=<value optimized out>) at threads.c:1532
#4  0x0000000040441821 in ?? ()
#5  0x0000000000de5570 in ?? ()
#6  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f5bd3f45730 (LWP 9022)):
#0  0x00007f5bd2d2d739 in syscall () from /lib/libc.so.6
#1  0x00000000004d8260 in mono_runtime_syscall_fork () at mini-posix.c:556
#2  0x000000000048a4ce in mono_handle_native_sigsegv (signal=-872384600,
    ctx=<value optimized out>) at mini-exceptions.c:1789
#3  0x00000000004d356d in mono_arch_handle_altstack_exception (
    sigctx=0x7f5bd3de0c40, fault_addr=<value optimized out>, stack_ovf=0)
    at exceptions-amd64.c:879
#4  <signal handler called>
#5  decode_klass_ref (module=0xd91eb0, buf=<value optimized out>,
    endbuf=0x7fffdbf53bd8) at aot-runtime.c:317
#6  0x000000000047cccc in decode_method_ref (module=0xd91eb0,
    token=0x7fffdbf53c34, method=0x7fffdbf53c28, no_aot_trampoline=0x0,
    buf=0x7f5bd3d5a70f "ÿþ", endbuf=0x7fffdbf53c60) at aot-runtime.c:587
#7  0x000000000047ced1 in decode_method_ref_2 (module=0xd91eb0,
    buf=<value optimized out>, endbuf=<value optimized out>)
    at aot-runtime.c:669
#8  0x000000000047de31 in find_extra_method_in_amodule (amodule=0xd91eb0,
    method=0x7f5bcc006ec0) at aot-runtime.c:2204
#9  0x000000000047e051 in find_extra_method (method=0x7f5bcc006ec0,
    out_amodule=0x7fffdbf53d78) at aot-runtime.c:2290
#10 0x0000000000481231 in mono_aot_get_method (domain=0x7f5bd3de5db0,
    method=0x7f5bcc006ec0) at aot-runtime.c:2351
#11 0x000000000041f2db in mono_jit_compile_method_with_opt (
    method=0x7f5bcc006ec0, opt=55667199, ex=0x7fffdbf53e58) at mini.c:4066
#12 0x000000000041fb7e in mono_jit_compile_method (method=0xd91eb0)
    at mini.c:4363
#13 0x000000000048d3be in mono_magic_trampoline (regs=0x7fffdbf540c8,
    code=0x40437b7c "ò\017\021EÈH\213EàH\213ø\2038",
    arg=<value optimized out>, tramp=<value optimized out>)
    at mini-trampolines.c:476
#14 0x0000000040427168 in ?? ()
#15 0x00007f5bd2fb91f0 in ?? () from /lib/libc.so.6
#16 0x0000000000000000 in ?? ()
#0  0x00007f5bd2d2d739 in syscall () from /lib/libc.so.6

=================================================================
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.
=================================================================

Aborted


Expected Results:  
27 (the program uses a thread from the pool to average some hardcoded numbers)

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


More information about the mono-bugs mailing list