Bug 26256 - [64bit] App runs fine with ARM7 but fails with ARM7+ARM64
Summary: [64bit] App runs fine with ARM7 but fails with ARM7+ARM64
Status: VERIFIED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: XI 8.6.0
Hardware: Macintosh Mac OS
: High major
Target Milestone: 8.6.x (services rel)
Assignee: Rolf Bjarne Kvinge [MSFT]
URL:
: 26457 26723 27115 27282 ()
Depends on:
Blocks:
 
Reported: 2015-01-21 17:44 UTC by Frank A. Krueger
Modified: 2015-03-02 14:03 UTC (History)
14 users (show)

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

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 2015-01-21 17:44:46 UTC
I have an app that works when creating a debug build (no link, ARM7, no LLVM, sgen) but fails with a release build (link sdks, ARM7+ARM64, LLVM, sgen)

assertion failed: 12B440: libxpc.dylib + 71820 [A4F17798-F3DE-3FBC-85E3-F569762F0EB9]: 0x7d

Stacktrace:
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) Foundation.NSObject.xamarin_release_managed_ref (intptr,intptr) <0xffffffff>
  at Foundation.NSObject.ReleaseManagedRef () <0x0001f>
  at Foundation.NSObject/NSObject_Disposer.Drain (Foundation.NSObject) <0x0012b>
  at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) <0xffffffff>
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <0xffffffff>
  at UIKit.UIApplication.Main (string[],intptr,intptr) <0x00033>
  at UIKit.UIApplication.Main (string[],string,string) <0x0008f>
  at Mocast.Application.Main (string[]) <0x0001b>
  at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) <0xffffffff>


Rolf: you can build the Release version of Mocast and it repros usually on launch or after just a few seconds of use.


OS Version:          iOS 8.1.2 (12B440)
Report Version:      105

Exception Type:  EXC_BAD_ACCESS (SIGABRT)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000010
Triggered by Thread:  0

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_kernel.dylib        	0x00000001933bf270 __pthread_kill + 8
1   libsystem_pthread.dylib       	0x000000019345d224 pthread_kill + 108
2   libsystem_c.dylib             	0x0000000193336b14 abort + 108
3   Mocast                        	0x000000010078e8dc 0x1000ac000 + 7219420
4   Mocast                        	0x000000010079846c 0x1000ac000 + 7259244
5   libsystem_platform.dylib      	0x0000000193454958 _sigtramp + 64
6   libobjc.A.dylib               	0x0000000192c51720 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 560
7   CoreFoundation                	0x00000001823bce40 _CFAutoreleasePoolPop + 24
8   Foundation                    	0x00000001832be780 -[NSAutoreleasePool release] + 144
9   Mocast                        	0x0000000100852378 xamarin_release_managed_ref + 160
10  Mocast                        	0x0000000100427cd4 0x1000ac000 + 3652820
11  Mocast                        	0x00000001003a722c 0x1000ac000 + 3125804
12  Mocast                        	0x000000010040c258 0x1000ac000 + 3539544
13  Mocast                        	0x0000000100347440 0x1000ac000 + 2733120
14  Mocast                        	0x000000010079a574 0x1000ac000 + 7267700
15  Mocast                        	0x00000001007e86b8 0x1000ac000 + 7587512
16  Mocast                        	0x000000010075b1c4 0x1000ac000 + 7008708
17  Mocast                        	0x000000010075ff84 0x1000ac000 + 7028612
18  Foundation                    	0x00000001833addec __NSThreadPerformPerform + 368
19  CoreFoundation                	0x00000001824929e8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 20
20  CoreFoundation                	0x0000000182491c8c __CFRunLoopDoSources0 + 260
21  CoreFoundation                	0x000000018248fd3c __CFRunLoopRun + 708
22  CoreFoundation                	0x00000001823bd0a0 CFRunLoopRunSpecific + 392
23  GraphicsServices              	0x000000018b55f5a0 GSEventRunModal + 164
24  UIKit                         	0x0000000186cf23bc UIApplicationMain + 1484
25  Mocast                        	0x0000000100433164 0x1000ac000 + 3699044
26  Mocast                        	0x00000001003b464c 0x1000ac000 + 3180108
27  Mocast                        	0x00000001003b4608 0x1000ac000 + 3180040
28  Mocast                        	0x00000001000b0020 0x1000ac000 + 16416
29  Mocast                        	0x0000000100347440 0x1000ac000 + 2733120
30  Mocast                        	0x000000010079a574 0x1000ac000 + 7267700
31  Mocast                        	0x00000001007e86b8 0x1000ac000 + 7587512
32  Mocast                        	0x00000001007ec938 0x1000ac000 + 7604536
33  Mocast                        	0x000000010084f194 0x1000ac000 + 8008084
34  Mocast                        	0x0000000100762c84 0x1000ac000 + 7040132
35  libdyld.dylib                 	0x00000001932a6a04 start + 0
Comment 1 Frank A. Krueger 2015-01-21 17:48:16 UTC
I should also mention that I get a message about TLS before the assertion:

