Bug 2809 - Hang while updating Xcode project
Summary: Hang while updating Xcode project
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: iOS add-in ()
Version: Trunk
Hardware: PC Mac OS
: Highest major
Target Milestone: ---
Assignee: Jeffrey Stedfast
Depends on:
Reported: 2012-01-09 14:22 UTC by Jackson Harper
Modified: 2013-10-30 14:40 UTC (History)
2 users (show)

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

A possible solution (6.25 KB, patch)
2012-01-16 14:07 UTC, Jeffrey Stedfast
new and improved patch (12.09 KB, patch)
2012-01-30 19:24 UTC, Jeffrey Stedfast

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 Developer Community or GitHub 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 Jackson Harper 2012-01-09 14:22:49 UTC
While updating the Xcode project MD hung for over two minutes (I watched a 2:13 video while waiting for it).  After that time I started killing MD processes to stop it and got the following error and stack trace.

Error updating Xcode project. Error ScriptError: Xcode got an error: AppleEvent timed out.

System.Exception: Error ScriptError: Xcode got an error: AppleEvent timed out.
  at MonoDevelop.MacInterop.AppleScript.Run (Boolean compile, MonoDevelop.MacInterop.AEDesc& scriptData) [0x00012] in /private/tmp/source/monodevelop/main/src/addins/MacPlatform/MacInterop/AppleScript.cs:107 
  at MonoDevelop.MacInterop.AppleScript.Run (System.String scriptSource) [0x00010] in /private/tmp/source/monodevelop/main/src/addins/MacPlatform/MacInterop/AppleScript.cs:83 
  at MonoDevelop.MacInterop.AppleScript.Run (System.String scriptSourceFormat, System.Object[] args) [0x00000] in /private/tmp/source/monodevelop/main/src/addins/MacPlatform/MacInterop/AppleScript.cs:74 
  at MonoDevelop.MacDev.XcodeSyncing.XcodeMonitor.CloseFile (System.String fileName) [0x0000d] in /private/tmp/source/monodevelop/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeMonitor.cs:352 
  at MonoDevelop.MacDev.XcodeSyncing.XcodeMonitor.UpdateProject (IProgressMonitor monitor, System.Collections.Generic.List`1 allItems, MonoDevelop.MacDev.XcodeIntegration.XcodeProject emptyProject) [0x001c6] in /private/tmp/source/monodevelop/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeMonitor.cs:114 
  at MonoDevelop.MacDev.XcodeSyncing.XcodeProjectTracker.UpdateXcodeProject (IProgressMonitor monitor) [0x00000] in /private/tmp/source/monodevelop/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeProjectTracker.cs:318
Comment 1 Jeffrey Stedfast 2012-01-16 14:07:30 UTC
Created attachment 1204 [details]
A possible solution

Michael and I looked into this a bit on Friday and we discovered that while the AppleScript APIs don't have a way to provide a timeout value, the script language itself does.

So... one possible solution is to figure out a good timeout to use and rework the scripts to use timeouts and make the script functions that don't have a return value we care about be completely async.

That's what the attached patch attempts to do.

Might need more thought wrt the chosen timeout values, though.
Comment 2 Jeffrey Stedfast 2012-01-30 19:24:49 UTC
Created attachment 1292 [details]
new and improved patch

This updated patch is a bit cleaner (i.e. doesn't grep an error string for "time out") and does better error handling instead of just dropping all timeout exceptions.
Comment 3 Jeffrey Stedfast 2012-01-31 12:23:33 UTC
Committed a slightly modified version of above patch. Hopefully this improves things, though we may want to tweak the timeout values a bit
Comment 4 Jackson Harper 2012-10-30 12:00:04 UTC
Since upgrading MonoTouch/MonoDevelop this has started happening again if XCode is open. It also seems to be crashing sometimes when it times out.

Here is my current version info:

Installation UUID: 5042d5ea-af80-4cb8-98cf-fb258ece7fd9
	Mono 2.10.9 (tarball)
	GTK 2.24.10
	GTK# (
	Package version: 210090011
Apple Developer Tools:
	 Xcode 4.5 (1839)
	 Build 4G182
Monotouch: 6.0.4
Comment 5 Jeffrey Stedfast 2013-06-07 13:03:04 UTC
Not sure if this is resolved or not, but there have been more fixes in this area of code.
Comment 6 Jeffrey Stedfast 2013-10-30 14:40:52 UTC
pretty sure this is fixed