Bug 6423 - Trying to use profiler causes hard crash in Mono
Summary: Trying to use profiler causes hard crash in Mono
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: General ()
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-08-06 14:06 UTC by Bojan Rajkovic [MSFT]
Modified: 2012-08-09 10:26 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 on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Bojan Rajkovic [MSFT] 2012-08-06 14:06:35 UTC
When trying to use either the logging profiler or the statistical profiler in Mono master (2.11.3/c32a854), a hard crash is encountered in build_native_trace, seemingly caused by trying to use sigaltstack to handle a managed exception of some sort. Below is the value of MONO_ENV_OPTIONS (in this case used to force MD to use SGen and to attempt to profile) and the output from the crash and mono --version:

# Only want to see allocations, trying to profile a memory usage issue.
[md-dev-env] ~/Code/Xamarin/md-addins @ export MONO_ENV_OPTIONS="--gc=sgen --profile=log:nocalls"

# Run MD
[md-dev-env] ~/Code/Xamarin/md-addins @ make run
cd /Users/bojanrajkovic/Code/Xamarin/monodevelop/main && make run
PATH="/Users/bojanrajkovic/Code/Xamarin/bockbuild/profiles/monodevelop-mac-dev/build-root/_install/bin:/usr/local/bin:/Library/Frameworks/Mono.framework/Versions/Current/bin:/usr/local/bin:/Users/bojanrajkovic/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin:/usr/local/sbin::/Applications/ohome/bin" PKG_CONFIG_PATH="/Users/bojanrajkovic/Code/Xamarin/monodevelop/local-config:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/Users/bojanrajkovic/Code/Xamarin/bockbuild/profiles/monodevelop-mac-dev/build-root/_install/lib/pkgconfig:/Users/bojanrajkovic/Code/Xamarin/bockbuild/profiles/monodevelop-mac-dev/build-root/_install/lib64/pkgconfig:/Users/bojanrajkovic/Code/Xamarin/bockbuild/profiles/monodevelop-mac-dev/build-root/_install/share/pkgconfig:" LD_LIBRARY_PATH="" DYLD_FALLBACK_LIBRARY_PATH="/Users/bojanrajkovic/Code/Xamarin/bockbuild/profiles/monodevelop-mac-dev/build-root/_install/lib:/lib:/usr/lib:" MONO_GAC_PREFIX="/usr/local:/Users/bojanrajkovic/Code/Xamarin/bockbuild/profiles/monodevelop-mac-dev/build-root/_install:MONO_GAC_PREFIX" MONODEVELOP_LOCALE_PATH="/Users/bojanrajkovic/Code/Xamarin/monodevelop/main/build/locale" MONO_ADDINS_REGISTRY="/Users/bojanrajkovic/Code/Xamarin/monodevelop/main/build/bin" UBUNTU_MENUPROXY=0 exec -a "monodevelop" /Users/bojanrajkovic/Code/Xamarin/bockbuild/profiles/monodevelop-mac-dev/build-root/_install/bin/mono --debug /Users/bojanrajkovic/Code/Xamarin/monodevelop/main/build/bin/MonoDevelop.exe --no-redirect
The Mono profiler won't overwrite existing filename: output.mlpd.
Profiling disabled: use a different name or -FILENAME to force overwrite.

