[Mono-bugs] [Bug 539550] New: native crash when handling exceptions on amd64

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Sep 16 06:15:35 EDT 2009


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


           Summary: native crash when handling exceptions on amd64
    Classification: Mono
           Product: Mono: Runtime
           Version: SVN
          Platform: x86-64
        OS/Version: SLES 11
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: misc
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: silk at boktor.net
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Created an attachment (id=318479)
 --> (http://bugzilla.novell.com/attachment.cgi?id=318479)
crashes mono with segfault

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.2)
Gecko/20090803 Ubuntu/9.04 (jaunty) Shiretoko/3.5.2

Attached is a code that kills mono with a nativ stacktrace (SIGSEGV).
The code is stripped maximally to reproduce the error. Removing anything else,
inlining methods, removing try blocks, etc, makes the program run smoothly.

I could only reproduce it with this lock(null) and leaving the application with
Unhandled Exception.

Reproduced only on 64b OS, both AMD Opteron and Intel Xeon E5420.
Reproduced on Debian on hardware, and SLES11 on Virtual Machine.
Happens in trunk, 2.4.2.3, and I can track it probably since before 2.4.0.

Reproducible: Always

Steps to Reproduce:
1. Compile the attached sample.
2. Run it.

Actual Results:  
Just a segfault on SLES, native stacktrace on debian:

Unhandled Exception: System.Exception: Exception of type 'System.Exception' was
thrown.
  at Connection.Main (System.String[] args) [0x00012] in
/home/silk/bug-amd64/src/ReturnClient.cs:19 
Stacktrace:                                                                     


Native stacktrace:

        mono [0x485cd6]
        mono [0x4be88d]
        /lib/libpthread.so.0 [0x7f09940a5720]
        mono [0x484290]                      
        mono [0x484630]                      
        mono(mono_amd64_throw_exception+0x158) [0x4bf6e8]
        [0x4169fb36]                                     

Debug info from gdb:

[Thread debugging using libthread_db enabled]
[New Thread 0x7f09917e4950 (LWP 12177)]      
[New Thread 0x7f0994bea950 (LWP 12176)]      
[New Thread 0x7f0992666950 (LWP 12175)]      
[New Thread 0x7f0992e67950 (LWP 12174)]      
[New Thread 0x7f0993668950 (LWP 12173)]      
0x00007f09940a45ab in read () from /lib/libpthread.so.0
  6 Thread 0x7f0993668950 (LWP 12173)  0x00007f09940a1b89 in
pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
  5 Thread 0x7f0992e67950 (LWP 12174)  0x00007f09940a1b89 in
pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
  4 Thread 0x7f0992666950 (LWP 12175)  0x00007f09940a1b89 in
pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
  3 Thread 0x7f0994bea950 (LWP 12176)  0x00007f09940a4eb1 in nanosleep () from
/lib/libpthread.so.0                     
  2 Thread 0x7f09917e4950 (LWP 12177)  0x00007f09940a39a1 in sem_wait () from
/lib/libpthread.so.0                      
* 1 Thread 0x7f0994d85730 (LWP 12172)  0x00007f09940a45ab in read () from
/lib/libpthread.so.0                          

Thread 6 (Thread 0x7f0993668950 (LWP 12173)):
#0  0x00007f09940a1b89 in pthread_cond_wait@@GLIBC_2.3.2 () from
/lib/libpthread.so.0
#1  0x000000000059ce37 in GC_wait_marker () at pthread_support.c:1785           
#2  0x00000000005a9960 in GC_help_marker (my_mark_no=2) at mark.c:1116          
#3  0x000000000059bb84 in GC_mark_thread (id=0x0) at pthread_support.c:548      
#4  0x00007f099409df9a in start_thread () from /lib/libpthread.so.0             
#5  0x00007f0993b8f56d in clone () from /lib/libc.so.6                          
#6  0x0000000000000000 in ?? ()                                                 

Thread 5 (Thread 0x7f0992e67950 (LWP 12174)):
#0  0x00007f09940a1b89 in pthread_cond_wait@@GLIBC_2.3.2 () from
/lib/libpthread.so.0
#1  0x000000000059ce37 in GC_wait_marker () at pthread_support.c:1785           
#2  0x00000000005a9960 in GC_help_marker (my_mark_no=2) at mark.c:1116          
#3  0x000000000059bb84 in GC_mark_thread (id=0x1) at pthread_support.c:548      
#4  0x00007f099409df9a in start_thread () from /lib/libpthread.so.0             
#5  0x00007f0993b8f56d in clone () from /lib/libc.so.6                          
#6  0x0000000000000000 in ?? ()                                                 

