[Mono-bugs] [Bug 662646] New: Mono segfaults if shared memory (/dev/shm) is exhausted

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Jan 5 20:19:29 EST 2011


https://bugzilla.novell.com/show_bug.cgi?id=662646

https://bugzilla.novell.com/show_bug.cgi?id=662646#c0


           Summary: Mono segfaults if shared memory (/dev/shm) is
                    exhausted
    Classification: Mono
           Product: Mono: Runtime
           Version: 2.6.x
          Platform: x86-64
        OS/Version: Linux
            Status: NEW
          Severity: Critical
          Priority: P5 - None
         Component: io-layer
        AssignedTo: lupus at novell.com
        ReportedBy: meebey at meebey.net
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US)
AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.63 Safari/534.3

A Debian user reported that his Mono 2.6.7 install is not working at all. Every
mono invocation (gacutil for example) fails in a SEGV.

We could track the issue down to the shared memory that Mono makes use of which
gets mounted to /dev/shm

redbull:/# gdb --args mono /usr/lib/mono/2.0/gacutil.exe
GNU gdb (GDB) 7.2-debian
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/mono...Reading symbols from
/usr/lib/debug/usr/bin/mono...done.
done.
(gdb) run
Starting program: /usr/bin/mono /usr/lib/mono/2.0/gacutil.exe
[Thread debugging using libthread_db enabled]
[New Thread 0xf7d34b70 (LWP 6526)]
[New Thread 0xf7534b70 (LWP 6527)]
[New Thread 0xf6d34b70 (LWP 6528)]

Program received signal SIGBUS, Bus error.
shm_semaphores_init () at shared.c:538
538    shared.c: No such file or directory.
    in shared.c
(gdb) b
Breakpoint 1 at 0x81eea52: file shared.c, line 538.
(gdb) bt
#0  shm_semaphores_init () at shared.c:538
#1  _wapi_shm_semaphores_init () at shared.c:824
#2  0x081e2136 in shared_init () at handles.c:248
#3  0x081f7817 in mono_once (once=0x82ca2b8, once_init=0x81e20e0 <shared_init>)
at mono-mutex.c:75
#4  0x081e22a4 in _wapi_handle_new (type=WAPI_HANDLE_SEM,
handle_specific=0xffffd488) at handles.c:505
#5  0x081e6bbf in sem_create (security=<value optimized out>, initial=<value
optimized out>, max=2147483647) at semaphores.c:181
#6  0x08160b33 in mono_thread_pool_init () at threadpool.c:1098
#7  0x08165a36 in mono_runtime_init (domain=0x34e70, start_cb=0x805c940
<mono_thread_start_cb>, attach_cb=0x805c990 <mono_thread_attach_cb>) at
appdomain.c:225
#8  0x0805d7bf in mini_init (filename=0xffffd8b7
"/usr/lib/mono/2.0/gacutil.exe", runtime_version=0x0) at mini.c:5520
#9  0x080b291e in mono_main (argc=2, argv=0xffffd704) at driver.c:1623
#10 0x0805b715 in main (argc=2, argv=0xffffd704) at main.c:34

For the reference the report in Debian:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=587948

Reproducible: Always

Steps to Reproduce:
redbull:/# mount -t tmpfs -o size=1 tmpfs /dev/shm 
redbull:/# mount
proc on /proc type proc (rw)
tmpfs on /dev/shm type tmpfs (rw,size=1)
redbull:/# gacutil 

Actual Results:  
** (/usr/lib/mono/2.0/gacutil.exe:6145): WARNING **: Thread (nil) may have been
prematurely finalized

** (/usr/lib/mono/2.0/gacutil.exe:6145): WARNING **: Thread (nil) may have been
prematurely finalized

** (/usr/lib/mono/2.0/gacutil.exe:6145): WARNING **: Thread (nil) may have been
prematurely finalized

** (/usr/lib/mono/2.0/gacutil.exe:6145): WARNING **: Thread (nil) may have been
prematurely finalized
Segmentation fault

Expected Results:  
No SEGV, probably fallback to something else or disable shared memory for the
remaining process?

-- 
Configure bugmail: https://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