Bug 9087 - Could not AOT assembly: condition `arm_is_imm12 (ins->inst_offset)' not met
Summary: Could not AOT assembly: condition `arm_is_imm12 (ins->inst_offset)' not met
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 6.0.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Zoltan Varga
URL:
Depends on:
Blocks:
 
Reported: 2012-12-20 09:54 UTC by Dan Abramov
Modified: 2013-01-08 08:30 UTC (History)
3 users (show)

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


Attachments
Library binary (852.50 KB, application/octet-stream)
2012-12-20 09:56 UTC, Dan Abramov
Details


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 Dan Abramov 2012-12-20 09:54:23 UTC
I put up a MonoTouch class library project for Microsoft Reactive Extensions here:

https://github.com/stampsy/rx-monotouch

When I build an app that references it, in Release mode, I get this error:

AOT Compilation exited with code 134, command:
MONO_PATH=/Users/dan/Documents/Projects/<Redacted>/bin/iPhone/Release/<Redacted>.app /Developer/MonoTouch/usr/bin/arm-darwin-mono-sgen --llvm --aot=mtriple=armv7-darwin,ntrampolines=2048,nimt-trampolines=512,full,static,asmonly,direct-icalls,nodebug,llvm-path=/Developer/MonoTouch/LLVM/bin/,outfile=/var/folders/85/sx0_jgqj10q63hc5fn32v2rh0000gp/T/tmp3f97d2fd.tmp/System.Reactive.dll.armv7.s "/Users/dan/Documents/Projects/<Redacted>/bin/iPhone/Release/<Redacted>.app/System.Reactive.dll"
Mono Ahead of Time compiler - compiling assembly /Users/dan/Documents/Projects/<Redacted>/bin/iPhone/Release/<Redacted>.app/System.Reactive.dll
* Assertion at ../../../../../mono/mono/mini/mini-arm.c:4011, condition `arm_is_imm12 (ins->inst_offset)' not met

It builds for Simulator just fine.
Comment 1 Dan Abramov 2012-12-20 09:56:01 UTC
Created attachment 3117 [details]
Library binary
Comment 2 Sebastien Pouliot 2012-12-20 18:16:35 UTC
The simulator uses the JIT (not the AOT).

Did you try it under different conditions ? E.g. does it happens when you do not use LLVM (which is a different AOT compiler backend) ?
Comment 3 Dan Abramov 2012-12-20 18:24:26 UTC
I tried turning off LLVM, choosing Don't Link and adding -nosymbolstrip. None helped.
Comment 4 Zoltan Varga 2012-12-20 22:16:03 UTC
This is an ARM JIT bug.
Comment 5 Zoltan Varga 2013-01-05 01:06:23 UTC
Fixed in master/mobile-master.
Comment 6 Dan Abramov 2013-01-05 01:17:49 UTC
Hi folks, thanks for fixing this one. 

When can we expect this to land in production, at least in Beta?
We're releasing our app in the end of January and ideally we would love to use this fix.
Comment 7 Zoltan Varga 2013-01-05 01:44:55 UTC
As a workaround, you can try removing unused virtual methods from the System.Reactive.Linq/Reactive/Linq/QueryLanguage.<..> files.
Comment 8 Dan Abramov 2013-01-05 02:55:58 UTC
Will give it a try. Thanks.
Comment 9 Dan Abramov 2013-01-08 08:30:01 UTC
If anyone is curious, I fixed the compilation by adding NO_LARGEARITY to compiler constants.
Probably this was killing the compiler:


#if !NO_LARGEARITY
        Func<T1, T2, T3, IObservable<TResult>> FromAsyncPattern<T1, T2, T3, TResult>(Func<T1, T2, T3, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end);
        Func<T1, T2, T3, T4, IObservable<TResult>> FromAsyncPattern<T1, T2, T3, T4, TResult>(Func<T1, T2, T3, T4, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end);
        Func<T1, T2, T3, T4, T5, IObservable<TResult>> FromAsyncPattern<T1, T2, T3, T4, T5, TResult>(Func<T1, T2, T3, T4, T5, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end);
        Func<T1, T2, T3, T4, T5, T6, IObservable<TResult>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, TResult>(Func<T1, T2, T3, T4, T5, T6, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end);
        Func<T1, T2, T3, T4, T5, T6, T7, IObservable<TResult>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, TResult>(Func<T1, T2, T3, T4, T5, T6, T7, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end);
        Func<T1, T2, T3, T4, T5, T6, T7, T8, IObservable<TResult>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, T8, TResult>(Func<T1, T2, T3, T4, T5, T6, T7, T8, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end);
        Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, IObservable<TResult>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end);
        Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, IObservable<TResult>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end);
        Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, IObservable<TResult>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TResult>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end);
        Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, IObservable<TResult>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TResult>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end);
        Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, IObservable<TResult>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TResult>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end);
        Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, IObservable<TResult>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TResult>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end);
#endif