Found new TLS offset at 224
assertion failed: 12B440: libxpc.dylib + 71820 [A4F17798-F3DE-3FBC-85E3-F569762F0EB9]: 0x7d
Comment 2 Frank A. Krueger 2015-01-21 18:00:19 UTC
That XPC assertion seems to be a red herring.

The problem revolves around ARM64. If I enable ARM7+ARM64 then the app reliably crashes with the above stack traces.

If I just run ARM7, the app runs fine (I still get that assertion sometimes). I have disabled LLVM in both instances.

If you grab the source and run with Release, you sometimes have to jump around in tabs for a second, but it's 100% reproducible crash.
Comment 3 Rolf Bjarne Kvinge [MSFT] 2015-01-23 05:35:54 UTC
I can reproduce this.
Comment 4 Manuel Fegerl 2015-01-23 08:17:31 UTC
I am having a very similar issue - alltho the stack trace is very different.

I can built just fine in both Debug and Release options - and it also runs fine in Release mode - as long as I dont add ARM64 as target (and ofc deploy on a arm64 device) - then it crashes. Armv7 and Armv7s work just fine. No built errors just a crash. Using Xamarin Forms 1.3.1 if that matters..
Comment 5 Allan Ritchie 2015-01-23 14:18:47 UTC
I'm getting random crashes like this only on ARM64 builds as well.  ARMv7(s) work without issue.  The app can sometimes run for 3-4 seconds, but usually it dies right away.

SGEN - on
LLVM - off

3 stacktraces below

