Bug 5354 - Attempting to jit compile Action.BeginInvoke
Summary: Attempting to jit compile Action.BeginInvoke
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: 5.2
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Sebastien Pouliot
URL:
Depends on:
Blocks:
 
Reported: 2012-05-26 14:19 UTC by marton2
Modified: 2013-05-31 11:13 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 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 marton2 2012-05-26 14:19:07 UTC
Using Action.BeginInvoke with "Link SDK assemblies only" enabled crashes on the iPhone hardware, but works in the simulator. A simple test-case could be:

public override void ViewDidAppear (bool animated)
{
	base.ViewDidAppear (animated);
			
	Action<string> testAction=(string s)=>{
		s.ToString ();
	};
			
	testAction.BeginInvoke("Teszt", null, null);
}

And the error message is:
System.ExecutionEngineException: Attempting to JIT compile method '(wrapper delegate-begin-invoke) <Module>:begin_invoke_IAsyncResult__this___string_AsyncCallback_object (string,System.AsyncCallback,object)' while running with --aot-only.

This works if linking is set to "Don't link"
Comment 1 Sebastien Pouliot 2012-05-26 21:50:09 UTC
also occurs on 5.2.12
Comment 2 marton2 2012-05-27 04:44:57 UTC
I found another interesting thing:
I can workaround this problem, if the BeginInvoke part is in the executable project, with disabling linking, but no matter what I do, it always crashes if the code is in an external library.
Comment 3 Sebastien Pouliot 2013-05-31 11:13:20 UTC
This is fixed in 6.3.x.

The 6.3.x beta releases have much improved to avoid this situation (the EngineExecutionException). You might want to try this, or similar code, again and report any remaining issues (with a test case).