Bug 1686 - Project crashes on startup but works only sometimes. Very inconsistent.
Summary: Project crashes on startup but works only sometimes. Very inconsistent.
Status: RESOLVED DUPLICATE of bug 707
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 5.0
Hardware: Macintosh Mac OS
: --- blocker
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2011-10-25 19:48 UTC by Andrew Young
Modified: 2011-10-27 03:24 UTC (History)
3 users (show)

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


Attachments
Crash report. (66.38 KB, application/octet-stream)
2011-10-25 19:48 UTC, Andrew Young
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 DUPLICATE of bug 707

Description Andrew Young 2011-10-25 19:48:10 UTC
Created attachment 767 [details]
Crash report.

I've got an app that runs fine when using the traditional compiler but crashes on startup when using LLVM. Is this a bug in the LLVM compiler?

See attachment for crash report. The stacktrace seems to imply that there's an infinite loop going on as I see the same lines over and over again.
Comment 1 Andrew Young 2011-10-25 20:17:23 UTC
After more testing it just seems like it is very inconsistent. Sometimes it will work with the LLVM compiler but only when compiling for armv6+armv7. Other times the traditional compiler won't work. Setting the -nosymbolstrip -nostrip flags got it to work once but most of the time it just crashes on the device. I don't know if any of the settings I'm playing around with are relevant to why it is crashing but I'm just providing this for information. This is pretty much blocking us from making a production release right now.
Comment 2 Andrew Young 2011-10-25 20:21:36 UTC
MonoTouch version 5.0.1318434274
Comment 3 Rolf Bjarne Kvinge [MSFT] 2011-10-26 06:51:59 UTC
It looks like you have external libraries compiled with thumb enabled. External libraries can't have thumb code, it will fail in every imaginable and unimaginable way. For more information see bug #707.

You can also try changing the linking options for your project to see if anything changes (in particular disabling linking tends to make issues more consistent).
Comment 4 Andrew Young 2011-10-26 12:53:46 UTC
According to MT's compilation docs THUMB is supported when using the LLVM compiler. http://docs.xamarin.com/ios/advanced_topics/compilation

You are right. We have a native library that is built with THUMB enabled, TestFlight's SDK. However, we have made a number of production releases with that library without a hitch. All of a sudden, this started happening yesterday. I'd say 1 out of 10 builds results in an app that does not crash on startup.
Comment 5 Rolf Bjarne Kvinge [MSFT] 2011-10-26 16:33:14 UTC
We support compiling the managed assemblies to thumb, which is different from linking in external libraries compiled for thumb. This is not our limitiation, but a bug in Apple's linker:

http://docs.xamarin.com/ios/troubleshooting#Assertion_at_...2f...2f...2f...2fmono.2fmetadata.2fgeneric-sharing.c.3a704.2c_condition_.60oti'_not_met

From what I've experienced whether you run into the bug or not may depend on exactly what is removed by the linker - iow you may change code in your application which causes the linker to remove more/less from the final binary.

*** This bug has been marked as a duplicate of bug 707 ***
Comment 6 Andrew Young 2011-10-26 16:43:56 UTC
Ah. I get it now. Does this mean that TestFlight's SDK just won't work unless they comply to our request to build w/o thumb?

Also, what would this mean for the TestFlight bindings found on monotouch's github? https://github.com/mono/monotouch-bindings/tree/master/TestFlight

I would assume that no one can successfully bind to TestFlight's SDK if this is the case.
Comment 7 Rolf Bjarne Kvinge [MSFT] 2011-10-27 03:24:20 UTC
Most people don't run into this issue, which is why it usually works.

In any case you're right, our TestFlight bindings are broken in this respect, they may or may not work (most people, including us, don't check if a native library has thumb instructions before using it).