#1
2015-01-22 16:29:56.146 AsglTsiiOS[34071:5204609] critical:           0   AsglTsiiOS                          0x0000000101974488 mono_handle_native_sigsegv + 268
2015-01-22 16:29:56.146 AsglTsiiOS[34071:5204609] critical:           1   AsglTsiiOS                          0x0000000101980f10 mono_sigsegv_signal_handler + 316
2015-01-22 16:29:56.146 AsglTsiiOS[34071:5204609] critical:           2   libsystem_platform.dylib            0x0000000196d7c95c _sigtramp + 68
2015-01-22 16:29:56.147 AsglTsiiOS[34071:5204609] critical:           3   AsglTsiiOS                          0x0000000101a0de74 major_scan_object + 1256
2015-01-22 16:29:56.147 AsglTsiiOS[34071:5204609] critical:           4   AsglTsiiOS                          0x0000000101a0de74 major_scan_object + 1256
2015-01-22 16:29:56.147 AsglTsiiOS[34071:5204609] critical:           5   AsglTsiiOS                          0x0000000101a094f4 job_scan_from_registered_roots + 212
2015-01-22 16:29:56.147 AsglTsiiOS[34071:5204609] critical:           6   AsglTsiiOS                          0x0000000101a0708c major_copy_or_mark_from_roots + 1764
2015-01-22 16:29:56.147 AsglTsiiOS[34071:5204609] critical:           7   AsglTsiiOS                          0x0000000101a01e9c major_do_collection + 92
2015-01-22 16:29:56.148 AsglTsiiOS[34071:5204609] critical:           8   AsglTsiiOS                          0x00000001019ffde4 sgen_perform_collection + 940
2015-01-22 16:29:56.148 AsglTsiiOS[34071:5204609] critical:           9   AsglTsiiOS                          0x0000000101a0b3ec sgen_los_alloc_large_inner + 108
2015-01-22 16:29:56.148 AsglTsiiOS[34071:5204609] critical:           10  AsglTsiiOS                          0x00000001019f3f6c mono_gc_alloc_obj_nolock + 132
2015-01-22 16:29:56.148 AsglTsiiOS[34071:5204609] critical:           11  AsglTsiiOS                          0x00000001019f4488 mono_gc_alloc_vector + 152
2015-01-22 16:29:56.149 AsglTsiiOS[34071:5204609] critical:           12  AsglTsiiOS                          0x00000001019e7440 mono_array_new_specific + 96
2015-01-22 16:29:56.149 AsglTsiiOS[34071:5204609] critical:           13  AsglTsiiOS                          0x00000001003ea228 wrapper_managed_to_native_object___icall_wrapper_mono_array_new_specific_intptr_int + 104
2015-01-22 16:29:56.149 AsglTsiiOS[34071:5204609] critical:           14  AsglTsiiOS                          0x00000001010d0a5c Asgl_Tsi_Core_Services_Impl_HttpServiceImpl__Downloadc__async6_MoveNext + 332
2015-01-22 16:29:56.149 AsglTsiiOS[34071:5204609] critical:           15  AsglTsiiOS                          0x0000000101135c04 


#2
2015-01-22 16:29:55.783 AsglTsiiOS[34071:5204609] critical:   at <unknown> <0xffffffff>
2015-01-22 16:29:55.784 AsglTsiiOS[34071:5204609] critical:   at (wrapper managed-to-native) object.__icall_wrapper_mono_array_new_specific (intptr,int) <0xffffffff>
2015-01-22 16:29:55.784 AsglTsiiOS[34071:5204609] critical:   at Asgl.Tsi.Core.Services.Impl.HttpServiceImpl/<Download>c__async6.MoveNext () [0x00037] in /Users/aritchie/Desktop/tsi-mobile/Asgl.Tsi.Core/Services/Impl/Http/OriginalHttpServiceImpl.cs:127
2015-01-22 16:29:55.784 AsglTsiiOS[34071:5204609] critical:   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<Asgl.Tsi.Core.Models.HttpDownloadResult>.Start<Asgl.Tsi.Core.Services.Impl.HttpServiceImpl/<Download>c__async6> (Asgl.Tsi.Core.Services.Impl.HttpServiceImpl/<Download>c__async6&) [0x0001b] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.CompilerServices/AsyncTaskMethodBuilder_T.cs:107
2015-01-22 16:29:55.785 AsglTsiiOS[34071:5204609] critical:   at Asgl.Tsi.Core.Services.Impl.HttpServiceImpl.Download (string,Acr.MvvmCross.Plugins.FileSystem.IFile,System.Action`1<Asgl.Tsi.Core.Models.HttpFileProgressArgs>,System.Threading.CancellationToken) <IL 0x0003f, 0x002ff>


#3
2015-01-22 16:34:50.250 AsglTsiiOS[34096:5206397] critical:   at <unknown> <0xffffffff>
2015-01-22 16:34:50.251 AsglTsiiOS[34096:5206397] critical:   at (wrapper managed-to-native) object.__icall_wrapper_mono_array_new_specific (intptr,int) <0xffffffff>
2015-01-22 16:34:50.251 AsglTsiiOS[34096:5206397] critical:   at System.Collections.Generic.Dictionary`2.Resize () <0x0006f>
2015-01-22 16:34:50.251 AsglTsiiOS[34096:5206397] critical:   at System.Collections.Generic.Dictionary`2.Add (TKey,TValue) <0x00227>
2015-01-22 16:34:50.252 AsglTsiiOS[34096:5206397] critical:   at System.Collections.Generic.Dictionary`2..ctor (System.Collections.Generic.IDictionary`2<TKey, TValue>,System.Collections.Generic.IEqualityComparer`1<TKey>) <0x0016f>
2015-01-22 16:34:50.252 AsglTsiiOS[34096:5206397] critical:   at System.Collections.Generic.Dictionary`2..ctor (System.Collections.Generic.IDictionary`2<TKey, TValue>) <0x00023>
2015-01-22 16:34:50.253 AsglTsiiOS[34096:5206397] critical:   at Newtonsoft.Json.Utilities.ThreadSafeStore`2.AddValue (TKey) <0x002c3>
2015-01-22 16:34:50.253 AsglTsiiOS[34096:5206397] critical:   at Newtonsoft.Json.Utilities.ThreadSafeStore`2.Get (TKey) <0x000c3>
Comment 6 Rolf Bjarne Kvinge [MSFT] 2015-01-26 03:49:13 UTC
@Allan, that does not look like the same bug as Frank has, so please file another bug with your project and we'll have a look at it.
Comment 7 Rolf Bjarne Kvinge [MSFT] 2015-01-27 10:18:02 UTC
Fixed.

