Bug 26245 - Adding a CGPoint to a Collection<CGPoint> crashes on ARM64
Summary: Adding a CGPoint to a Collection<CGPoint> crashes on ARM64
Status: VERIFIED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: XI 8.6.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: 8.6.x (services rel)
Assignee: Zoltan Varga
URL:
Depends on:
Blocks:
 
Reported: 2015-01-21 12:46 UTC by John Miller [MSFT]
Modified: 2015-01-22 10:14 UTC (History)
5 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 John Miller [MSFT] 2015-01-21 12:46:47 UTC
**Overview:**

   Adding a CGPoint to a Collection<CGPoint> crashes on ARM64 / 64bit devices. 

**Steps to Reproduce:**

   1. Create a new Unified iOS Single View Application. 
   2. In the ViewDidLoad of a controller, add this code:

Collection<CGPoint> points = new Collection<CGPoint> ();
points.Add (new CGPoint (50, 50));
   
   3. Run this on a 64 bit device. (Tested with iPhone 5s)

**Actual Results:**

>2015-01-21 09:42:55.624 TestARM64[1449:713319] critical:   at <unknown> <0xffffffff>
>2015-01-21 09:42:55.625 TestARM64[1449:713319] critical:   at System.Collections.ObjectModel.Collection`1<CoreGraphics.CGPoint>.InsertItem (int,CoreGraphics.CGPoint) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Collections.ObjectModel/Collection.cs:121
>2015-01-21 09:42:55.626 TestARM64[1449:713319] critical:   at System.Collections.ObjectModel.Collection`1<CoreGraphics.CGPoint>.Add (CoreGraphics.CGPoint) [0x0000c] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Collections.ObjectModel/Collection.cs:81
>2015-01-21 09:42:55.626 TestARM64[1449:713319] critical:   at TestARM64.TestARM64ViewController.ViewDidLoad () [0x00021] in /Users/johnmiller/Downloads/TestARM64/TestARM64/TestARM64ViewController.cs:36
>2015-01-21 09:42:55.626 TestARM64[1449:713319] critical:   at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) <0xffffffff>
>2015-01-21 09:42:55.626 TestARM64[1449:713319] critical:   at <unknown> <0xffffffff>
>2015-01-21 09:42:55.627 TestARM64[1449:713319] critical:   at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <0xffffffff>
>2015-01-21 09:42:55.627 TestARM64[1449:713319] critical:   at UIKit.UIApplication.Main (string[],intptr,intptr) [0x00005] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:62
>2015-01-21 09:42:55.627 TestARM64[1449:713319] critical:   at UIKit.UIApplication.Main (string[],string,string) [0x0001c] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:45
>2015-01-21 09:42:55.627 TestARM64[1449:713319] critical:   at TestARM64.Application.Main (string[]) [0x00008] in /Users/johnmiller/Downloads/TestARM64/TestARM64/Main.cs:17
>2015-01-21 09:42:55.628 TestARM64[1449:713319] critical:   at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) <0xffffffff>
>2015-01-21 09:42:55.628 TestARM64[1449:713319] critical: 
>Native stacktrace:

