Bug 37635 - Attempting to JIT compile method '(wrapper runtime-invoke)' while running with --aot-only
Summary: Attempting to JIT compile method '(wrapper runtime-invoke)' while running wit...
Status: VERIFIED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Mono runtime / AOT compiler ()
Version: XI 9.4 (iOS 9.2)
Hardware: PC Mac OS
: Normal normal
Target Milestone: (C7)
Assignee: Zoltan Varga
URL:
Depends on:
Blocks:
 
Reported: 2016-01-12 22:41 UTC by Frank A. Krueger
Modified: 2016-06-02 16:28 UTC (History)
5 users (show)

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


Attachments
Repro project (2.21 MB, application/zip)
2016-01-12 22:41 UTC, Frank A. Krueger
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:
VERIFIED FIXED

Description Frank A. Krueger 2016-01-12 22:41:42 UTC
Created attachment 14562 [details]
Repro project

When I try to run the attached project, I get an AOT exception.

Here's the source to the type: https://github.com/dotnet/roslyn/blob/master/src/Compilers/Core/Portable/Syntax/LineDirectiveMap.LineMappingEntry.cs

It's a struct with IComparable.

Repro:

Run the attached project on a device. Note the crash.

Works fine on the sim.


END COMPILING False 0

System.InvalidOperationException: Comparer threw an exception. ---> System.ExecutionEngineException: Attempting to JIT compile method '(wrapper runtime-invoke) <Module>:runtime_invoke_int__this___LineDirectiveMap`1/LineMappingEntry<DirectiveTriviaSyntax> (intptr&,intptr,intptr,intptr)' while running with --aot-only. See http://docs.xamarin.com/ios/about/limitations for more information.
at (wrapper managed-to-native) System.Object:__icall_wrapper_mono_gsharedvt_constrained_call (intptr,intptr,intptr,intptr,intptr)
at System.Collections.Generic.GenericComparer`1[T].Compare (System.Collections.Generic.T x, System.Collections.Generic.T y) [0x00016] in /Users/builder/data/lanes/2377/73229919/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/collections/generic/comparer.cs:104
at (wrapper unknown) System.Object:gsharedvt_in ()
at (wrapper unknown) System.Object:gsharedvt_out ()
at System.Array.BinarySearch[T] (System.T[] array, Int32 index, Int32 length, System.T value, IComparer`1 comparer) [0x00089] in /Users/builder/data/lanes/2377/73229919/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System/Array.cs:3006
--- End of inner exception stack trace ---
at System.Array.BinarySearch[T] (System.T[] array, Int32 index, Int32 length, System.T value, IComparer`1 comparer) [0x000c9] in /Users/builder/data/lanes/2377/73229919/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System/Array.cs:3017
at (wrapper unknown) System.Object:gsharedvt_in ()
at (wrapper unknown) System.Object:gsharedvt_out ()
at System.Array.BinarySearch[T] (System.T[] array, System.T value) [0x00011] in /Users/builder/data/lanes/2377/73229919/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System/Array.cs:2963
at (wrapper unknown) System.Object:gsharedvt_in ()
at Microsoft.CodeAnalysis.LineDirectiveMap`1[TDirective].FindEntryIndex (Int32 lineNumber) [0x0000d] in <filename unknown>:0
at Microsoft.CodeAnalysis.LineDirectiveMap`1[TDirective].FindEntry (Int32 lineNumber) [0x00001] in <filename unknown>:0
at Microsoft.CodeAnalysis.LineDirectiveMap`1[TDirective].TranslateSpan (Microsoft.CodeAnalysis.Text.SourceText sourceText, System.String treeFilePath, TextSpan span) [0x0002f] in <filename unknown>:0
at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxTree.GetMappedLineSpan (TextSpan span, CancellationToken cancellationToken) [0x00036] in <filename unknown>:0
at Microsoft.CodeAnalysis.SourceLocation.GetMappedLineSpan () [0x0002b] in <filename unknown>:0
at Microsoft.CodeAnalysis.DiagnosticFormatter.Format (Microsoft.CodeAnalysis.Diagnostic diagnostic, IFormatProvider formatter) [0x00057] in <filename unknown>:0
at Microsoft.CodeAnalysis.Diagnostic.System.IFormattable.ToString (System.String ignored, IFormatProvider formatProvider) [0x00001] in <filename unknown>:0
at System.Text.StringBuilder.AppendFormat (IFormatProvider provider, System.String format, System.Object[] args) [0x00373] in /Users/builder/data/lanes/2377/73229919/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/text/stringbuilder.cs:1463
at System.String.Format (IFormatProvider provider, System.String format, System.Object[] args) [0x00039] in /Users/builder/data/lanes/2377/73229919/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/string.cs:3072
at System.IO.TextWriter.WriteLine (System.String format, System.Object arg0) [0x00000] in /Users/builder/data/lanes/2377/73229919/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/io/textwriter.cs:526
at System.IO.TextWriter+SyncTextWriter.WriteLine (System.String format, System.Object arg0) [0x00000] in /Users/builder/data/lanes/2377/73229919/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/io/textwriter.cs:864
at (wrapper synchronized) System.IO.TextWriter+SyncTextWriter:WriteLine (string,object)
at System.Console.WriteLine (System.String format, System.Object arg0) [0x00000] in /Users/builder/data/lanes/2377/73229919/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System/Console.cs:466
at JitBug.AppDelegate.<FinishedLaunching>m__0 () [0x000d9] in /Users/fak/Dropbox/Projects/JitBug/JitBug/AppDelegate.cs:42
Comment 1 Frank A. Krueger 2016-01-12 23:28:39 UTC
Reprioritizing because I was able to work around the problem: https://github.com/praeclarum/roslyn/commit/60bfbf6e780fa587efbb6664a44447fbaa037705
Comment 2 Zoltan Varga 2016-01-18 15:02:00 UTC
I can reproduce this with cycle6 builds, but not with cycle7 ones.
Comment 3 Sebastien Pouliot 2016-03-10 15:27:38 UTC
Works for me too, closing so QA can verify this against C7 before it goes stable.