Bug 776 - xbuild and mcs sometimes freeze when invoked
Summary: xbuild and mcs sometimes freeze when invoked
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: Runtime
Classification: Mono
Component: JIT ()
Version: unspecified
Hardware: PC Windows
: --- minor
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2011-09-13 08:25 UTC by Henrik Heimbuerger
Modified: 2014-01-13 07:00 UTC (History)
2 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 NOT_REPRODUCIBLE

Description Henrik Heimbuerger 2011-09-13 08:25:57 UTC
(Originally reported on http://stackoverflow.com/questions/7401199/why-do-monos-xbuild-and-mcs-sometimes-simply-freeze-when-invoked)

I have experienced this both with Mono 2.10.2 and 2.10.5 on Windows 7 x64.

Occasionally, when invoking mcs or xbuild with any parameters (or none) they will simply freeze for a few minutes. This is before the first output occurs on stdout. In Process Explorer, I see the mono.exe running with basically no activity: constant memory usage, no CPU cycles most of the time. I see two threads:

The first one with the start address mono-2.0.dll!GC_push_all_stack+0x6650 hangs in state Wait:UserRequest with the following stack trace:

ntoskrnl.exe!memset+0x64a
ntoskrnl.exe!KeWaitForMultipleObjects+0xd52
ntoskrnl.exe!KeWaitForMutexObject+0x19f
ntoskrnl.exe!__misaligned_access+0xba4
ntoskrnl.exe!__misaligned_access+0x1821
ntoskrnl.exe!KeWaitForMultipleObjects+0xf5d
ntoskrnl.exe!KeWaitForMutexObject+0x19f
ntoskrnl.exe!NtWaitForSingleObject+0xde
ntoskrnl.exe!KeSynchronizeExecution+0x3a43
wow64cpu.dll!TurboDispatchJumpAddressEnd+0x6c0
wow64cpu.dll!TurboDispatchJumpAddressEnd+0x4a8
wow64.dll!Wow64SystemServiceEx+0x1ce
wow64.dll!Wow64LdrpInitialize+0x429
ntdll.dll!RtlIsDosDeviceName_U+0x24c87
ntdll.dll!LdrInitializeThunk+0xe
ntdll.dll!ZwWaitForSingleObject+0x15
kernel32.dll!WaitForSingleObjectEx+0x43
mono-2.0.dll!mono_sem_timedwait+0x32
mono-2.0.dll!mono_sem_wait+0x21
mono-2.0.dll!mono_gc_cleanup+0x1b0
mono-2.0.dll!mono_thread_set_execution_context+0x14a
mono-2.0.dll!GC_push_all_stack+0x6678
kernel32.dll!BaseThreadInitThunk+0x12
ntdll.dll!RtlInitializeExceptionChain+0x63
ntdll.dll!RtlInitializeExceptionChain+0x36

The other one with start address mono.exe+0x1290 hangs in state Wait:WrLpcReply:

ntoskrnl.exe!memset+0x64a
ntoskrnl.exe!KeWaitForMultipleObjects+0xd52
ntoskrnl.exe!KeWaitForMutexObject+0x19f
ntoskrnl.exe!ExAcquireSharedStarveExclusive+0x30f
ntoskrnl.exe!NtQuerySystemInformation+0x5a7a
ntoskrnl.exe!NtQuerySystemInformation+0x5174
ntoskrnl.exe!NtQuerySystemInformation+0x2f6f
ntoskrnl.exe!KeSynchronizeExecution+0x3a43
ntoskrnl.exe!ZwUnlockFile+0x130
msrpc.sys!Ndr64AsyncClientCall+0x166fb
msrpc.sys!Ndr64AsyncClientCall+0x18638
ntdll.dll!ZwCreateFile+0xa
wow64.dll!Wow64EmulateAtlThunk+0xe697
wow64.dll!Wow64SystemServiceEx+0xd7
wow64cpu.dll!TurboDispatchJumpAddressEnd+0x2d
wow64.dll!Wow64SystemServiceEx+0x1ce
wow64.dll!Wow64LdrpInitialize+0x429
ntdll.dll!RtlUniform+0x6e6
ntdll.dll!RtlCreateTagHeap+0xa7
ntdll.dll!LdrInitializeThunk+0xe
ntdll.dll!NtCreateFile+0x12
kernel32.dll!CreateFileW+0x4a
kernel32.dll!CreateFileA+0x36
mono-2.0.dll!mono_error_raise_exception+0x6f5b
mono-2.0.dll!mono_error_raise_exception+0x472b
mono-2.0.dll!mono_error_raise_exception+0x45fc
mono-2.0.dll!mono_error_raise_exception+0x5fb4
mono-2.0.dll!mono_config_for_assembly+0x16b
mono-2.0.dll!mono_assembly_open_full+0x3d6
mono-2.0.dll!mono_make_shadow_copy+0x7d5
mono-2.0.dll!mono_make_shadow_copy+0x8b9
mono-2.0.dll!mono_make_shadow_copy+0xa29
mono-2.0.dll!mono_install_assembly_postload_refonly_search_hook+0x46
mono-2.0.dll!mono_assembly_load_full_nosearch+0x11b
mono-2.0.dll!mono_make_shadow_copy+0xd5a
mono-2.0.dll!mono_thread_internal_current+0x13
mono-2.0.dll!mono_thread_interruption_requested+0x4e
mono-2.0.dll!mono_runtime_class_init_full+0x14b
mono-2.0.dll!mono_error_raise_exception+0x1bc3
mono-2.0.dll!mono_error_raise_exception+0xe5c
mono-2.0.dll!mono_jit_compile_method+0x10c
mono-2.0.dll!mono_runtime_invoke+0x42
mono-2.0.dll!mono_runtime_class_init_full+0x1df
mono-2.0.dll!mono_codegen+0x303f
mono-2.0.dll!mono_jit_compile_method+0x22
mono-2.0.dll!mono_create_static_rgctx_trampoline+0x637
mono-2.0.dll!mono_magic_trampoline+0x36
mono-2.0.dll!mono_error_raise_exception+0xf28
mono-2.0.dll!mono_runtime_class_init+0x1a
mono-2.0.dll!mono_jit_compile_method+0x10c
mono-2.0.dll!mono_runtime_invoke+0x42
mono-2.0.dll!mono_runtime_exec_main+0x1dc
mono-2.0.dll!mono_main+0x1662
mono.exe+0x1474
mono.exe+0x10bb
mono.exe+0x12a8
kernel32.dll!BaseThreadInitThunk+0x12
ntdll.dll!RtlInitializeExceptionChain+0x63
ntdll.dll!RtlInitializeExceptionChain+0x36

Every once in a while they will have a little activity and after a few minutes, they will proceed with their task as if nothing had happened. Repeating the same command will result in the same amount of freezing, however.

As soon as I reboot my machine, they react immediately again for a while.
Comment 1 Henrik Heimbuerger 2011-11-10 10:32:19 UTC
I don't seem to be able to edit the version attribute, but as noted, this has occured in 2.10.2 and 2.10.5. I still have the issue in 2.10.6.

This is still occuring about once to twice a day and always requires a reboot to fix. Any troubleshooting advice? There has got to be some reason why only I am experiencing this, apparently.
Comment 2 Henrik Heimbuerger 2012-01-13 05:00:29 UTC
This still occurs in 2.10.8. I'd even say it's becoming more frequent. (I upgraded to 2.10.8 yesterday and had to reboot three times because mcs was freezing yesterday alone.)
Comment 3 Rodrigo Kumpera 2014-01-12 01:18:20 UTC
Does it happen with the latest mono 3.2.X?
Comment 4 Henrik Heimbuerger 2014-01-13 07:00:34 UTC
Sorry, that was two years ago. I'm no longer working on this project---I'm not even with the same company anymore and don't have access to the source code or the same machine configuration anymore.

A bit late to debug this, I'll close as WORKSFORME. :)