Bug 39373 - Release App Crashing When Linker Behaviour Set To Dont Link
Summary: Release App Crashing When Linker Behaviour Set To Dont Link
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: XI 9.4 (iOS 9.2)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2016-03-04 18:07 UTC by Jayden Spring
Modified: 2016-04-12 17:56 UTC (History)
2 users (show)

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

Crash Report (30.46 KB, text/plain)
2016-03-04 18:07 UTC, Jayden Spring
LoginViewController.cs (4.00 KB, text/plain)
2016-03-04 21:23 UTC, Jayden Spring
AppDelegate.csd (5.53 KB, text/plain)
2016-03-04 21:24 UTC, Jayden Spring

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:

Description Jayden Spring 2016-03-04 18:07:17 UTC
Created attachment 15269 [details]
Crash Report


I distributed an app through TestFlight Beta to a handful of users, some of which started to report the App kept crashing at the splash screen. At this point I deployed the new build to my iPhone in Release mode and could not replicate this at all. However I found it quite weird how only a handful of people were reporting it back. After getting a hold of one of the users that was reporting this I deployed from XS to their phone in Debug config and it ran fine - at this point I started to look at the build settings. I stripped down everything - rewrote a new AppDelegate which just displayed a blank UIWindow and this still did not get past the splash screen in Release, in DEBUG it did.

On this users device (iPhone 6) when I changed the Linker Behaviour in 'Release' to 'Dont Link' the application ran as expected! After reading about the linker here (https://developer.xamarin.com/guides/ios/advanced_topics/linker/) it said to report in the Bug Tracker when this happens. 

From speaking to my Beta users that this is happening to they are all using iPhone 6's on differing versions (all 9.2 and above).

I am not very unsure as to whether I should release this new version which has Don't link as the linker behaviour.

I have attached a crash report from when the Linker behaviour is set to Link Framework SDK's only on the iPhone 6 I tested on today.
Comment 1 Sebastien Pouliot 2016-03-04 18:26:09 UTC
Title makes it sounds like it the crash happens when using "Do'nt link"

> Release App Crashing When Linker Behaviour Set To Dont Link

but your description

> when I changed the Linker Behaviour in 'Release' to 'Dont Link' the application ran as expected!

seems to implies it works with "Don't link" and fails in (what I assume to be the detault) "Link SDK".

1. Can you please clarify this ?

2. Please provide all the version information about the software being used.

The easiest way to get exact version information is to use the "Xamarin Studio" menu, "About Xamarin Studio" item, "Show Details" button and copy/paste the version informations (you can use the "Copy Information" button).

> I am not very unsure as to whether I should release this new version which
> has Don't link as the linker behaviour.

You could but that might produce an application that will go over Apple's size limits. There are often better workarounds for this but I'll need more details first.

3. Are you able to create a test case (subset of your application) that shows this crash ? or can you share the application itself ?

The attached crash report shows something went wrong at deallocation time. It's only semi-useful as it's likely that the real issue happened earlier (but only caused the crash later on).
Comment 2 Jayden Spring 2016-03-04 21:23:35 UTC
Sorry about the confusion. The crash only happens on a handful of devices when using 'Link SDK' - 3 devices to be exact. One of which I now have in my possession. 

To clarify any confusion ill give the example with two devices my iPhone 6+ and a beta testers iPhone 6. I deployed the Release App with 'Link SDK' to my iPhone and it launched OK - deploying to the iPhone 6, the app crashed after the splash screen producing the above crash report. Changing the linker to 'Dont Link', the app launched on my iPhone and also launched on the iPhone 6 of the beta tester.

Here is the XS information:
=== Xamarin Studio ===

Version 5.10.2 (build 56)
Installation UUID: 0eeecbe7-3390-4572-8505-59100d825f7e
	Mono 4.2.2 (explicit/996df3c)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 402020030

=== Xamarin.Profiler ===

Not Installed

=== Apple Developer Tools ===

Xcode 7.2.1 (9548.1)
Build 7C1002

=== Xamarin.Mac ===

Version: (Starter Edition)

=== Xamarin.iOS ===

Version: (Trial Edition)
Hash: 962a050
Branch: master
Build date: 2016-01-29 16:59:11-0500

=== Xamarin.Android ===

Version: (Indie Edition)
Android SDK: /Users/Jayden 1/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.0.3 (API level 15)
		4.4   (API level 19)
		5.0   (API level 21)
		5.1   (API level 22)
		6.0   (API level 23)

SDK Tools Version: 24.4.1
SDK Platform Tools Version: 23.0.1
SDK Build Tools Version: 23.0.1

Java SDK: /usr
java version "1.8.0_20"
Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)

=== Xamarin Android Player ===

Version: 0.6.5
Location: /Applications/Xamarin Android Player.app

=== Xamarin Inspector ===

Hash: 0bbef0d
Branch: master
Build date: Thu Dec 24 17:34:23 UTC 2015

=== Build Information ===

Release ID: 510020056
Git revision: bb74ff467c62ded42b7b7ac7fdd2edc60f8647b0
Build date: 2016-01-26 16:24:41-05
Xamarin addins: 8b797d7ba24d5abab226c2cf9fda77f666263f1b
Build lane: monodevelop-lion-cycle6-c6sr1

=== Operating System ===

Mac OS X 10.11.3
Darwin Jaydens-iMac.local 15.3.0 Darwin Kernel Version 15.3.0
    Thu Dec 10 18:40:58 PST 2015
    root:xnu-3248.30.4~1/RELEASE_X86_64 x86_64

So does Dont Link produce bigger bundles? 

Addressing point 3 - I would have to get authorisation to provide part of it as there is quite a bit of proprietary algorithms and classes within. What I can do is provide at this time the AppDelegate and LoginViewController (where the app seems to be getting upto).

Please let me know if I can provide any more info at this time.
Comment 3 Jayden Spring 2016-03-04 21:23:55 UTC
Created attachment 15273 [details]
Comment 4 Jayden Spring 2016-03-04 21:24:19 UTC
Created attachment 15274 [details]
Comment 5 Sebastien Pouliot 2016-03-09 20:08:49 UTC
Sadly this is not enough to duplicate the problem on our side. We'll need a self-contained test case (e.g. subset of the application) that can reproduce the issue.

Note that the fact that it works on some phone models and not others generally means it's not a linker issue (all models would suffer the same issue if some required code was missing).

In such cases it's commonly a timing issue, e.g. something get GC'ed, and the speed of the device and the code generation (which changes a lot of the linker is enabled or not) that makes it more (or less) likely to crash on some models.

That would also make more sense wrt to the attached crash report, which happens at de-allocation time. Still finding the issue (most likely in your code than in the SDK) requires us to be able to duplicate the issue.

You can contact support (see yellow banner on top of the web page) to get a NDA between your company and Xamarin.
Comment 6 Sebastien Pouliot 2016-04-12 17:56:47 UTC
We have not received further information and will assume this is not an issue anymore. If you can still affected by this please re-open the bug and include the requested information. Thanks.