Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Jun 2015 18:19:40 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 200937] lang/mono: [patch] mono-sgen SIGSEGV during build
Message-ID:  <bug-200937-13@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=200937

            Bug ID: 200937
           Summary: lang/mono: [patch] mono-sgen SIGSEGV during build
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Keywords: patch
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: mono@FreeBSD.org
          Reporter: tom@hur.st
          Assignee: mono@FreeBSD.org
          Keywords: patch
             Flags: maintainer-feedback?(mono@FreeBSD.org)

Created attachment 157839
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=157839&action=edit
Patch: increase _WAPI_PRIVATE_MAX_SLOTS

System: FreeBSD 10.1-STABLE #0 r283969: Wed Jun  3 22:59:38 BST 2015

Dual hex-core Westmere Xeon, 155GB RAM.

For a while now lang/mono's been segfaulting during build:

------------------------------------------------------------------------
Making all in runtime
gmake[3]: Entering directory
'/usr/obj/usr/ports/lang/mono/work/mono-4.0.1/runtime'
if test -w /usr/obj/usr/ports/lang/mono/work/mono-4.0.1/mcs; then :; else chmod
-R +w /usr/obj/usr/ports/lang/mono/work/mono-4.0.1/mcs; fi
cd /usr/obj/usr/ports/lang/mono/work/mono-4.0.1/mcs && gmake
--no-print-directory -s NO_DIR_CHECK=1 PROFILES='binary_reference_assemblies
net_4_5 xbuild_12 xbuild_14   ' CC='cc' all-profiles
gmake[7]: mcs: Command not found
build/profiles/basic.make:93: recipe for target
'build/deps/basic-profile-check.exe' failed
gmake[7]: *** [build/deps/basic-profile-check.exe] Error 127
*** The compiler 'mcs' doesn't appear to be usable.
*** Trying the 'monolite' directory.

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

build/profiles/basic.make:93: recipe for target
'build/deps/basic-profile-check.exe' failed
gmake[9]: *** [build/deps/basic-profile-check.exe] Abort trap (core dumped)
*** The contents of your 'monolite' directory may be out-of-date
*** You may want to try 'make get-monolite-latest'
build/profiles/basic.make:77: recipe for target 'do-profile-check-monolite'
failed
gmake[9]: *** [do-profile-check-monolite] Error 1
build/profiles/basic.make:60: recipe for target 'do-profile-check' failed
gmake[8]: *** [do-profile-check] Error 2
build/profiles/basic.make:85: recipe for target 'do-profile-check-monolite'
failed
gmake[7]: *** [do-profile-check-monolite] Error 2
build/profiles/basic.make:60: recipe for target 'do-profile-check' failed
gmake[6]: *** [do-profile-check] Error 2
Makefile:44: recipe for target 'profile-do--basic--all' failed
gmake[5]: *** [profile-do--basic--all] Error 2
Makefile:40: recipe for target 'profiles-do--all' failed
gmake[4]: *** [profiles-do--all] Error 2
Makefile:555: recipe for target 'all-local' failed
gmake[3]: *** [all-local] Error 2
gmake[3]: Leaving directory
'/usr/obj/usr/ports/lang/mono/work/mono-4.0.1/runtime'
Makefile:522: recipe for target 'all-recursive' failed
gmake[2]: *** [all-recursive] Error 1
gmake[2]: Leaving directory '/usr/obj/usr/ports/lang/mono/work/mono-4.0.1'
Makefile:449: recipe for target 'all' failed
gmake[1]: *** [all] Error 2
gmake[1]: Leaving directory '/usr/obj/usr/ports/lang/mono/work/mono-4.0.1'
*** Error code 1
------------------------------------------------------------------------

I can't reproduce it on a 24GB 10.1-RELEASE system.  I'm guessing it's a
high-memory/tuning issue.

mono-sgen.core reveals the following backtrace:

#0  0x00000008012eacaa in thr_kill () from /lib/libc.so.7
#1  0x00000008012eac16 in raise () from /lib/libc.so.7
#2  0x00000008012e9409 in abort () from /lib/libc.so.7
#3  0x00000000004b1903 in mono_handle_native_sigsegv (signal=<value optimized
out>, ctx=<value optimized out>,
    info=<value optimized out>) at mini-exceptions.c:2386
#4  0x000000000041eeac in mono_sigsegv_signal_handler (_dummy=11,
_info=0x7fffffffd2b0, context=0x7fffffffcf40) at mini.c:6771
#5  0x0000000800f8f997 in pthread_sigmask () from /lib/libthr.so.3
#6  0x0000000800f8f1a8 in pthread_getspecific () from /lib/libthr.so.3
#7  <signal handler called>
#8  0x0000000000607f83 in wapi_init () at handles.c:278
#9  0x00000000005a41d5 in mono_init_internal (filename=0x7fffffffdb82
".//class/lib/monolite/basic.exe",
    exe_filename=0x7fffffffdb82 ".//class/lib/monolite/basic.exe",
runtime_version=0x0) at domain.c:504
#10 0x000000000041f846 in mini_init (filename=<value optimized out>,
runtime_version=<value optimized out>) at mini.c:7404
#11 0x0000000000484b4c in mono_main (argc=8, argv=0x7fffffffd628) at
driver.c:1921
#12 0x000000000041600f in _start ()


Turns out this line in mono/io-layer/handles.c immediately before the segfault
is failing, returning -1:

    _wapi_global_signal_handle = _wapi_handle_new (WAPI_HANDLE_EVENT, NULL);

Drilling down, I see the array's running out of slots, as defined in
mono/io-layer/handles-private.h:25

    #define _WAPI_PRIVATE_MAX_SLOTS         (1024 * 16)

Increasing this to 1024 * 17 fixes the build.  Patch to drop into files/
attached.

-- 
You are receiving this mail because:
You are the assignee for the bug.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-200937-13>