This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 9087 - Could not AOT assembly: condition `arm_is_imm12 (ins->inst_offset)' not met
: Could not AOT assembly: condition `arm_is_imm12 (ins->inst_offset)' not met
Status: RESOLVED FIXED
Product: iOS
Classification: Xamarin
Component: General
: 6.0.x
: Macintosh Mac OS
: --- normal
: Untriaged
Assigned To: Zoltan Varga
:
:
:
:
  Show dependency treegraph
 
Reported: 2012-12-20 09:54 EST by Dan Abramov
Modified: 2013-01-08 08:30 EST (History)
3 users (show)

See Also:
Tags:
Test Case URL:
External Submit: ---


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

Description Dan Abramov 2012-12-20 09:54:23 EST
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 EST
Created attachment 3117 [details]
Library binary
Comment 2 Sebastien Pouliot 2012-12-20 18:16:35 EST
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 EST
I tried turning off LLVM, choosing Don't Link and adding -nosymbolstrip. None
helped.
Comment 4 Zoltan Varga 2012-12-20 22:16:03 EST
This is an ARM JIT bug.
Comment 5 Zoltan Varga 2013-01-05 01:06:23 EST
Fixed in master/mobile-master.
Comment 6 Dan Abramov 2013-01-05 01:17:49 EST
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 EST
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 EST
Will give it a try. Thanks.
Comment 9 Dan Abramov 2013-01-08 08:30:01 EST
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

Note You need to log in before you can comment on or make changes to this bug.