Bug 44355 - Build crashes with assertion in gc.c when compiling resources
Summary: Build crashes with assertion in gc.c when compiling resources
Status: RESOLVED DUPLICATE of bug 52429
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: General (show other bugs)
Version: 6.1.0 (C8)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: master
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-09-15 09:09 UTC by Svante
Modified: 2017-05-18 11:00 UTC (History)
4 users (show)

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


Attachments
IDE Log as requested (29.56 KB, text/plain)
2016-09-16 08:59 UTC, Svante
Details

Description Svante 2016-09-15 09:09:41 UTC
Description of Problem:

Buildin in Xamarin Studion on Mac fails.
Steps to reproduce the problem:
1. 'Build'

Actual Results:

		* Assertion at gc.c:910, condition `ret != WAIT_TIMEOUT' not met
		Stacktrace:
		
		
		
		Native stacktrace:
		
			0   mono-sgen32                         0x000f8736 mono_handle_native_sigsegv + 342
			1   mono-sgen32                         0x0014b981 sigabrt_signal_handler + 145
			2   libsystem_platform.dylib            0x90e8179b _sigtramp + 43
			3   ???                                 0xffffffff 0x0 + 4294967295
			4   libsystem_c.dylib                   0x9aceac38 abort + 156
			5   mono-sgen32                         0x002c2981 monoeg_log_default_handler + 129
			6   mono-sgen32                         0x002c2a7b monoeg_assertion_message + 107
			7   mono-sgen32                         0x00218339 mono_gc_cleanup + 1113
			8   mono-sgen32                         0x00210060 mono_runtime_cleanup + 16
			9   mono-sgen32                         0x0003b997 mini_cleanup + 791
			10  mono-sgen32                         0x000bf6c5 mono_main + 8869
			11  mono-sgen32                         0x0002a9e1 main + 1217
			12  mono-sgen32                         0x0002a515 start + 53
		
		Debug info from gdb:
		
		(lldb) command source -s 0 '/tmp/mono-gdb-commands.Jowo0J'
		Executing commands in '/tmp/mono-gdb-commands.Jowo0J'.
		(lldb) process attach --pid 72087
		warning: (i386) /Library/Frameworks/Mono.framework/Versions/4.6.0/lib/mono/4.5/mscorlib.dll.dylib empty dSYM file detected, dSYM was created with an executable with no debug info.
		warning: (i386) /Library/Frameworks/Mono.framework/Versions/4.6.0/lib/libglib-2.0.0.dylib empty dSYM file detected, dSYM was created with an executable with no debug info.
		Process 72087 stopped
		* thread #1: tid = 0x857f4f, 0x93491cee libsystem_kernel.dylib`__wait4 + 10, name = 'tid_50b', queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
		    frame #0: 0x93491cee libsystem_kernel.dylib`__wait4 + 10
		libsystem_kernel.dylib`__wait4:
		->  0x93491cee <+10>: jae    0x93491cfe                ; <+26>
		    0x93491cf0 <+12>: calll  0x93491cf5                ; <+17>
		    0x93491cf5 <+17>: popl   %edx
		    0x93491cf6 <+18>: movl   0xfbbc32f(%edx), %edx
		
		Executable module set to "/Library/Frameworks/Mono.framework/Versions/4.6.0/bin/mono-sgen32".
		Architecture set to: i386-apple-macosx.
		(lldb) thread list
		Process 72087 stopped
		* thread #1: tid = 0x857f4f, 0x93491cee libsystem_kernel.dylib`__wait4 + 10, name = 'tid_50b', queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
		  thread #2: tid = 0x857f50, 0x934913ea libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'SGen worker'
		  thread #3: tid = 0x857f51, 0x036c9d03 libfreetype.6.dylib`FT_MulFix_i386 + 3, name = 'Finalizer'
		  thread #4: tid = 0x857f53, 0x934927fa libsystem_kernel.dylib`kevent_qos + 10, queue = 'com.apple.libdispatch-manager'
		(lldb) thread backtrace all
		* thread #1: tid = 0x857f4f, 0x93491cee libsystem_kernel.dylib`__wait4 + 10, name = 'tid_50b', queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
		  * frame #0: 0x93491cee libsystem_kernel.dylib`__wait4 + 10
		    frame #1: 0x9ad0a7e0 libsystem_c.dylib`waitpid$UNIX2003 + 48
		    frame #2: 0x000f87fd mono-sgen32`mono_handle_native_sigsegv(signal=6, ctx=0xbffd839c, info=0xbffd835c) + 541 at mini-exceptions.c:2427 [opt]
		    frame #3: 0x0014b981 mono-sgen32`sigabrt_signal_handler(_dummy=<unavailable>, _info=<unavailable>, context=<unavailable>) + 145 at mini-posix.c:227 [opt]
		    frame #4: 0x90e8179b libsystem_platform.dylib`_sigtramp + 43
		
		  thread #2: tid = 0x857f50, 0x934913ea libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'SGen worker'
		    frame #0: 0x934913ea libsystem_kernel.dylib`__psynch_cvwait + 10
		    frame #1: 0x99eb0538 libsystem_pthread.dylib`_pthread_cond_wait + 757
		    frame #2: 0x99eb2276 libsystem_pthread.dylib`pthread_cond_wait$UNIX2003 + 71
		    frame #3: 0x0028add5 mono-sgen32`thread_func [inlined] mono_os_cond_wait(mutex=0xb00810b0) + 18 at mono-os-mutex.h:107 [opt]
		    frame #4: 0x0028adc3 mono-sgen32`thread_func(thread_data=<unavailable>) + 195 at sgen-thread-pool.c:110 [opt]
		    frame #5: 0x99eaf780 libsystem_pthread.dylib`_pthread_body + 138
		    frame #6: 0x99eaf6f6 libsystem_pthread.dylib`_pthread_start + 155
		    frame #7: 0x99eacf7a libsystem_pthread.dylib`thread_start + 34
		
		  thread #3: tid = 0x857f51, 0x036c9d03 libfreetype.6.dylib`FT_MulFix_i386 + 3, name = 'Finalizer'
		    frame #0: 0x036c9d03 libfreetype.6.dylib`FT_MulFix_i386 + 3
		    frame #1: 0x036d10ab libfreetype.6.dylib`cf2_glyphpath_hintPoint + 235
		    frame #2: 0x036d090d libfreetype.6.dylib`cf2_glyphpath_pushPrevElem + 413
		    frame #3: 0x036cd5a4 libfreetype.6.dylib`cf2_glyphpath_lineTo + 356
		    frame #4: 0x036cacd2 libfreetype.6.dylib`cf2_interpT2CharString + 1730
		    frame #5: 0x036ca09b libfreetype.6.dylib`cf2_getGlyphOutline + 219
		    frame #6: 0x036c9bb6 libfreetype.6.dylib`cf2_decoder_parse_charstrings + 646
		    frame #7: 0x036c8c4c libfreetype.6.dylib`cff_slot_load + 2060
		    frame #8: 0x036c2f35 libfreetype.6.dylib`cff_glyph_load + 197
		    frame #9: 0x0368bcf6 libfreetype.6.dylib`FT_Load_Glyph + 902
		    frame #10: 0x03657a86 libfontconfig.1.dylib`FcFreeTypeCheckGlyph + 134
		    frame #11: 0x03656740 libfontconfig.1.dylib`FcFreeTypeCharSetAndSpacingForSize + 1376
		    frame #12: 0x036558c9 libfontconfig.1.dylib`FcFreeTypeCharSetAndSpacing + 313
		    frame #13: 0x03654627 libfontconfig.1.dylib`FcFreeTypeQueryFace + 6551
		    frame #14: 0x03655a43 libfontconfig.1.dylib`FcFreeTypeQuery + 163
		    frame #15: 0x0364ef53 libfontconfig.1.dylib`FcFileScanFontConfig + 179
		    frame #16: 0x0364ee86 libfontconfig.1.dylib`FcFileScanConfig + 118
		    frame #17: 0x0364f447 libfontconfig.1.dylib`FcDirScanConfig + 743
		    frame #18: 0x0364f695 libfontconfig.1.dylib`FcDirCacheScan + 261
		    frame #19: 0x0364f790 libfontconfig.1.dylib`FcDirCacheRead + 112
		    frame #20: 0x03644d21 libfontconfig.1.dylib`FcConfigAddDirList + 193
		    frame #21: 0x03644bc0 libfontconfig.1.dylib`FcConfigBuildFonts + 176
		    frame #22: 0x03658677 libfontconfig.1.dylib`FcInitLoadConfigAndFonts + 55
		    frame #23: 0x036586e2 libfontconfig.1.dylib`FcInit + 50
		    frame #24: 0x02e9016b libgdiplus.dylib`GdiplusStartup(token=0x7d12a680, input=0xb01828ac, output=0xb01828bc) + 107 at general.c:49
		    frame #25: 0x00736cf8
		    frame #26: 0x007366c4
		    frame #27: 0x0073685d
		    frame #28: 0x0003ac07 mono-sgen32`mono_jit_runtime_invoke(method=<unavailable>, obj=<unavailable>, params=<unavailable>, error=<unavailable>) + 1527 at mini-runtime.c:2547 [opt]
		    frame #29: 0x0021f340 mono-sgen32`do_runtime_invoke(method=<unavailable>, obj=<unavailable>, params=<unavailable>, exc=<unavailable>, error=<unavailable>) + 96 at object.c:2949 [opt]
		    frame #30: 0x0021b5c9 mono-sgen32`mono_runtime_class_init_full [inlined] mono_runtime_try_invoke(method=<unavailable>, params=<unavailable>, error=0xb0182bd0) + 985 at object.c:3060 [opt]
		    frame #31: 0x0021b56d mono-sgen32`mono_runtime_class_init_full(vtable=0xb01829c8, error=0xb0182bd0) + 893 at object.c:434 [opt]
		    frame #32: 0x00033f47 mono-sgen32`mono_jit_compile_method_inner(method=<unavailable>, target_domain=<unavailable>, opt=<unavailable>, error=0xb0182bd0) + 2647 at mini.c:4366 [opt]
		    frame #33: 0x00036929 mono-sgen32`mono_jit_compile_method_with_opt(method=<unavailable>, opt=<unavailable>, error=0x007363a0) + 777 at mini-runtime.c:1910 [opt]
		    frame #34: 0x00036612 mono-sgen32`mono_jit_compile_method(method=0x7c98d7c8, error=0xb0182bd0) + 50 at mini-runtime.c:1954 [opt]
		    frame #35: 0x000faddd mono-sgen32`common_call_trampoline(regs=<unavailable>, code=<unavailable>, m=<unavailable>, vt=0x7d12a618, vtable_slot=0x00000000, error=<unavailable>) + 1085 at mini-trampolines.c:702 [opt]
		    frame #36: 0x000fa96a mono-sgen32`mono_magic_trampoline(regs=0xb0182c40, code="\x0f\xb6\U00000005�t0\x8bG(�D$\x04", arg=0x7c98d7c8, tramp=0x00000000) + 74 at mini-trampolines.c:828 [opt]
		    frame #37: 0x0060a188
		
		  thread #4: tid = 0x857f53, 0x934927fa libsystem_kernel.dylib`kevent_qos + 10, queue = 'com.apple.libdispatch-manager'
		    frame #0: 0x934927fa libsystem_kernel.dylib`kevent_qos + 10
		    frame #1: 0x9a4687ea libdispatch.dylib`_dispatch_mgr_invoke + 234
		    frame #2: 0x9a4683be libdispatch.dylib`_dispatch_mgr_thread + 52
		(lldb) detach
		
		=================================================================
		Got a SIGABRT while executing native code. This usually indicates
		a fatal error in the mono runtime or one of the native libraries 
		used by your application.
		=================================================================
		
		Process 72087 detached
		(lldb) quit
		Tool /Library/Frameworks/Mono.framework/Versions/4.6.0/lib/mono/4.5/resgen.exe execution finished.
