Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
Created attachment 931 [details]
OrderedEnumerable crash test case
Test project is attached.
Basically when running a release version of code on Hardware only, the test case produces a crash with the Exception:
Attempting to JIT compile 'System.Linq.OrderedEnumerable`1<MyObjectType>:GetEnumerator()' while running with --aot-only.
Debug builds work in both simulator and hardware, and release mode works fine in the simulator. Using mono 2.106, and MonoTouch 5.0.2.
Confirmed. It fails on Release but works on the Debug configuration.
Setting "Enable debugging" checkbox on the "iPhone Build" (Project Options) will make "Release" work, so this is not related to the DEBUG define (or when smcs compiles). IOW mtouch gets -debug and propagate it down to the other tools... I'll find which one(s) matter in this case.
I hope it's only because I'm sleepy... anyway the exception does not occur if both "--debug" and "soft-debug" are used when calling the AOT compiler. If only --debug is used the same exception occurs (and "soft-debug" and only be used with --debug).
Created attachment 945 [details]
diff between release and debug
I looked at the .s generated by the AOT compiler in release and debug mode, extracted the .no_dead_strip entries, sorted and diff'ed the results (attached)
The debug builds include quite a few more entries (than the release one) including a few GetEnumerator, including:
+ .no_dead_strip System_Linq_OrderedEnumerable_1_LinqOrderedEnumerableBugTestCase_DocType_GetEnumerator
which looks like the AOT exception being shown by the test case.
// opt->mdb_optimizations = TRUE;
makes the DEBUG fails like the Release version
tracked down to:
cfg->opt &= ~MONO_OPT_INLINE;
i.e. disabling inlining is what allows the extra methods to be available and makes the DEBUG version works as expected.
Thanks for looking at that Sebastian. Is there a configuration workaround in Monodevelop/Monotouch that I can use until a fix is out?
Fixed in HEAD and on 2-10 (83e5c48472262d47fa73c3c65364b87ec328d425).
3e62b6e207e7355a07f1d166b17590726cde9 is needed as well from 2.10.
Fixes pulled in MonoTouch (master).
Confirmed as fixed.