Bug 1127 - AppleScript needs to be run in a background thread
Summary: AppleScript needs to be run in a background thread
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: iOS add-in ()
Version: Trunk
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Alan McGovern
URL:
: 1122 ()
Depends on:
Blocks:
 
Reported: 2011-09-29 05:34 UTC by Alan McGovern
Modified: 2013-11-06 18:02 UTC (History)
3 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 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:
Status:
RESOLVED FIXED

Description Alan McGovern 2011-09-29 05:34:41 UTC
If we're executing applescript while Xcode has a blocking dialog up (for example the screen in bug #1121) we end up blocking the main loop in MonoDevelop and it becomes unresponsive:


"GUI Thread" tid=0x0xaccb12c0 this=0x0x4d3f18 thread handle 0x803 state : not waiting owns ()
  at (wrapper managed-to-native) MonoDevelop.MacInterop.AppleScript.OSAExecute (MonoDevelop.MacInterop.ComponentInstance,MonoDevelop.MacInterop.OsaId,MonoDevelop.MacInterop.OsaId,MonoDevelop.MacInterop.OsaMode,MonoDevelop.MacInterop.OsaId&) <IL 0x0002a, 0xffffffff>
  at MonoDevelop.MacInterop.AppleScript.Run (bool,MonoDevelop.MacInterop.AEDesc&,string&) [0x000a3] in /Users/alanmcgovern/Projects/monodevelop/main/src/addins/MacPlatform/MacInterop/AppleScript.cs:131
  at MonoDevelop.MacInterop.AppleScript.Run (bool,MonoDevelop.MacInterop.AEDesc&) [0x00000] in /Users/alanmcgovern/Projects/monodevelop/main/src/addins/MacPlatform/MacInterop/AppleScript.cs:103
  at MonoDevelop.MacInterop.AppleScript.Run (string) [0x00010] in /Users/alanmcgovern/Projects/monodevelop/main/src/addins/MacPlatform/MacInterop/AppleScript.cs:83
  at MonoDevelop.MacInterop.AppleScript.Run (string,object[]) [0x00000] in /Users/alanmcgovern/Projects/monodevelop/main/src/addins/MacPlatform/MacInterop/AppleScript.cs:74
  at MonoDevelop.MacDev.XcodeSyncing.XcodeMonitor.OpenFile (string) [0x0001a] in /Users/alanmcgovern/Projects/monodevelop/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeMonitor.cs:288
  at MonoDevelop.MacDev.XcodeSyncing.XcodeProjectTracker.OpenFileInXcodeProject (string) [0x00056] in /Users/alanmcgovern/Projects/monodevelop/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeProjectTracker.cs:166
  at MonoDevelop.MacDev.XcodeSyncing.XcodeProjectTracker.OpenDocument (string) [0x0002b] in /Users/alanmcgovern/Projects/monodevelop/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeProjectTracker.cs:185
  at MonoDevelop.MacDev.XcodeInterfaceBuilderDesktopApplication.Launch (string[]) [0x00000] in /Users/alanmcgovern/Projects/monodevelop/main/src/addins/MonoDevelop.MacDev/XcodeInterfaceBuilderDisplayBinding.cs:72
  at MonoDevelop.Ide.Gui.Workbench.RealOpenFile (MonoDevelop.Ide.Gui.FileOpenInformation) [0x003af] in /Users/alanmcgovern/Projects/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:752
  at MonoDevelop.Ide.Gui.Workbench.OpenDocument (MonoDevelop.Core.FilePath,int,int,MonoDevelop.Ide.Gui.OpenDocumentOptions,string,MonoDevelop.Ide.Gui.IViewDisplayBinding) [0x001cf] in /Users/alanmcgovern/Projects/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:382
  at MonoDevelop.Ide.Gui.Workbench.OpenDocument (MonoDevelop.Core.FilePath,MonoDevelop.Ide.Gui.OpenDocumentOptions) [0x00000] in /Users/alanmcgovern/Projects/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:312
  at MonoDevelop.Ide.Gui.Pads.ProjectPad.ProjectFileNodeCommandHandler.ActivateItem () [0x00011] in /Users/alanmcgovern/Projects/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs:182
  at MonoDevelop.Ide.Gui.Components.NodeCommandHandler.ActivateMultipleItems () [0x0000e] in /Users/alanmcgovern/Projects/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/NodeCommandHandler.cs:100
  at MonoDevelop.Ide.Gui.Components.ExtensibleTreeView.ActivateCurrentItem () [0x00052] in /Users/alanmcgovern/Projects/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs:834
  at MonoDevelop.Ide.Gui.Components.ExtensibleTreeView.OnNodeActivated (object,Gtk.RowActivatedArgs) [0x00000] in /Users/alanmcgovern/Projects/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs:1935
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object_object (object,intptr,intptr,intptr) <IL 0x0005a, 0xffffffff>
  at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) <IL 0x00030, 0xffffffff>
  at System.Reflection.MonoMethod.Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) <IL 0x000db, 0x0019b>
  at System.Reflection.MethodBase.Invoke (object,object[]) <IL 0x00006, 0x0002c>
  at System.Delegate.DynamicInvokeImpl (object[]) <IL 0x000c0, 0x0025f>
  at System.MulticastDelegate.DynamicInvokeImpl (object[]) <IL 0x0001a, 0x00047>
  at System.Delegate.DynamicInvoke (object[]) <IL 0x00002, 0x00020>
  at GLib.Signal.ClosureInvokedCB (object,GLib.ClosureInvokedArgs) <IL 0x0004f, 0x001b3>
  at GLib.SignalClosure.Invoke (GLib.ClosureInvokedArgs) <IL 0x00014, 0x00039>
  at GLib.SignalClosure.MarshalCallback (intptr,intptr,uint,intptr,intptr,intptr) <IL 0x00147, 0x00597>
  at (wrapper native-to-managed) GLib.SignalClosure.MarshalCallback (intptr,intptr,uint,intptr,intptr,intptr) <IL 0x00024, 0xffffffff>
  at (wrapper managed-to-native) Gtk.Application.gtk_main () <IL 0x00022, 0xffffffff>
  at Gtk.Application.Run () <IL 0x00000, 0x0000b>
  at MonoDevelop.Ide.IdeApp.Run () [0x00000] in /Users/alanmcgovern/Projects/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs:384
  at MonoDevelop.Ide.IdeStartup.Run (string[]) [0x00762] in /Users/alanmcgovern/Projects/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:270
  at MonoDevelop.Ide.IdeStartup.Main (string[]) [0x00017] in /Users/alanmcgovern/Projects/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:531
  at MonoDevelop.Startup.MonoDevelopMain.Main (string[]) [0x00000] in /Users/alanmcgovern/Projects/monodevelop/main/src/core/MonoDevelop.Startup/MonoDevelop.Startup/MonoDevelopMain.cs:16
  at (wrapper runtime-invoke) <Module>.runtime_invoke_int_object (object,intptr,intptr,intptr) <IL 0x0005c, 0xffffffff>
Comment 1 Alan McGovern 2011-09-29 05:37:42 UTC
Actually the applescript will time out eventually and unblock the UI. It'd be nice if it didn't deadlock MD though in the meantime, but it's not a critical issue.
Comment 2 Mikayla Hutchinson [MSFT] 2011-09-29 06:23:06 UTC
Not sure about this. If MD is blocking on Xcode, we should probably show a modal dialog to prevent the user messing with things during the sync.
Comment 3 Alan McGovern 2011-09-29 07:48:50 UTC
*** Bug 1122 has been marked as a duplicate of this bug. ***
Comment 4 Jeffrey Stedfast 2013-11-06 18:02:11 UTC
not really an issue anymore...