Bug 17435 - armv7s code crashes in mono_class_from_mono_type: "implement me 0x8a"
Summary: armv7s code crashes in mono_class_from_mono_type: "implement me 0x8a"
Status: VERIFIED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: 1.0
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: 7.2.1
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-01-26 08:24 UTC by Christian Rishøj
Modified: 2014-03-20 11:27 UTC (History)
6 users (show)

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


Attachments
Test Project (9.79 KB, application/zip)
2014-03-20 11:21 UTC, Shruti
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 Christian Rishøj 2014-01-26 08:24:53 UTC
Description of Problem:

When generating armv7s code for an app, it crashes on the device in mono_class_from_mono_type with the message "implement me 0x8a".

If I instead generate armv7 code only, the crash does not occur.

Reproducible with the project at hand. 

Jan 26 14:20:29 Christians-iPhone-5 kernel[0] <Debug>: launchd[1300] Container: /private/var/mobile/Applications/71154A8E-BEF0-466C-ABEC-0E8443C8CA74 (sandbox)
Jan 26 14:20:29 Christians-iPhone-5 networkd[80] <Warning>: Analytics Engine: double ON for app: thai-language
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Warning>: mono_class_from_mono_type: implement me 0x8a
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Critical>: * Assertion: should not be reached at ../../../../../mono/mono/metadata/class.c:6305
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: Stacktrace:
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>:   at <unknown> <0xffffffff>
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>:   at alib.Array.arr.BinarySearch<tldb.Definition, uint> (System.Collections.Generic.IReadOnlyList`1<tldb.Definition>,uint,int,System.Converter`2<tldb.Definition, uint>) <0x00066>
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>:   at tldb.DopBase._Read (tldb.InnerDb,System.IO.BinaryReader,tldb.Definition[],int) <0x000da>
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>:   at tldb.Dop.StreamInDI (tldb.InnerDb,System.IO.BinaryReader,uint16,tldb.Definition[],int) <0x000ee>
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>:   at tldb.Definition..ctor (tldb.InnerDb,System.IO.BinaryReader,uint16,tldb.Definition[],int) <0x00032>
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>:   at tldb.InnerDb.ReadDb (string) <0x0048f>
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>:   at tldb.InnerDb..ctor (string,tldb.InnerDb/LoadOpts) <0x00397>
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>:   at tltouch.DBHelper..cctor () <0x00032>
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>:   at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) <0xffffffff>
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>:   at <unknown> <0xffffffff>
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>:   at tltouch.AppDelegate.FinishedLaunching (MonoTouch.UIKit.UIApplication) <0x00006>
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>:   at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) <0xffffffff>
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>:   at <unknown> <0xffffffff>
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>:   at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <0xffffffff>
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>:   at MonoTouch.UIKit.UIApplication.Main (string[],string,string) <0x00094>
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>:   at tltouch.Application.Main (string[]) <0x00014>
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>:   at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) <0xffffffff>
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 
	Native stacktrace:
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	0   tltouch                             0x0040a89b TFLog + 4021022
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	1   tltouch                             0x0040fc0f TFLog + 4042386
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	2   libsystem_platform.dylib            0x3aebc723 _sigtramp + 42
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	3   libsystem_pthread.dylib             0x3aec1a53 pthread_kill + 58
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	4   libsystem_c.dylib                   0x3ae0b02d abort + 76
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	5   tltouch                             0x00497763 TFLog + 4598246
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	6   tltouch                             0x00424603 TFLog + 4126854
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	7   tltouch                             0x00423821 TFLog + 4123300
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	8   tltouch                             0x00423751 TFLog + 4123092
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	9   tltouch                             0x004121a7 TFLog + 4052010
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	10  tltouch                             0x004104bb TFLog + 4044606
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	11  tltouch                             0x00410fa1 TFLog + 4047396
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	12  tltouch                             0x001fff20 TFLog + 1880483
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	13  tltouch                             0x0004be09 TFLog + 94348
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	14  tltouch                             0x0004a6a5 TFLog + 88360
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	15  tltouch                             0x000495a1 TFLog + 84004
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	16  tltouch                             0x0007d468 TFLog + 296683
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	17  tltouch                             0x0007c868 TFLog + 293611
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	18  tltouch                             0x00042015 TFLog + 53912
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	19  tltouch                             0x001e35b4 TFLog + 1763383
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	20  tltouch                             0x0041777f TFLog + 4073986
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	21  tltouch                             0x0045f58d TFLog + 4368400
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	22  tltouch                             0x0045f885 TFLog + 4369160
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	23  tltouch                             0x0045f677 TFLog + 4368634
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	24  tltouch                             0x00410b39 TFLog + 4046268
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	25  tltouch                             0x001ff814 TFLog + 1878679
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	26  tltouch                             0x001e35b4 TFLog + 1763383
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	27  tltouch                             0x0041777f TFLog + 4073986
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	28  tltouch                             0x0045f58d TFLog + 4368400
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	29  tltouch                             0x003db107 TFLog + 3826570
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	30  UIKit                               0x32d42b0f <redacted> + 374
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	31  UIKit                               0x32d4253d <redacted> + 1464
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	32  UIKit                               0x32d3cb41 <redacted> + 720
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	33  UIKit                               0x32cd7a07 <redacted> + 3142
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	34  UIKit                               0x32cd6cfd <redacted> + 72
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	35  UIKit                               0x32d3c321 <redacted> + 664
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	36  GraphicsServices                    0x351bc76d <redacted> + 608
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	37  GraphicsServices                    0x351bc357 <redacted> + 34
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	38  CoreFoundation                      0x30518777 <redacted> + 34
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	39  CoreFoundation                      0x30518713 <redacted> + 346
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	40  CoreFoundation                      0x30516edf <redacted> + 1406
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	41  CoreFoundation                      0x30481471 CFRunLoopRunSpecific + 524
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	42  CoreFoundation                      0x30481253 CFRunLoopRunInMode + 106
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	43  UIKit                               0x32d3b5c3 <redacted> + 762
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	44  UIKit                               0x32d36845 UIApplicationMain + 1136
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	45  tltouch                             0x000d7a9c TFLog + 666911
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	46  tltouch                             0x000a7b43 TFLog + 470470
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	47  tltouch                             0x0004070b TFLog + 47502
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	48  tltouch                             0x001e35b4 TFLog + 1763383
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	49  tltouch                             0x0041777f TFLog + 4073986
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	50  tltouch                             0x0045f58d TFLog + 4368400
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	51  tltouch                             0x00463329 TFLog + 4384172
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	52  tltouch                             0x00463179 TFLog + 4383740
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	53  tltouch                             0x00401811 TFLog + 3984020
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	54  tltouch                             0x004a988c xamarin_get_block_descriptor + 3464
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 	55  libdyld.dylib                       0x3ada3ab7 <redacted> + 2
Jan 26 14:20:30 Christians-iPhone-5 tltouch[1300] <Error>: 
	=================================================================
	Got a SIGABRT while executing native code. This usually indicates
	a fatal error in the mono runtime or one of the native libraries 
	used by your application.
	=================================================================