Thread 4 (Thread 0x7f0992666950 (LWP 12175)):
#0  0x00007f09940a1b89 in pthread_cond_wait@@GLIBC_2.3.2 () from
/lib/libpthread.so.0
#1  0x000000000059ce37 in GC_wait_marker () at pthread_support.c:1785
#2  0x00000000005a9960 in GC_help_marker (my_mark_no=2) at mark.c:1116
#3  0x000000000059bb84 in GC_mark_thread (id=0x2) at pthread_support.c:548
#4  0x00007f099409df9a in start_thread () from /lib/libpthread.so.0
#5  0x00007f0993b8f56d in clone () from /lib/libc.so.6
#6  0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7f0994bea950 (LWP 12176)):
#0  0x00007f09940a4eb1 in nanosleep () from /lib/libpthread.so.0
#1  0x0000000000579b42 in collection_thread (unused=<value optimized out>) at
collection.c:34
#2  0x00007f099409df9a in start_thread () from /lib/libpthread.so.0
#3  0x00007f0993b8f56d in clone () from /lib/libc.so.6
#4  0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7f09917e4950 (LWP 12177)):
#0  0x00007f09940a39a1 in sem_wait () from /lib/libpthread.so.0
#1  0x00000000005688e0 in finalizer_thread (unused=<value optimized out>) at
gc.c:1014
#2  0x00000000004caef8 in start_wrapper (data=<value optimized out>) at
threads.c:657
#3  0x000000000058f143 in thread_start_routine (args=0x1ff04a8) at
wthreads.c:286
#4  0x000000000059caca in GC_start_routine (arg=0x7f0994d6ae38) at
pthread_support.c:1390
#5  0x00007f099409df9a in start_thread () from /lib/libpthread.so.0
#6  0x00007f0993b8f56d in clone () from /lib/libc.so.6
#7  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f0994d85730 (LWP 12172)):
#0  0x00007f09940a45ab in read () from /lib/libpthread.so.0
#1  0x0000000000485e3b in mono_handle_native_sigsegv (signal=<value optimized
out>, ctx=<value optimized out>) at mini-exceptions.c:1560
#2  0x00000000004be88d in mono_arch_handle_altstack_exception
(sigctx=0x7f0994d8dc40, fault_addr=<value optimized out>, stack_ovf=0) at
exceptions-amd64.c:860
#3  <signal handler called>
#4  mono_find_jit_info (domain=0x7f0994d69db0, jit_tls=<value optimized out>,
res=0x7fff567130b0, prev_ji=<value optimized out>, ctx=<value optimized out>,
new_ctx=0x7fff56712fd0, trace=0x0, lmf=0x7fff567130e0, native_offset=0x0,
    managed=0x0) at mini-exceptions.c:222
#5  0x0000000000484630 in mono_handle_exception_internal (ctx=0x7fff567131a0,
obj=0x7f09917f7d80, original_ip=0x1, test_only=0, out_filter_idx=0x0,
out_ji=0x0) at mini-exceptions.c:953
#6  0x00000000004bf6e8 in mono_amd64_throw_exception (dummy1=<value optimized
out>, dummy2=<value optimized out>, dummy3=<value optimized out>, dummy4=<value
optimized out>, dummy5=<value optimized out>,
    dummy6=<value optimized out>, exc=0x7f09917f7d80, rip=1077793552,
rsp=140734643647168, rbx=1077793296, rbp=140734643647216, r12=33732848,
r13=33304560, r14=139679128526264, r15=33289328, rdi=139679072484736, rsi=0,
    rax=139679072484736, rcx=1077794624, rdx=0, rethrow=0) at
exceptions-amd64.c:345
#7  0x000000004169fb36 in ?? ()
#8  0x00007f09917f7d80 in ?? ()
#9  0x00000000403dd310 in ?? ()
#10 0x00007fff567132c0 in ?? ()
#11 0x00000000403dd210 in ?? ()
#12 0x00007fff567132f0 in ?? ()
#13 0x000000000202b8f0 in ?? ()
#14 0x0000000001fc2ff0 in ?? ()
#15 0x00007f0994d69db8 in ?? ()
#16 0x0000000001fbf470 in ?? ()
#17 0x00007f09917f7d80 in ?? ()
#18 0x0000000000000000 in ?? ()

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


Expected Results:  
No native crash.

We have a lot of problems with every our application on AMD64 on Debian Sid.
With some luck it is all because of this bug, but if not, possibly this bug
stops us from investigating other crashes, as we do not get

When the bug is fixed it would be nice to know if it only happens on unhandled
excepions, or could it kill an application in running.

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