Bug 15419 - Xbuild hangs
Summary: Xbuild hangs
Alias: None
Product: Runtime
Classification: Mono
Component: General ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2013-10-15 17:33 UTC by Duncan Mak
Modified: 2014-01-10 19:12 UTC (History)
7 users (show)

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:

Description Duncan Mak 2013-10-15 17:33:36 UTC
Here's a stack trace: https://gist.github.com/duncanmak/e339125e83727113feab
Comment 1 Mikayla Hutchinson [MSFT] 2013-10-15 17:41:15 UTC
That looks perfectly normal to me. This is not xbuild, it's Xamarin Studio's MSBuild/xbuild hosting helper process, and it's waiting for commands from its parent.

Need a backtrace of the parent process.
Comment 2 Rodrigo Kumpera 2013-10-15 17:49:14 UTC
The parent mdtool is a zombie.

The problem here, as I see it, is that either mdtool is not waiting enough for its children to exit or those child processes are not detecting the defunct parent.

The situation is the following, we have 3 processes in a hierarchy:

(1)shell -> (2) mdtool -> (3)XS xbuild *thing*

Process (2) exits and turn into a zombie
Process (3) is hang as per the above dump

The zombification happens because (2) has a child (3) that is still running.

Given the above background, I see a few options here:

It's a bug in (2)
It a bug in (3)
It's a runtime bug that causes (2) to misbehave
It's a runtime bug that causes (3) to misbehave
Comment 3 Mikayla Hutchinson [MSFT] 2013-10-15 17:54:53 UTC
I'm pretty sure it's a runtime regression. It used to be that the parent could exit (e.g. crash) and the child would be left running, so child specifically polls the parent PID so it can exit when the parent exits. The parent does not wait for the child.
Comment 4 Rodrigo Kumpera 2013-10-15 18:29:24 UTC
Perfect, can you point me to the code that performs this polling so I can try to extract a test-case?

Duncan, what mono version are you trying this with?
Comment 5 Duncan Mak 2013-10-15 18:36:11 UTC
duncan@duncans-imac:CocosSharp ((23c3862...))$ mono --version
Mono JIT compiler version 3.2.3 ((no/8d3b4b7 Mon Sep 16 23:46:28 EDT 2013)
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:          yes(3.3svn-mono)
	GC:            sgen
Comment 7 Miguel de Icaza [MSFT] 2014-01-09 16:10:14 UTC
Michael provided a test case.
Comment 8 Rodrigo Kumpera 2014-01-10 15:46:52 UTC
That piece of code is a thousand miles away from been a test case. Anyhow, will take a look.
Comment 9 Rodrigo Kumpera 2014-01-10 15:47:01 UTC
That piece of code is a thousand miles away from been a test case. Anyhow, will take a look.
Comment 10 Rodrigo Kumpera 2014-01-10 17:35:09 UTC
This is a build script bug.
Comment 11 Miguel de Icaza [MSFT] 2014-01-10 18:05:22 UTC
Rodrigo, can you tell us how to fix it, or what the bug was?