Bug 584 - Runs on Emulator, crashes and burns on device.
Summary: Runs on Emulator, crashes and burns on device.
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 4.x
Hardware: Macintosh Mac OS
: Highest critical
Target Milestone: Untriaged
Assignee: Sebastien Pouliot
URL: https://skydrive.live.com/redir.aspx?...
Depends on: 664
  Show dependency tree
Reported: 2011-09-01 09:15 UTC by joe longo
Modified: 2012-01-04 11:01 UTC (History)
3 users (show)

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

requested crash logs (11.30 KB, application/x-zip-compressed)
2011-09-06 10:28 UTC, joe longo

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 joe longo 2011-09-01 09:15:14 UTC
I have a set of code that works well on emulator. Crashes and burns on Device. Can't even debug it once the Sterling libraries are involved. Please help. I have included a link to download a sample code block demonstrating the issue. 

If built with "-nolink" option, can get it to start and run once on device(sometimes), then it dies on second pass. (BTW, Mono has some sort of bug that makes setting -nolink kind of iffy, need to verify in build log that setting was used)

I am using a ATT iPhone 4, and MonoTouch 4.0.6

Attached app use:
hitting the Test button after loading and seeing data (time stamp+ 02begin) not an error/stack trace; repeat
Comment 1 Sebastien Pouliot 2011-09-01 09:43:25 UTC
> I have included a link to download

there's no link

> Attached app use:

there's no attachment

> BTW, Mono has some sort of bug that makes setting -nolink kind of iffy, need to verify in build log that setting was used

Please fill a MonoDevelop bug (iPhone Addin) about this. The only issue I had myself is with my apple "magic mouse" where I sometime scroll comboboxes (without meaning to) when using the mouse.
Comment 3 Sebastien Pouliot 2011-09-01 17:22:14 UTC
I cannot reproduce this using MonoTouch 4.1.x on my iPad1. My build was made with "Link SDK assemblies" (defaut in your solution). 

Could you please attach:
* the "Application Output" from MD, i.e. the exception / crash you get;
* the console logs (e.g. run "/Developer/MonoTouch/usr/bin/mtouch --logdev" in a terminal window, run/crash your app on your device, then copy/paste the logs from the terminal).

I'll rebuild with "Don't link" (and without some debugging code I have enabled) just to be sure.
Comment 4 joe longo 2011-09-06 10:12:58 UTC
Can u try it on a AT&T iPhone 4?
What version of mono are u using?
Did you hit the test button multiple times?
Comment 5 joe longo 2011-09-06 10:28:56 UTC
Created attachment 255 [details]
requested crash logs
Comment 6 Sebastien Pouliot 2011-09-06 10:59:26 UTC
Thanks for the logs. I'll be reviewing them asap.

> Can u try it on a AT&T iPhone 4?

I can't, but other people can, if this cannot be duplicate on my hardware.

> What version of mono are u using?

The version of Mono does not matter. I used MonoTouch 4.1.x but I can switch to anything now that I have a "crash" baseline to compare with.

> Did you hit the test button multiple times?

yes, several times
Comment 7 joe longo 2011-09-07 09:00:38 UTC
How do you switch between various versions of Mono ?
Comment 8 Sebastien Pouliot 2011-09-07 09:17:37 UTC
Mono or MonoTouch ?

If you already have several Mono versions installed you can change the "Current" symlink to point to another version.

l /Library/Frameworks/Mono.framework/Versions/
total 8
drwxrwxr-x  12 root  admin  408  1 Aug 11:08 2.10.2
drwxrwxr-x  12 root  admin  408  9 Aug 12:16 2.10.4
drwxrwxr-x  12 root  admin  408 24 Aug 11:35 2.10.5
lrwxr-xr-x   1 root  admin    6 25 Aug 08:32 Current -> 2.10.5

For MonoTouch you need to (re)install the version you wish to use (you can likely renamed /Developer/MonoTouch to something else prior to re-installing and then manually switch them).
Comment 9 joe longo 2011-09-07 09:46:04 UTC
what specific version of Mono Framework are you using ?
what specific version of Mono Touch are you using ?
what specific version of Mono Develop are you using ? (does this impact anything)

I am trying to reproduce you environment.

I have removed the MonoDevelop bundle.
I have deleted the Mono.Framework folder.
I have deleted the MonoTouch folder.

