Bug 484 - App is not creating crash reports when I throw new Exception("")
Summary: App is not creating crash reports when I throw new Exception("")
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 4.x
Hardware: Macintosh Mac OS
: Normal major
Target Milestone: Future Cycle (TBD)
Assignee: Bugzilla
Depends on:
Reported: 2011-08-26 18:36 UTC by Andrew Young
Modified: 2016-02-04 14:27 UTC (History)
8 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 Andrew Young 2011-08-26 18:36:23 UTC
I have an app where I'm hard coding an exception to throw to see if it generates a crash report but it does not generate anything. I then created a stand alone app that where I throw new Exception() and it generates a crash report as expected.

I can give you the app privately if needed since it only does this on the full blown app and not my test app.
Comment 1 Sebastien Pouliot 2011-08-27 11:22:54 UTC
Exceptions are not crashes, i.e. the exception could be swallowed by one of the callers (yours or the BCL). E.g. some classes, like the ThreadPool (iirc), does that.

Assuming there's no 'catch' in your code earlier in the stack, you could try throwing the exception from the main thread ?
Comment 2 Andrew Young 2011-08-27 16:14:16 UTC
I made sure to throw the exception on the main thread. All I did was throw the exception on a button.touchupinside(). There isn't anything in the app that is catching the exception and the app does in fact crash when the button is pressed. Should this generate a crash report? In my stand alone test app it does. So I'm not sure why it's not in he full app.
Comment 3 Sebastien Pouliot 2011-08-27 20:11:22 UTC
Sorry I misread your initial report. 

I don't recall missing crash reports myself (not that I check every one of them ;-). However some of them can be different, e.g. without stack trace in low-memory condition. See:

There could be other reasons too, If so I would expect them to be part of the device logs. You can see them in XCode Organizer or just run:

/Developer/MonoTouch/usr/bin/mtouch --logdev

in a terminal, then start and crash the iOS application on your device. The terminal window should fill with logs (including where is stored, on device, the crash log). Maybe there will be a few hints why no crash report were made.
Comment 4 Andrew Young 2011-08-29 13:41:23 UTC
Looking at the console in XCode Organizer I did find that crash reports are generated when building only for armv6. But when building for armv6 + armv7 there is no crash report.

Normally you would see a line in the console saying something like:
Aug 29 10:33:42 unknown ReportCrash[1378] <Notice>: Formulating crash report for process SaambaaiPhone[1369]

But when building for 6 + 7 there is no such line written and also there is no crash report.

note: using LLVM
Comment 5 Andrew Young 2011-08-29 14:36:15 UTC
The scenario with building for armv6 + armv7 is only happening on my full app. I tested the same settings on my test app and crash reports are generated. So I'm not sure what the diff is.

Another things to throw in the mix here is that on my full app when building only for armv6 the crash reports have their symbols stripped even when I specify "-nostrip -nosymbolstrip" in the extra args.

9   SaambaaiPhone                 	0x008b0f7c 0x1000 + 9109372
10  SaambaaiPhone                 	0x008b1010 0x1000 + 9109520
11  SaambaaiPhone                 	0x0071b3a8 0x1000 + 7447464
12  SaambaaiPhone                 	0x007458f8 0x1000 + 7620856
13  SaambaaiPhone                 	0x00746570 0x1000 + 7624048
14  SaambaaiPhone                 	0x0077056c 0x1000 + 7796076

On the stand alone test app there are symbols. 

8   MemTest                       	0x00221ed6 monoeg_g_logv (goutput.c:133)
9   MemTest                       	0x00221f3e monoeg_assertion_message (goutput.c:154)
10  MemTest                       	0x0013ed84 mono_thread_abort (mini.c:2638)
11  MemTest                       	0x00152ccc mono_handle_exception_internal (mini-exceptions.c:1536)
12  MemTest                       	0x001532a6 mono_handle_exception (mini-exceptions.c:1831)
13  MemTest                       	0x0016bc26 mono_arm_throw_exception (exceptions-arm.c:158)
14  MemTest                       	0x000f55a4 throw_exception + 40

We're trying to get crash reporting working because our app is having lots of random crashes for our testers but our developers can't get any good feedback because crash reporting isn't working that well.
Comment 6 Miguel de Icaza [MSFT] 2011-08-29 16:24:23 UTC
Question: are you linking with a native library and trying to get a crash report while debugging?

There is a bug reported where linking native libraries with MonoTouch and trying to debug at the same time breaks Apple's linker.
Comment 7 Andrew Young 2011-08-29 17:42:08 UTC
We are linking with the facebook iOS SDK which is a native library. But I'm not doing any of this while debugging. I'm simply building, deploying and running the app on the device with the Console open in XCode. Or with mtouch --logdev.
Comment 8 Admin 2011-08-29 18:00:42 UTC
I should have been more specific.

Are you uploading a "Debug" build?   That is what I suspect the problem is.
Comment 9 Andrew Young 2011-08-29 18:22:24 UTC
Yes I was deploying a debug build. But I just tried it with "Enable Debugging" unchecked in the iPhone Build settings and there is no difference. Still no symbols.
Comment 11 PJ 2013-07-09 02:55:14 UTC
Hey Andrew, it looks like you answered all the questions way back when for this bug - sorry we never got to the bottom of it. We're cleaning things up a bit and at this point we might need an update. In the interest of bugzilla sanity, if we can't make forward progress here I will end up marking it as resolved during the next release cycle.

Moving milestone to 6.4.x
Comment 12 PJ 2013-11-19 16:44:52 UTC
This bug was targeted for a past milestone, moving to the next non-hotfix active milestone.
Comment 13 GouriKumari 2016-01-11 18:50:57 UTC
@Andrew: This is an old bug and if you are able to reproduce this issue  with the latest Xamarin.iOS release, please update it with info. I am moving this bug to far future.
Comment 14 Rolf Bjarne Kvinge [MSFT] 2016-02-04 14:27:42 UTC
I can't reproduce this (in fact I've been throwing exceptions to produce crash reports for several years now), so I'm closing it.

If you can reproduce, please attach a complete test solution we can try with as well.