>2015-01-21 09:42:55.652 TestARM64[1449:713319] critical: 	0   TestARM64                           0x00000001002455f4 mono_handle_native_sigsegv + 268
>2015-01-21 09:42:55.652 TestARM64[1449:713319] critical: 	1   libsystem_platform.dylib            0x00000001942a095c _sigtramp + 68
>2015-01-21 09:42:55.653 TestARM64[1449:713319] critical: 	2   libsystem_pthread.dylib             0x00000001942a9228 pthread_kill + 112
>2015-01-21 09:42:55.653 TestARM64[1449:713319] critical: 	3   libsystem_c.dylib                   0x0000000194182b18 abort + 112
>2015-01-21 09:42:55.653 TestARM64[1449:713319] critical: 	4   TestARM64                           0x00000001003022e8 log_callback + 72
>2015-01-21 09:42:55.653 TestARM64[1449:713319] critical: 	5   TestARM64                           0x00000001002f8dfc monoeg_assertion_message + 96
>2015-01-21 09:42:55.654 TestARM64[1449:713319] critical: 	6   TestARM64                           0x000000010024180c get_arg_slots + 264
>2015-01-21 09:42:55.654 TestARM64[1449:713319] critical: 	7   TestARM64                           0x0000000100241278 mono_arch_get_gsharedvt_call_info + 264
>2015-01-21 09:42:55.654 TestARM64[1449:713319] critical: 	8   TestARM64                           0x00000001002469c0 mini_get_gsharedvt_wrapper + 236
>2015-01-21 09:42:55.654 TestARM64[1449:713319] critical: 	9   TestARM64                           0x000000010024afb0 mini_add_method_trampoline + 464
>2015-01-21 09:42:55.655 TestARM64[1449:713319] critical: 	10  TestARM64                           0x000000010024b47c common_call_trampoline + 992
>2015-01-21 09:42:55.655 TestARM64[1449:713319] critical: 	11  TestARM64                           0x00000001001f566c generic_trampoline_vcall + 252
>2015-01-21 09:42:55.655 TestARM64[1449:713319] critical: 	12  TestARM64                           0x00000001000d5670 System_Collections_ObjectModel_Collection_1_CoreGraphics_CGPoint_InsertItem_int_CoreGraphics_CGPoint + 192
>2015-01-21 09:42:55.655 TestARM64[1449:713319] critical: 	13  TestARM64                           0x00000001000d500c System_Collections_ObjectModel_Collection_1_CoreGraphics_CGPoint_Add_CoreGraphics_CGPoint + 268
>2015-01-21 09:42:55.655 TestARM64[1449:713319] critical: 	14  TestARM64                           0x00000001000d4954 TestARM64_TestARM64ViewController_ViewDidLoad + 436
>2015-01-21 09:42:55.656 TestARM64[1449:713319] critical: 	15  TestARM64                           0x00000001001d3fd4 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 116
>2015-01-21 09:42:55.656 TestARM64[1449:713319] critical: 	16  TestARM64                           0x0000000100251524 mono_jit_runtime_invoke + 1264
>2015-01-21 09:42:55.656 TestARM64[1449:713319] critical: 	17  TestARM64                           0x000000010029cad0 mono_runtime_invoke + 128
>2015-01-21 09:42:55.656 TestARM64[1449:713319] critical: 	18  TestARM64                           0x00000001002183bc native_to_managed_trampoline_5 + 204
>2015-01-21 09:42:55.657 TestARM64[1449:713319] critical: 	19  TestARM64                           0x0000000100218ae4 -[TestARM64ViewController viewDidLoad] + 52
>2015-01-21 09:42:55.657 TestARM64[1449:713319] critical: 	20  UIKit                               0x0000000187b30aa0 <redacted> + 692
>2015-01-21 09:42:55.657 TestARM64[1449:713319] critical: 	21  UIKit                               0x0000000187b307b0 <redacted> + 32
>2015-01-21 09:42:55.657 TestARM64[1449:713319] critical: 	22  UIKit                               0x0000000187b36e78 <redacted> + 72
>2015-01-21 09:42:55.657 TestARM64[1449:713319] critical: 	23  UIKit                               0x0000000187b345f8 <redacted> + 260
>2015-01-21 09:42:55.658 TestARM64[1449:713319] critical: 	24  UIKit                               0x0000000187ba5640 <redacted> + 56
>2015-01-21 09:42:55.658 TestARM64[1449:713319] critical: 	25  UIKit                               0x0000000187db91dc <redacted> + 2804
>2015-01-21 09:42:55.658 TestARM64[1449:713319] critical: 	26  UIKit                               0x0000000187dbb754 <redacted> + 1480
>2015-01-21 09:42:55.658 TestARM64[1449:713319] critical: 	27  UIKit                               0x0000000187db9dec <redacted> + 184
>2015-01-21 09:42:55.659 TestARM64[1449:713319] critical: 	28  FrontBoardServices                  0x000000018b5f562c <redacted> + 28
>2015-01-21 09:42:55.659 TestARM64[1449:713319] critical: 	29  CoreFoundation                      0x0000000183336a28 <redacted> + 20
>2015-01-21 09:42:55.659 TestARM64[1449:713319] critical: 	30  CoreFoundation                      0x0000000183335b30 <redacted> + 312
>2015-01-21 09:42:55.659 TestARM64[1449:713319] critical: 	31  CoreFoundation                      0x0000000183333d30 <redacted> + 696
>2015-01-21 09:42:55.659 TestARM64[1449:713319] critical: 	32  CoreFoundation                      0x00000001832610a4 CFRunLoopRunSpecific + 396
>2015-01-21 09:42:55.660 TestARM64[1449:713319] critical: 	33  UIKit                               0x0000000187b9b3c8 <redacted> + 552
>2015-01-21 09:42:55.660 TestARM64[1449:713319] critical: 	34  UIKit                               0x0000000187b963c0 UIApplicationMain + 1488
>2015-01-21 09:42:55.660 TestARM64[1449:713319] critical: 	35  TestARM64                           0x00000001001149f8 wrapper_managed_to_native_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr + 344
>2015-01-21 09:42:55.660 TestARM64[1449:713319] critical: 	36  TestARM64                           0x00000001000f2e14 UIKit_UIApplication_Main_string___intptr_intptr + 52
>2015-01-21 09:42:55.660 TestARM64[1449:713319] critical: 	37  TestARM64                           0x00000001000f2dc0 UIKit_UIApplication_Main_string___string_string + 192
>2015-01-21 09:42:55.661 TestARM64[1449:713319] critical: 	38  TestARM64                           0x00000001000d4118 TestARM64_Application_Main_string__ + 168
>2015-01-21 09:42:55.661 TestARM64[1449:713319] critical: 	39  TestARM64                           0x00000001001d3fd4 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 116
>2015-01-21 09:42:55.661 TestARM64[1449:713319] critical: 	40  TestARM64                           0x0000000100251524 mono_jit_runtime_invoke + 1264
>2015-01-21 09:42:55.661 TestARM64[1449:713319] critical: 	41  TestARM64                           0x000000010029cad0 mono_runtime_invoke + 128
>2015-01-21 09:42:55.661 TestARM64[1449:713319] critical: 	42  TestARM64                           0x00000001002a0c44 mono_runtime_exec_main + 404
>2015-01-21 09:42:55.662 TestARM64[1449:713319] critical: 	43  TestARM64                           0x00000001002fff28 xamarin_main + 2120
>2015-01-21 09:42:55.662 TestARM64[1449:713319] critical: 	44  TestARM64                           0x00000001002192f4 main + 112
>2015-01-21 09:42:55.662 TestARM64[1449:713319] critical: 	45  libdyld.dylib                       0x00000001940f2a08 <redacted> + 4