/Library/Frameworks/Mono.framework/Versions/4.6.0/lib/mono/xbuild/14.0/bin/Microsoft.Common.targets: error : Tool exited with code: 134. Output: Read in 1 resources from '/Users/svante/Documents/source/axcrypt-net/Axantum.AxCrypt/WatchedFoldersDialog.resx'
Writing resource file...  Done.
* Assertion at gc.c:910, condition `ret != WAIT_TIMEOUT' not met

Expected Results:

That the build succeeds...

How often does this happen?

Frequently but not every time. It appears it happens in different places during the build, but always with resources.

Additional Information:

Xamarin Studio Professional
Version 6.1 (build 5441)
Runtime:
	Mono 4.6.0 (mono-4.6.0-branch/746756c) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 406000245

NuGet
Version: 3.4.3.0
Comment 1 Lluis Sanchez 2016-09-15 16:56:27 UTC
Hi,

Thanks for the bug report. To further diagnose the issue we need some additional information.

1) In the Xamarin Studio About box, click on Show Details and then on Copy Information, then add the information to the bug report.
2) Click on the command Help -> Open Log Directory, then attach the latest IDE log file.

Also, which kind of project are you building?

Thanks.
Comment 2 Svante 2016-09-16 08:59:52 UTC
Created attachment 17531 [details]
IDE Log as requested
Comment 3 Svante 2016-09-16 09:01:28 UTC
=== Xamarin Studio Professional ===

Version 6.1 (build 5441)
Installation UUID: 42edbf2e-3328-4ce7-b490-93a86a240554
Runtime:
	Mono 4.6.0 (mono-4.6.0-branch/746756c) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 406000245

=== NuGet ===

Version: 3.4.3.0

=== Xamarin.Profiler ===

Not Installed

=== Apple Developer Tools ===

Xcode 7.3.1 (10188.1)
Build 7D1014

=== Xamarin.Mac ===

Version: 2.10.0.99 (Visual Studio Professional)

=== Xamarin.iOS ===

Version: 10.0.0.6 (Visual Studio Professional)
Hash: 6c3fee4
Branch: xcode8
Build date: 2016-09-09 13:01:32-0400

=== Xamarin.Android ===

Version: 7.0.0.18 (Visual Studio Professional)
Android SDK: /Users/svante/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.0.3 (API level 15)
		4.4   (API level 19)
		6.0   (API level 23)

SDK Tools Version: 24.4.1
SDK Platform Tools Version: 23.0.1
SDK Build Tools Version: 23.0.1

Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin Android Player ===

Not Installed

=== Build Information ===

Release ID: 601005441
Git revision: 68292d1ab289911c815ddc715dd7cc29a9752f9f
Build date: 2016-09-09 04:43:23-04
Xamarin addins: ed25d008672663eeb9db55f1ccecb3c24d2fd3b2
Build lane: monodevelop-lion-cycle8

=== Operating System ===

Mac OS X 10.11.6
Darwin MacBook-AxCrypt.local 15.6.0 Darwin Kernel Version 15.6.0
    Thu Jun 23 18:25:34 PDT 2016
    root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64
Comment 4 Lluis Sanchez 2016-09-16 09:11:48 UTC
Hi,

Would you be able to share a project that can be used to reproduce the crash?

Thanks.
Comment 5 Svante 2016-09-16 09:27:12 UTC
Hi,

Sure. It's intermittent - could not repro today :-( It was pretty consistent yesterday.

The project is found at https://bitbucket.org/axantum/axcrypt-net (I'm the author).
Comment 6 David Evans 2016-10-19 21:22:20 UTC
I'm seeing a similar intermittent crash building with xbuild now that I'm testing mono 4.6.1 (was on 4.0.4.1 before without issue). I confirmed there is plenty of physical memory as well as gigs of swap left when this fault occurs. My stack traces are on in this pastebin:
http://pastebin.com/vQ4630Dv

My traces look closer to bug 44970 but I thought I'd mention it here as well, since it looks like heap corruption generally to me and might have the same underlying cause as this issue.
Comment 7 Vimal 2016-11-16 06:14:09 UTC
I am also getting this error frequently, but not all the time. This is happening in the build server when two are more build projects are running at the same time and it happens. But if we trigger another build for the failed one it goes fine. 

So from what i can say, if two are more builds are running simultaneously this is happening, but will not say all the time. 

Setup detail: Jenkin running on a mac and connected to TFS for source code.


log detail (truncated):

Xamarin Studio Build Tool
ERROR [2016-11-16 11:04:09Z]: Another XS process is sending telemetry packets
System.IO.IOException: Lock violation on path 

/Users/Vimal/Library/Caches/Xamarin/AppInsights/ad58ff9da41d9e46a009b5b523971c10f8ed4e28/storage-lock
  at System.IO.FileStream.Lock (System.Int64 position, System.Int64 length) [0x00056] in /private/tmp/source-mono-4.6.0-

c8sr0/bockbuild-mono-4.6.0-branch-c8sr0/profiles/mono-mac-xamarin/build-root/mono-

x86/mcs/class/corlib/System.IO/FileStream.cs:869
  at Xamarin.Ide.LogReporting.AppInsights.Channel.PersistenceTransmitter.AcquireMutex (System.Action action) [0x0001b] in 

/Users/builder/data/lanes/3816/44d481a9/source/md-

addins/Xamarin.Ide/Xamarin.IdeCustomization/Xamarin.Ide.LogReporting/AppInsights/Channel/PersistenceTransmitter.cs:91
ERROR [2016-11-16 11:04:09Z]: PersistenceTransmitter: Unhandled exception in CreateSenders:
ERROR [2016-11-16 11:04:10Z]: Error initializing MacServices.
System.NullReferenceException: Object reference not set to an instance of an object
  at ObjCRuntime.Class.Register (System.Type type) [0x00001] in <749929a4fe8941c3b7dea55b58d85781>:0
  at ObjCRuntime.Runtime.RegisterAssembly (System.Reflection.Assembly a) [0x00148] in <749929a4fe8941c3b7dea55b58d85781>:0
  at Xamarin.MacDev.MacServices.Initialize (System.Boolean enable_xcode_plugins) [0x0004a] in 

/Users/builder/data/lanes/3816/44d481a9/source/md-addins/external/maciostools/Xamarin.MacDev.Ide/MacServices.cs:44
  at MonoDevelop.IPhone.IPhoneSdks..cctor () [0x000f7] in /Users/builder/data/lanes/3816/44d481a9/source/md-

addins/MonoDevelop.IPhone/MonoDevelop.IPhone/IPhoneSdks.cs:90
Loading solution:  Minimal Projects.sln
   Loading projects ..
Cleaning Solution: iPadClient - Minimal Projects (Debug|iPhone)
ERROR [2016-11-16 11:07:02Z]: The MSBuild builder exited before initializing
ERROR [2016-11-16 11:07:08Z]: The MSBuild builder exited before initializing
ERROR [2016-11-16 11:07:13Z]: The MSBuild builder exited before initializing
FATAL ERROR [2016-11-16 11:07:14Z]: System.AggregateException: One or more errors occurred. ---> System.Exception: MSBuild 

process could not be started
  at MonoDevelop.Projects.MSBuild.MSBuildProjectService+<GetProjectBuilder>c__async5+<GetProjectBuilder>c__AnonStorey1A

+<GetProjectBuilder>c__async18.MoveNext () [0x00229] in 

/Users/builder/data/lanes/3816/44d481a9/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildPro

jectService.cs:969
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /private/tmp/source-mono-4.6.0-

c8sr0/bockbuild-mono-4.6.0-branch-c8sr0/profiles/mono-mac-xamarin/build-root/mono-

x86/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00047] in 

/private/tmp/source-mono-4.6.0-c8sr0/bockbuild-mono-4.6.0-branch-c8sr0/profiles/mono-mac-xamarin/build-root/mono-

x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187
Comment 8 Filip Navara 2017-03-18 18:28:03 UTC
We are seeing the same errors on Mono 4.8 (mono-4.8.0-branch/8f6d0f6). They happened on our build machine running TeamCity when executing ResGen.exe as part of build process. We have also witnessed the same crash on one of our development machines in our own code (main thread was shutting down using Environment.Exit call and another thread was in the middle of executing some SQLite code, possibly calling into native library).
Comment 9 Filip Navara 2017-03-19 09:57:28 UTC
Seems to be duplicate of issue #52429, which is already fixed (just not in the 4.8 branch).
Comment 10 Lluis Sanchez 2017-05-18 11:00:15 UTC
Dup.

*** This bug has been marked as a duplicate of bug 52429 ***

Note You need to log in before you can comment on or make changes to this bug.