Bug 13005 - ios samples throws Exception with Linker option: Don't Link on device
Summary: ios samples throws Exception with Linker option: Don't Link on device
Alias: None
Product: iOS
Classification: Xamarin
Component: Samples ()
Version: 6.3.x
Hardware: PC Mac OS
: --- blocker
Target Milestone: 6.4 (async)
Assignee: Zoltan Varga
Depends on:
Reported: 2013-07-02 07:45 UTC by Atin
Modified: 2013-07-04 05:15 UTC (History)
4 users (show)

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:

Description Atin 2013-07-02 07:45:44 UTC
Steps to reproduce:
1. Open X.S
2. Create or open any ios application.
3. Select Linker option Don't Link

Actual result:
Application throwing exception with linker option Don't Link on ios device. However its working fine with linker options Link all and Link Sdk assemblies only.

ios device log: https://gist.github.com/atin360/56c664531e33ad65cff0

Expected result:
Application should run successfully on device.

Environment details:
All mac
XS 4.0.9(build 12)
Mono 3.0.12
Device info: iphone4s V 5.1.1

Regression status: REGRESSION working fine with MT
Comment 1 Rolf Bjarne Kvinge [MSFT] 2013-07-02 11:17:52 UTC
The crash goes away if I disable generic value sharing.

Zoltan, can you have a look?

Here is a crash report: https://gist.github.com/rolfbjarne/49aa7080c0fe63726c75
Comment 2 Zoltan Varga 2013-07-02 12:15:23 UTC
This is another clang problem, it works with --compiler:gcc.
Comment 3 Zoltan Varga 2013-07-02 12:43:40 UTC
This seems to be the usual 'the app is too big' problem, clang seems to hit it earlier that gcc.
We generate:
bl _ves_icall_MonoType_get_Assembly
Which is assembled/linked to:
0x927150 <wrapper_managed_to_native_System_MonoType_get_Assembly_System_MonoType+96>:	blx	0x871f50 <ves_icall_MonoType_get_Assembly.island>

0x871f50 <ves_icall_MonoType_get_Assembly.island>:	b.w 0xffa07244
and 0xffa07244 is a random address
Comment 4 Zoltan Varga 2013-07-02 13:10:27 UTC
Added a workaround in 7c4e0f438ec5a87f5f2693465dfe26733abcd08b.
Comment 5 narayanp 2013-07-04 05:15:32 UTC
Today we have checked this issue with following builds:

X.S 4.0.9 (build 12)
Mono 3.0.12
Xamarin.iOS 6.3.7-164

We are successfully able to deploy and launch application on physical device after selecting Linker behavior as Don't link.

Changing the status to Verified.