maccore/master: 0c90316e05c5acf584fa8f8c1a921675b375522a
Comment 8 Rolf Bjarne Kvinge [MSFT] 2015-01-27 10:19:14 UTC
*** Bug 26457 has been marked as a duplicate of this bug. ***
Comment 9 Rolf Bjarne Kvinge [MSFT] 2015-02-04 08:12:36 UTC
*** Bug 26723 has been marked as a duplicate of this bug. ***
Comment 10 Sebastien Pouliot 2015-02-11 15:04:24 UTC
backported for SR2 in fb4cce8d56f09271e9b5225e3a2e83b89c0c514d
Comment 11 Frank A. Krueger 2015-02-12 14:07:32 UTC
Can you explain which version of Xamarin.iOS that translates to?
Comment 12 Miguel de Icaza [MSFT] 2015-02-12 14:27:58 UTC
Yes, our Service Release 2 is coming in about 3-4 weeks.

That said, since you are an enterprise customer, we can give you a hotfix with the patch.
Comment 13 Rolf Bjarne Kvinge [MSFT] 2015-02-17 03:29:33 UTC
*** Bug 27115 has been marked as a duplicate of this bug. ***
Comment 14 Sadik Ali 2015-02-19 01:38:15 UTC
I have checked this issue with XS 5.7.0.661 + XI 8.6.0.51 and unable to reproduce this issue with the help of bug description.

Steps I have followed to reproduce.
1.Create a Xamarin.IOS->Unified API-> Iphone->Single View Application.
2. Run with with a release build (link sdks, ARM7+ARM64, LLVM, sgen).

I have checked this with 64 bit iPhone 5s [ iOS 8.1.2 (12B440)]

Screencast: http://www.screencast.com/t/qIeVJV2Hhg

Please review the screencast and provide us direction/suggestion how we can reliably reproduce this issue. This will eventually help us to verify  issue with service release 2 builds.

Environment Info : 

=== Xamarin Studio ===

