Bug 32661 - Mono Flag -gc=boehm doesn't work
Summary: Mono Flag -gc=boehm doesn't work
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: GC ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-07-31 08:14 UTC by Anhar Miah
Modified: 2016-09-23 20:22 UTC (History)
4 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 Anhar Miah 2015-07-31 08:14:21 UTC
I have been having a lot of issues with SEG Faults and crashes as the same as this bug:

https://bugzilla.xamarin.com/show_bug.cgi?id=29299

The workaround in that thread suggested using the Boehm GC.

I have tried putting this flag however the flag `--gc=boehm` does not seem to work?

This is the sample console application code I'm using to detect which GC is in use:


            if (GC.MaxGeneration == 0)
            {
                Console.WriteLine ("Boehm");   
            } 
            else
            {
                Console.WriteLine ("Sgen");
            }

However when invoking this on the command line:

mono --gc=boehm test.exe

it always prints `Sgen`

My mono version is:
Mono JIT compiler version 4.0.2 (Stable 4.0.2.5/c99aa0c Wed Jun 24 10:04:37 UTC 2015)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
	TLS:           __thread
	SIGSEGV:       altstack
	Notifications: epoll
	Architecture:  amd64
	Disabled:      none
	Misc:          softdebug 
	LLVM:          supported, not enabled.
	GC:            sgen

my platform is:
Linux workstation01 3.16.0-45-generic #60~14.04.1-Ubuntu SMP Fri Jul 24 21:16:23 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Any help would be most appreciated.
Comment 1 Zoltan Varga 2015-08-03 16:10:33 UTC
Try executing 'mono-boehm' directly instead.
Comment 2 Anhar Miah 2015-08-04 05:41:05 UTC
Hi Zoltan,

Many thanks for your suggestion:


I've now tried "mono-boehm" which was not installed as part of mono-complete. After installing "mono-runtime-boehm", Zoltan's suggestion worked.

I think the documentation needs to be changed as it appears that the "--gc=boehm" flag has been depreciated?

Otherwise this is fine to close this bug.

Kind Regards,
Anhar
Comment 3 Vlad Brezae 2016-09-23 20:22:07 UTC
--gc=boehm option works only if mono-boehm is present. Added a warning so we don't silently fail.