From a3e9614add73df1bc2d4032ab038bc9022220fab Mon Sep 17 00:00:00 2001 From: therzok Date: Tue, 1 Oct 2019 23:12:42 +0300 Subject: Revert "[Mac] Remove hardcoded thread suspending mode (#7800)" This reverts commit 41e6fb746da8b651884c91dedaeb60acebe20fab. Hybrid suspend causes us to lose important information from stacktraces. See https://github.com/mono/mono/issues/17084 The stacktrace information is complete whenever preemptive mode is used, so switch back to what we used to have. Fixes VSTS #988893 - Incomplete exception callstack due to static registrar --- main/build/MacOSX/Makefile.am | 2 +- main/build/MacOSX/monostub.mm | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'main/build') diff --git a/main/build/MacOSX/Makefile.am b/main/build/MacOSX/Makefile.am index 07b54e968c..d5376015c1 100644 --- a/main/build/MacOSX/Makefile.am +++ b/main/build/MacOSX/Makefile.am @@ -12,7 +12,7 @@ EXTERNAL=../../external MONOSTUB_STATIC_LINK=$(EXTERNAL)/Xamarin.Mac.registrar.full.a if !RELEASE_BUILDS -HYBRID_SUSPEND_ABORT_DEBUG=-DHYBRID_SUSPEND_ABORT_DEBUG +HYBRID_SUSPEND_ABORT=-DHYBRID_SUSPEND_ABORT endif #SDK_PATH=$(shell xcrun --sdk macosx10.8 --show-sdk-path) diff --git a/main/build/MacOSX/monostub.mm b/main/build/MacOSX/monostub.mm index 942bde75a2..f42dd641aa 100644 --- a/main/build/MacOSX/monostub.mm +++ b/main/build/MacOSX/monostub.mm @@ -281,11 +281,13 @@ main (int argc, char **argv) // prevents the code from running correctly, so unset it here. // See https://devdiv.visualstudio.com/DevDiv/_workitems/edit/896438 unsetenv ("MONO_REGISTRY_PATH"); - -#if HYBRID_SUSPEND_ABORT_DEBUG +#if HYBRID_SUSPEND_ABORT setenv ("MONO_SLEEP_ABORT_LIMIT", "5000", 0); #endif + // To be removed: https://github.com/mono/monodevelop/issues/6326 + setenv ("MONO_THREADS_SUSPEND", "preemptive", 0); + setenv ("MONO_GC_PARAMS", "major=marksweep-conc,nursery-size=8m", 0); void *libmono = dlopen ("libmonosgen-2.0.dylib", RTLD_LAZY); -- cgit v1.2.3