Unhandled Exception:
0   mono                                0x000e7eeb build_native_trace + 43
1   mono                                0x000e8378 mono_handle_exception_internal_first_pass + 936
2   mono                                0x000e9179 mono_handle_exception_internal + 1849
3   mono                                0x000e9feb mono_handle_exception + 75
4   mono                                0x00164d29 altstack_handle_and_restore + 153
at System.NumberFormatter.GetInstance () [0x00000] in /Users/bojanrajkovic/Code/Xamarin/bockbuild/profiles/monodevelop-mac-dev/build-root/mono-2.11/_build/mono-2.11.git/mcs/class/corlib/System/NumberFormatter.cs:782
at System.NumberFormatter.NumberToString (int,System.IFormatProvider) [0x0001f] in /Users/bojanrajkovic/Code/Xamarin/bockbuild/profiles/monodevelop-mac-dev/build-root/mono-2.11/_build/mono-2.11.git/mcs/class/corlib/System/NumberFormatter.cs:939
at int.ToString () [0x00000] in /Users/bojanrajkovic/Code/Xamarin/bockbuild/profiles/monodevelop-mac-dev/build-root/mono-2.11/_build/mono-2.11.git/mcs/class/corlib/System/Int32.cs:663
at System.Text.RegularExpressions.Syntax.Parser.ResolveReferences () [0x00039] in /Users/bojanrajkovic/Code/Xamarin/bockbuild/profiles/monodevelop-mac-dev/build-root/mono-2.11/_build/mono-2.11.git/mcs/class/System/System.Text.RegularExpressions/parser.cs:1087
at System.Text.RegularExpressions.Syntax.Parser.ParseRegularExpression (string,System.Text.RegularExpressions.RegexOptions) [0x0003a] in /Users/bojanrajkovic/Code/Xamarin/bockbuild/profiles/monodevelop-mac-dev/build-root/mono-2.11/_build/mono-2.11.git/mcs/class/System/System.Text.RegularExpressions/parser.cs:141
at System.Text.RegularExpressions.Regex.CreateMachineFactory (string,System.Text.RegularExpressions.RegexOptions) [0x00006] in /Users/bojanrajkovic/Code/Xamarin/bockbuild/profiles/monodevelop-mac-dev/build-root/mono-2.11/_build/mono-2.11.git/mcs/class/System/System.Text.RegularExpressions/Regex.cs:283
at System.Text.RegularExpressions.Regex.InitNewRegex () [0x00000] in /Users/bojanrajkovic/Code/Xamarin/bockbuild/profiles/monodevelop-mac-dev/build-root/mono-2.11/_build/mono-2.11.git/mcs/class/System/System.Text.RegularExpressions/Regex.cs:264
at System.Text.RegularExpressions.Regex.Init () [0x00027] in /Users/bojanrajkovic/Code/Xamarin/bockbuild/profiles/monodevelop-mac-dev/build-root/mono-2.11/_build/mono-2.11.git/mcs/class/System/System.Text.RegularExpressions/Regex.cs:252
at System.Text.RegularExpressions.Regex..ctor (string,System.Text.RegularExpressions.RegexOptions) [0x0002b] in /Users/bojanrajkovic/Code/Xamarin/bockbuild/profiles/monodevelop-mac-dev/build-root/mono-2.11/_build/mono-2.11.git/mcs/class/System/System.Text.RegularExpressions/Regex.cs:213
at System.Text.RegularExpressions.Regex..ctor (string) [0x00000] in /Users/bojanrajkovic/Code/Xamarin/bockbuild/profiles/monodevelop-mac-dev/build-root/mono-2.11/_build/mono-2.11.git/mcs/class/System/System.Text.RegularExpressions/Regex.cs:202
at Mono.Options.OptionSet..ctor (System.Converter`2<string, string>) [0x00000] in /Users/bojanrajkovic/Code/Xamarin/monodevelop/main/src/core/MonoDevelop.Core/Mono.Options.cs:768
at Mono.Options.OptionSet..ctor () [0x00000] in /Users/bojanrajkovic/Code/Xamarin/monodevelop/main/src/core/MonoDevelop.Core/Mono.Options.cs:506
at MonoDevelop.Ide.MonoDevelopOptions.GetOptionSet () [0x00001] in /Users/bojanrajkovic/Code/Xamarin/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:551
at MonoDevelop.Ide.MonoDevelopOptions.Parse (string[]) [0x00007] in /Users/bojanrajkovic/Code/Xamarin/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:564
at MonoDevelop.Ide.IdeStartup.Main (string[]) [0x00001] in /Users/bojanrajkovic/Code/Xamarin/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:505
at MonoDevelop.Startup.MonoDevelopMain.Main (string[]) [0x00000] in /Users/bojanrajkovic/Code/Xamarin/monodevelop/main/src/core/MonoDevelop.Startup/MonoDevelop.Startup/MonoDevelopMain.cs:16
at (wrapper runtime-invoke) <Module>.runtime_invoke_int_object (object,intptr,intptr,intptr) <IL 0x0004f, 0x00096>
22  mono                                0x00011fc1 mono_jit_runtime_invoke + 1473
23  mono                                0x0023fb9a mono_runtime_invoke + 170
24  mono                                0x00242857 mono_runtime_exec_main + 631
25  mono                                0x00241a6c mono_runtime_run_main + 940
26  mono                                0x000b25ff mono_jit_exec + 239
27  mono                                0x000b2850 main_thread_handler + 560
28  mono                                0x000b4fa2 mono_main + 7634
29  mono                                0x000028ff mono_main_with_options + 815
30  mono                                0x00002998 main + 56
31  mono                                0x00002585 start + 53

make[1]: *** [runmd] Error 1
make: *** [run] Error 2

# Mono version
[md-dev-env] ~/Code/Xamarin/md-addins @ mono --version
Mono JIT compiler version 2.11.3 (master/2f9c820 Thu Jul 26 19:18:25 EDT 2012)
Copyright (C) 2002-2012 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
	TLS:           normal
	SIGSEGV:       altstack
	Notification:  kqueue
	Architecture:  x86
	Disabled:      none
	Misc:          softdebug 
	LLVM:          supported, not enabled.
	GC:            sgen
Comment 1 Zoltan Varga 2012-08-09 10:26:00 UTC
The native trace code is now disabled, so this should't happen any more.