Bug 51696 - Immediate SIGSEGV on FreeBSD 11.0 when running *any* code after moving to SMP system
Summary: Immediate SIGSEGV on FreeBSD 11.0 when running *any* code after moving to SMP...
Status: NEW
Alias: None
Product: Runtime
Classification: Mono
Component: Tools (show other bugs)
Version: 4.6.0 (C8)
Hardware: PC Other
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-01-23 07:39 UTC by Phil
Modified: 2017-01-23 07:44 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 51696 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEW

Description Phil 2017-01-23 07:39:40 UTC
I had been running Mono 4.6.2.7 from FreeBSD package repositories (built from ports) without issue on a single CPU Xeon E3-1275v3.

I upgraded the system to a dual Xeon E5 (2xE5-2670v2) today and while everything else on the machine is working fine (No configuration changed at all), mono crashes immediately whenever it executes anything with the following:

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

I've tried running several of the included .exe's with this (e.g. makecert.exe) and they exit immediately.

Running with --trace does not show any further info.

I've tried to analyze the dumped core file using gdb and get as far as this:

 gdb mono-sgen mono-sgen.core 
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "amd64-marcel-freebsd"...(no debugging symbols found)...
Core was generated by `mono-sgen'.
Program terminated with signal 6, Aborted.
Reading symbols from /lib/libm.so.5...(no debugging symbols found)...done.
Loaded symbols for /lib/libm.so.5
Reading symbols from /usr/local/lib/libinotify.so.0...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libinotify.so.0
Reading symbols from /lib/libthr.so.3...(no debugging symbols found)...done.
Loaded symbols for /lib/libthr.so.3
Reading symbols from /lib/libc.so.7...(no debugging symbols found)...done.
Loaded symbols for /lib/libc.so.7
Reading symbols from /libexec/ld-elf.so.1...(no debugging symbols found)...done.
Loaded symbols for /libexec/ld-elf.so.1
#0  0x00000008012aa50a in thr_kill () from /lib/libc.so.7
[New Thread 801816000 (LWP 100910/<unknown>)]
(gdb) where
#0  0x00000008012aa50a in thr_kill () from /lib/libc.so.7
#1  0x00000008012aa4db in raise () from /lib/libc.so.7
#2  0x00000008012aa449 in abort () from /lib/libc.so.7
#3  0x00000000004a56e2 in mono_debugger_run_finally ()
#4  0x0000000000417e00 in mono_get_jit_info_from_method ()
#5  0x0000000800fca79d in pthread_sigmask () from /lib/libthr.so.3
#6  0x0000000800fc9d6f in pthread_getspecific () from /lib/libthr.so.3
#7  <signal handler called>
#8  0x00000000006366b5 in mono_gchandle_free ()
#9  0x00000000005bd734 in mono_init ()
#10 0x0000000000418bec in mini_get_debug_options ()
#11 0x0000000000473ffc in mono_main ()
#12 0x00000000004156fa in _start ()
#13 0x000000000041516f in _start ()
#14 0x000000080098b000 in ?? ()
#15 0x0000000000000000 in ?? ()


I've tried to build mono from source (via ports tree), but I'm actually getting the same SIGSEGV during the build process:


gdb mono-sgen mono-sgen.core 
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "amd64-marcel-freebsd"...(no debugging symbols found)...
Core was generated by `mono-sgen'.
Program terminated with signal 6, Aborted.
Reading symbols from /lib/libm.so.5...(no debugging symbols found)...done.
Loaded symbols for /lib/libm.so.5
Reading symbols from /usr/local/lib/libinotify.so.0...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libinotify.so.0
Reading symbols from /lib/libthr.so.3...(no debugging symbols found)...done.
Loaded symbols for /lib/libthr.so.3
Reading symbols from /lib/libc.so.7...(no debugging symbols found)...done.
Loaded symbols for /lib/libc.so.7
Reading symbols from /libexec/ld-elf.so.1...(no debugging symbols found)...done.
Loaded symbols for /libexec/ld-elf.so.1
#0  0x00000008012aa50a in thr_kill () from /lib/libc.so.7
[New Thread 801816000 (LWP 100910/<unknown>)]
(gdb) where
#0  0x00000008012aa50a in thr_kill () from /lib/libc.so.7
#1  0x00000008012aa4db in raise () from /lib/libc.so.7
#2  0x00000008012aa449 in abort () from /lib/libc.so.7
#3  0x00000000004a56e2 in mono_debugger_run_finally ()
#4  0x0000000000417e00 in mono_get_jit_info_from_method ()
#5  0x0000000800fca79d in pthread_sigmask () from /lib/libthr.so.3
#6  0x0000000800fc9d6f in pthread_getspecific () from /lib/libthr.so.3
#7  <signal handler called>
#8  0x00000000006366b5 in mono_gchandle_free ()
#9  0x00000000005bd734 in mono_init ()
#10 0x0000000000418bec in mini_get_debug_options ()
#11 0x0000000000473ffc in mono_main ()
#12 0x00000000004156fa in _start ()
#13 0x000000000041516f in _start ()
#14 0x000000080098b000 in ?? ()
#15 0x0000000000000000 in ?? ()

Feels like this may be some kind of memory access issue? FYI I have all memory slots on both CPUs occupied.

Any help is much appreciated!
Comment 1 Phil 2017-01-23 07:43:48 UTC
Ran gdb without the core file again:

gdb --args /usr/local/bin/mono-sgen /usr/local/lib/mono/4.5/makecert.exe
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "amd64-marcel-freebsd"...(no debugging symbols found)...
(gdb) run
Starting program: /usr/local/bin/mono-sgen /usr/local/lib/mono/4.5/makecert.exe
(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...[New LWP 102002]
(no debugging symbols found)...(no debugging symbols found)...[New Thread 801816000 (LWP 102002/mono-sgen)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 801816000 (LWP 102002/mono-sgen)]
0x00000000006366b5 in mono_gchandle_free ()
(gdb) bt
#0  0x00000000006366b5 in mono_gchandle_free ()
#1  0x00000000005bd734 in mono_init ()
#2  0x0000000000418bec in mini_get_debug_options ()
#3  0x0000000000473ffc in mono_main ()
#4  0x00000000004156fa in _start ()
#5  0x000000000041516f in _start ()
#6  0x000000080098b000 in ?? ()
#7  0x0000000000000000 in ?? ()
(gdb) cont
Continuing.

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


Program received signal SIGABRT, Aborted.
0x00000008012aa50a in thr_kill () from /lib/libc.so.7