I am preparing to reinstall.
Comment 10 Sebastien Pouliot 2011-09-07 10:27:07 UTC
> what specific version of Mono Framework are you using ?

2.10.5 but, as I said in comment #4, that won't affect your MonoTouch application running on the device.

> what specific version of Mono Touch are you using ?

Previous results were done with 'master' (unreleased) but it's quite close to the beta release available.

> what specific version of Mono Develop are you using ? (does this impact
> anything)

It can impact debugging. I'm having a hard time using the debugger reliably using 2.6, it inconsistently allow me to step inside "Model.Configuration.Factory ()" or set breakpoints outside the main assembly. I do get a lot of:

Mono.Debugger.Soft.AbsentInformationException: Debug information is not available for this frame.

like you have in your own logs.

> I am trying to reproduce you environment.

The closest you can get is to use the latest 4.1 beta release available, MD 2.6 (RC) running Mono 2.10.5. MonoTouch 4.1.x includes some generic-related fixes (and your stacktrace points to code using generics) and that could be why it works for me - but it does not explains other things I've seen.

* Using "Link SDK assemblies" I get the same behavior on both the device and the simulator, i.e. a new timestamp + "02begin" each time I click on "Test Mono".


* Using "Don't link" I get the following exception on the device, but it works fine on the simulator. Sadly my breakpoints on that code are never triggered and I can't step down into it. I'll update to a newer (internal) build of 2.6 to see if this is resolved and, if not, open a bug report for MonoDevelop.

Wintellect.Sterling.Exceptions.SterlingActivationException: The operation Activate() is not allowed. A Sterling engine is already active for this application. You must dispose the engine before activating a new one.
  at Wintellect.Sterling.Database.SterlingDatabase.Activate () [0x0001b] in /Users/sebastienpouliot/Downloads/MonoTouch Sterling Crash/Common/Wintellect.Sterling/Wintellect.Sterling/Database/SterlingDatabase.cs:340 
  at Wintellect.Sterling.SterlingEngine.Activate () [0x00000] in /Users/sebastienpouliot/Downloads/MonoTouch Sterling Crash/Common/Wintellect.Sterling/Wintellect.Sterling/SterlingEngine.cs:31 
  at Model.Database.DatabaseWrapper.StartUp () [0x0000a] in /Users/sebastienpouliot/Downloads/MonoTouch Sterling Crash/Common/Model/Sterling/DatabaseWrapper.cs:31 
  at Model.Database.DatabaseWrapper.AppDatabaseInstance () [0x0000a] in /Users/sebastienpouliot/Downloads/MonoTouch Sterling Crash/Common/Model/Sterling/DatabaseWrapper.cs:53 
  at Model.Configuration.Save () [0x00011] in /Users/sebastienpouliot/Downloads/MonoTouch Sterling Crash/Common/Model/Configuration.cs:145 
  at Model.Configuration.Factory () [0x00282] in /Users/sebastienpouliot/Downloads/MonoTouch Sterling Crash/Common/Model/Configuration.cs:123 
  at Wintellect.Sterling.Test.AppDelegate.HandleButton1Clicked (System.Object sender, System.EventArgs e) [0x00000] in /Users/sebastienpouliot/Downloads/MonoTouch Sterling Crash/iOS/Wintellect.Sterling.Test/Main.cs:38
Comment 11 joe longo 2011-09-07 10:48:50 UTC
Check to make sure EmitDebug is set in the Model project for the device.
I think that will make the debugger work.
Comment 12 Sebastien Pouliot 2011-09-07 11:05:11 UTC
Thanks, but I had already noticed that "Emit Debugging Information" was not checked (and I turned it on). There's still something else not working reliably wrt the debugger. I suspected it could have file path issues because all files are not really inside the project (linked) - but, sometime, I can step a bit into it.
Comment 13 Sebastien Pouliot 2011-09-07 11:58:35 UTC
Debugging issue filled as http://bugzilla.xamarin.com/show_bug.cgi?id=664
Comment 14 Sebastien Pouliot 2011-09-07 14:21:17 UTC
I've tested against what will (likely) be 4.2 and got the same (working) result (but the same debugging weirdness). Please let me know how this turns out on your side.
Comment 15 Sebastien Pouliot 2011-09-07 15:08:46 UTC
confirmed to be working in in bug #667 description
Comment 16 Ethan Chang 2012-01-04 11:01:22 UTC
fixed current version