Jan 26 14:20:30 Christians-iPhone-5 ReportCrash[1301] <Notice>: ReportCrash acting against PID 1300
Jan 26 14:20:30 Christians-iPhone-5 ReportCrash[1301] <Notice>: Formulating crash report for process tltouch[1300]
Jan 26 14:20:30 Christians-iPhone-5 com.apple.launchd[1] (UIKitApplication:thai-language[0xf745][1300]) <Warning>: (UIKitApplication:thai-language[0xf745]) Job appears to have crashed: Abort trap: 6
Comment 1 Zoltan Varga 2014-01-26 19:41:57 UTC
What xamarin.ios version is this ? Can you attach some kind of test project ?
Comment 2 Christian Rishøj 2014-01-27 04:51:36 UTC
Using the latest version from the "alpha" channel:

=== Xamarin Studio ===

Version 4.3.1 (build 5)
Installation UUID: a2c3ebba-03b0-42fb-a504-a5d1b522dea9
Runtime:
	Mono 3.2.6 ((no/9b58377)
	GTK+ 2.24.23 theme: Raleigh
	GTK# (2.12.0.0)
	Package version: 302060000

=== Apple Developer Tools ===

Xcode 5.0.2 (3335.32)
Build 5A3005

=== Xamarin.iOS ===

Version: 7.0.6.168 (Business Edition)
Hash: 2ed9bc9
Branch: 
Build date: 2014-21-01 06:33:05-0500

=== Xamarin.Android ===

Not Installed

=== Xamarin.Mac ===

Xamarin.Mac: Not Installed

=== Build Information ===

Release ID: 403010005
Git revision: c8e0387a36f22ec945cfdeddbe56a9c61594746c
Build date: 2014-01-17 23:40:42+0000
Xamarin addins: 522675b4b87feda7438d2ac402234f9a4b8053e4

=== Operating System ===

Mac OS X 10.9.1
Darwin localhost 13.0.0 Darwin Kernel Version 13.0.0
    Thu Sep 19 22:22:27 PDT 2013
    root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64
Comment 3 Christian Rishøj 2014-01-27 05:04:31 UTC
The app is part of a larger source tree, which weighs in at 1.2 GB with all assets and referenced projects. I can zip that up, if it would be helpful. 

Alternatively, would a compiled .ipa be of any use? I suppose you could re-sign it and run it on a device in your end.
Comment 4 Zoltan Varga 2014-01-27 10:29:33 UTC
A source project would be better, its harder to track down problems with binaries.
Comment 6 Zoltan Varga 2014-01-28 00:32:26 UTC
Fixed in mono f060b9998928275154c8cc426850cad5f6f23003/mt 60c6ff0d583ff6805cba2776da4e29cc8150d600. 

Thanks for the testcase.

A simple testcase is:
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
		public static int BinarySearch<T, K>(IReadOnlyList<T> list, K value, Converter<T, K> convert, Comparison<K> compare)
		{
			int i = 0;
			int j = list.Count - 1;
			while (i <= j)
			{
				int m = i + (j - i) / 2;
				int r = compare(convert(list[m]), value);
				if (r == 0)
					return m;
				if (r < 0)
					i = m + 1;
				else
					j = m - 1;
			}
			return ~i;
		}

		class FooClass {
			public uint prop;
		}

        public override void FinishedLaunching (UIApplication application)
        {
			var arr = new FooClass [16];
			for (int i = 0; i < 16; ++i)
				arr [i] = new FooClass () { prop = (uint)i };

			BinarySearch<FooClass, uint> (arr, (uint)5, v => { return v.prop; }, (a,b) => { return (int)(a - b); });
        }
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Comment 7 Christian Rishøj 2014-01-28 05:33:07 UTC
Thanks for the quick response. 

Please provide a link to the patch, so I can release the app with armv7s code. (I wasn't immediately able to locate the referenced commits in the Mono repository.)
Comment 8 Zoltan Varga 2014-01-28 07:16:01 UTC
The fix will be part of future xamarin.ios release.
Comment 9 Zoltan Varga 2014-01-28 07:36:46 UTC
As a workaround, try adding an overload to alib/array.cs which takes an array as an argument instead of a IReadOnlyList<T>, i.e.:

public static int BinarySearch<T, K>(T[] list, K value, Converter<T, K> convert, Comparison<K> compare)
Comment 10 Christian Rishøj 2014-01-28 13:08:20 UTC
Thanks, I can confirm that your suggested workaround does the trick.
Comment 11 Rolf Bjarne Kvinge [MSFT] 2014-03-03 08:58:41 UTC
Closing as fixed.
Comment 12 Shruti 2014-03-20 11:21:47 UTC
Created attachment 6365 [details]
Test Project
Comment 13 Shruti 2014-03-20 11:27:44 UTC
I have created a sample test project to test this and added code suggested in Comment 6 and comment 7
in test project. When i launched this application, it is getting deployed on device. 

Sample project is attached in comment 12.

Environment Info:
XS 4.2.4 (build 32) + X.iOS 7.2.1.20

Hence closing this issue......Please let me know If anything additional revert to check.