Version 5.7 (build 661)
Installation UUID: 3d25a767-a003-4a7d-9f5e-e57987cf6cf0
Runtime:
	Mono 3.12.0 ((detached/de2f33f)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000076

=== Apple Developer Tools ===

Xcode 6.1 (6602)
Build 6A1052c

=== Xamarin.iOS ===

Version: 8.6.0.51 (Business Edition)
Hash: dfb682f
Branch: 
Build date: 2015-01-08 13:39:32-0500

=== Xamarin.Android ===

Version: 4.20.0.28 (Business Edition)
Android SDK: /Users/mac360_xamarin/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0.3 (API level 15)
		4.4   (API level 19)
		5.0   (API level 21)
Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

=== Xamarin.Mac ===

Version: 1.10.0.18 (Business Edition)

=== Build Information ===

Release ID: 507000661
Git revision: b70bab61da996da29045ea8ee8aed1a6faedbe78
Build date: 2015-01-05 16:31:31-05
Xamarin addins: 82f6c71490562d6cd125a09287f441902fdac3d7

=== Operating System ===

Mac OS X 10.10.0
Darwin mac360-xamarins-Mac-mini.local 14.0.0 Darwin Kernel Version 14.0.0
    Fri Sep 19 00:26:44 PDT 2014
    root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64
Comment 15 Rolf Bjarne Kvinge [MSFT] 2015-02-19 05:07:37 UTC
@Sadik, you don't have access to the original test case that I used to reproduce this, but you should be able to reproduce using the code from bug #27115 comment 1 [1]


[1] https://bugzilla.xamarin.com/show_bug.cgi?id=27115#c1
Comment 19 Rolf Bjarne Kvinge [MSFT] 2015-02-19 14:32:55 UTC
@Ram, that's a problem with the test case, just remove --keeptemp from the additional mtouch arguments .
Comment 20 Ram Chandra 2015-02-19 14:47:03 UTC
@Rolf: Thanks, after removing the mtouch argument, I am not getting any error/crashes with attached project.

I have checked this issue with following builds:

Mac OS X 10.10.0
Xamarin Studio: 5.7.2 (build 2)
Installation UUID: 3d25a767-a003-4a7d-9f5e-e57987cf6cf0
Runtime:
    Mono 3.12.0 ((detached/de2f33f)
    GTK+ 2.24.23 (Raleigh theme)
    Package version: 312000076
Xcode 6.1 (6602)
Build 6A1052c
Xamarin.iOS: 8.6.2.22 
=== Build Information ===
Release ID: 507020002
Git revision: d6231e6325f274cea59da478410f561312c5b401
Build date: 2015-02-17 19:04:38-05
Xamarin addins: b212fd66838b0d6e2435966e541e66ab9c988698


Observation : I have checked this issue with following configurations:

Configuration :  Debug
Supported architectures:  ARMv7
                                        ARMv7s
                                        ARMv7 + ARMv7s
                                        ARM64
                                        ARMv7+ARM64
                                        ARMv7s + ARM64
                                        ARMv7 + ARMv7s + ARm64

Configuration :  Release
Supported architectures:  ARMv7
                                        ARMv7s
                                        ARMv7 + ARMv7s
                                        ARM64
                                        ARMv7+ARM64
                                        ARMv7s + ARM64
                                        ARMv7 + ARMv7s + ARm64

This issue has been fixed. Hence I am closing this issue.
Comment 21 manuel 2015-02-20 10:05:48 UTC
Hi guys

is Xamarin.iOS 8.6.1.26 suppose to solve this issue? We tried it just after updating and the crash did not disappear in ARm64

cheers
Manuel
Comment 22 Sebastien Pouliot 2015-02-20 10:18:01 UTC
@Manual no, XI 8.6.1.26 is 8.6.1.20 (service release 1) with an hotfix for visual studio (no change to XI itself).

This fix (along other ones for ARM64) is coming in the 2nd service release, 8.6.2.x, which should be in the alpha channel likely next week.
Comment 23 Rolf Bjarne Kvinge [MSFT] 2015-02-23 03:49:12 UTC
*** Bug 27282 has been marked as a duplicate of this bug. ***