Bug 30232 - Crash on delegate call from native 3rd party library on arm64 only
Summary: Crash on delegate call from native 3rd party library on arm64 only
Status: RESOLVED ANSWERED
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: XI 8.10
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Rolf Bjarne Kvinge [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2015-05-19 12:52 UTC by Michiel van Vlaardingen
Modified: 2015-05-25 08:09 UTC (History)
3 users (show)

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


Attachments
Reproduction project (3.60 MB, application/zip)
2015-05-19 12:52 UTC, Michiel van Vlaardingen
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:
RESOLVED ANSWERED

Description Michiel van Vlaardingen 2015-05-19 12:52:33 UTC
Created attachment 11245 [details]
Reproduction project

As posted on http://forums.xamarin.com/discussion/41535/crash-on-64-bit-devices-after-unified-migration


The app crashes as soon as the third party library (PushWoosh)  calls one of the methods on the delegate (PushDelegate in AppDelegate.cs in the sample).  The crash only occurs when ARM64 is used, building it for ARMv7 only stops it from crashing.


2015-05-19 18:45:01.485 PushwooshSample[454:61419] critical: Stacktrace:

2015-05-19 18:45:01.485 PushwooshSample[454:61419] critical:   at <unknown> <0xffffffff>
2015-05-19 18:45:01.486 PushwooshSample[454:61419] critical:   at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <0xffffffff>
2015-05-19 18:45:01.486 PushwooshSample[454:61419] critical:   at UIKit.UIApplication.Main (string[],intptr,intptr) [0x00005] in /Users/builder/data/lanes/1503/6481535e/source/maccore/src/UIKit/UIApplication.cs:63
2015-05-19 18:45:01.486 PushwooshSample[454:61419] critical:   at UIKit.UIApplication.Main (string[],string,string) [0x0001c] in /Users/builder/data/lanes/1503/6481535e/source/maccore/src/UIKit/UIApplication.cs:46
2015-05-19 18:45:01.487 PushwooshSample[454:61419] critical:   at PushwooshSample.Application.Main (string[]) [0x00008] in /Users/michiel/projects/xamarin_issues_poc/xamarin_pushwoosh_amd64_crash_on_delegate_call/iOS/PushwooshSample/Main.cs:16
2015-05-19 18:45:01.487 PushwooshSample[454:61419] critical:   at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) <0xffffffff>
2015-05-19 18:45:01.487 PushwooshSample[454:61419] critical: 
Native stacktrace:

2015-05-19 18:45:01.493 PushwooshSample[454:61419] critical: 	0   PushwooshSample                     0x00000001002a6a38 mono_handle_native_sigsegv + 264
2015-05-19 18:45:01.493 PushwooshSample[454:61419] critical: 	1   PushwooshSample                     0x00000001002b3914 mono_sigsegv_signal_handler + 324
2015-05-19 18:45:01.493 PushwooshSample[454:61419] critical: 	2   libsystem_platform.dylib            0x0000000193bcc95c _sigtramp + 68
2015-05-19 18:45:01.493 PushwooshSample[454:61419] critical: 	3   PushwooshSample                     0x00000001003a495c xamarin_trampoline + 2996
2015-05-19 18:45:01.494 PushwooshSample[454:61419] critical: 	4   Foundation                          0x0000000183869df0 <redacted> + 372
2015-05-19 18:45:01.494 PushwooshSample[454:61419] critical: 	5   CoreFoundation                      0x000000018294e9ec <redacted> + 24
2015-05-19 18:45:01.494 PushwooshSample[454:61419] critical: 	6   CoreFoundation                      0x000000018294dc90 <redacted> + 264
2015-05-19 18:45:01.494 PushwooshSample[454:61419] critical: 	7   CoreFoundation                      0x000000018294bd40 <redacted> + 712
2015-05-19 18:45:01.494 PushwooshSample[454:61419] critical: 	8   CoreFoundation                      0x00000001828790a4 CFRunLoopRunSpecific + 396
2015-05-19 18:45:01.495 PushwooshSample[454:61419] critical: 	9   GraphicsServices                    0x000000018b9df5a4 GSEventRunModal + 168
2015-05-19 18:45:01.495 PushwooshSample[454:61419] critical: 	10  UIKit                               0x00000001871ae3c0 UIApplicationMain + 1488
2015-05-19 18:45:01.495 PushwooshSample[454:61419] critical: 	11  PushwooshSample                     0x00000001000f234c wrapper_managed_to_native_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr + 348
2015-05-19 18:45:01.495 PushwooshSample[454:61419] critical: 	12  PushwooshSample                     0x00000001000d0b8c UIKit_UIApplication_Main_string___intptr_intptr + 44
2015-05-19 18:45:01.495 PushwooshSample[454:61419] critical: 	13  PushwooshSample                     0x00000001000d0b4c UIKit_UIApplication_Main_string___string_string + 172
2015-05-19 18:45:01.496 PushwooshSample[454:61419] critical: 	14  PushwooshSample                     0x00000001000b21ac PushwooshSample_Application_Main_string__ + 156
2015-05-19 18:45:01.496 PushwooshSample[454:61419] critical: 	15  PushwooshSample                     0x00000001002131b4 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 180
2015-05-19 18:45:01.496 PushwooshSample[454:61419] critical: 	16  PushwooshSample                     0x00000001002b5b54 mono_jit_runtime_invoke + 1260
2015-05-19 18:45:01.496 PushwooshSample[454:61419] critical: 	17  PushwooshSample                     0x000000010031880c mono_runtime_invoke + 128
2015-05-19 18:45:01.496 PushwooshSample[454:61419] critical: 	18  PushwooshSample                     0x000000010031cfa8 mono_runtime_exec_main + 404
2015-05-19 18:45:01.497 PushwooshSample[454:61419] critical: 	19  PushwooshSample                     0x0000000100399d3c xamarin_main + 1844
2015-05-19 18:45:01.497 PushwooshSample[454:61419] critical: 	20  PushwooshSample                     0x00000001002757a0 main + 96
2015-05-19 18:45:01.497 PushwooshSample[454:61419] critical: 	21  libdyld.dylib                       0x0000000193a1ea08 <redacted> + 4
2015-05-19 18:45:01.497 PushwooshSample[454:61419] critical: 
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================
Comment 1 Rolf Bjarne Kvinge [MSFT] 2015-05-25 06:52:46 UTC
You have the [Model] attribute on the PushDelegate class, and then you create a PushDelegate instance.

[Model] classes aren't supposed to be instantiated directly, they're supposed to be classes you subclass, and then override selected members to customize behavior.

Solutions (either work):
a) Don't create a PushDelegate class, subclass PushDelegate, and create an instance of that class.
b) Remove the [Model] attribute.