**Expected Results:**

   No crash. It does not crash on 32 bit devices (no ARM64).

**Build Date & Platform:**

   XI 8.6

**Additional Information:**

   Does not crash when using List<CGPoint> instead.
Comment 1 Zoltan Varga 2015-01-21 13:54:07 UTC
This is probably a dup of #26085:
https://bugzilla.xamarin.com/show_bug.cgi?id=26085
Comment 2 Atin 2015-01-21 14:12:08 UTC
I have checked this issue and able to reproduce this. To reproduce this issue I have followed the steps and instruction provided in bug description.

Steps I followed:

1. Create an iOS=>Unified API=>iPhone=>Single View Application.
2. In the ViewDidLoad of a controller, add this code:
Collection<CGPoint> points = new Collection<CGPoint> ();
points.Add (new CGPoint (50, 50));
3. Build and deploy the application on device.
4. Observed that app will crash and get the following error in application output.

Error Details: https://gist.github.com/Arpit360/2514ab04960a881c9de9

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

Additional Information: I observed that if I use  List<CGPoint> at the place of Collection<CGPoint> , the application deploy successfully

Device Log: https://gist.github.com/Arpit360/d0a6ba3d3c25cd7dc408
Ide Logs: https://gist.github.com/Arpit360/2be82824253d5202ca11
iOS Designer Logs: https://gist.github.com/Arpit360/c018c7b431d1314d7953
Application Output:https://gist.github.com/Arpit360/a4bf99f6cd1d8a6bf984

Environment info:

=== Xamarin Studio ===

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

	Package version: 312000068

=== Xamarin.Android ===

Version: 4.20.0.28 (Enterprise 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)

=== Apple Developer Tools ===

Xcode 6.1 (6602)
Build 6A1052c

=== Xamarin.iOS ===

Version: 8.6.1.6 (Enterprise Edition)
Hash: dd1b996
Branch: 
Build date: 2015-01-15 15:06:20-0500

=== Xamarin.Mac ===

Version: 1.10.0.18 (Enterprise Edition)

=== Build Information ===

Release ID: 507010014
Git revision: a4dd61ad7f8b3695be4b17bcb5c3ae6b81438cf7
Build date: 2015-01-19 15:21:09-05
Xamarin addins: 081208fe3bbf40e24a562867c6c7fba20a9b94b6

=== 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 3 Sebastien Pouliot 2015-01-21 14:52:02 UTC
I agree with Zoltan, it works fine for me with that fix - but it requires 8.6.1.16+ to confirm

Marking as FIXED and updated milestone so that can be verified by QA for the 8.6.1 service release.
Comment 4 Mohit Kheterpal 2015-01-22 10:14:04 UTC
I have checked this issue using X.iOS 8.6.1.19 and this issue is working fine now as shown in screencast : http://www.screencast.com/t/fPMOsz55m

i.e. now we are not getting error in application output when we use code mention in bug description.

Hence closing this issue.