Bug 28101 - SIGSEGV and SIGBUS crashes with Xamarin.iOS Unified API
Summary: SIGSEGV and SIGBUS crashes with Xamarin.iOS Unified API
Status: RESOLVED INVALID
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: XI 8.8.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-03-17 07:39 UTC by Alexey Bogdanov
Modified: 2015-04-03 09:13 UTC (History)
4 users (show)

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


Attachments
Initial crash (iPhone 4s iOS 7.1) (89.27 KB, application/octet-stream)
2015-03-18 03:45 UTC, Alexey Bogdanov
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 INVALID

Description Alexey Bogdanov 2015-03-17 07:39:26 UTC
We had a project on Classic API. Everything worked fine for both 32 and 64-bit iOS devices.

Then we migrated to Unified API. The application started to crash on some devices (mostly 64-bit devices). It crashes in many different locations and situations. These crashes are hard to predict and reproduce. But a lot of users in production version face this crashes.

Currently we have a version of the app (let's call it Version 1) in production that was build with Xamarin.iOS 8.6 (stable channel) for iOS SDK 8.1.

We have a lot of similar crashes collected with Crittercism (crash reporting service). All crashes are SIGSEGV (reason: SEGV_MAPERR), but may have different stack traces. It looks like some crashes happen only on 64-bit devices.

Then we built another version of the app to reproduce the issue (Version 2). It was built with Xamarin.iOS 8.8 (stable channel) for iOS SDK 8.2 with debug options turned on.

Now we have similar crashes. Most of them happen on background threads (not main UI thread). And now all crashes are SIGBUS (reason: BUS_ADRERR).

It looks like some bug in a MonoTouch runtime.

What can be the root cause of such crashes? How to diagnose and fix it?
Comment 1 Sebastien Pouliot 2015-03-17 08:46:15 UTC
Minimally we need the symbolicated crash reports to see where this happens.

Also make sure you're using the latest version of any crash reporter (e.g. Crittercism). Some of them have proven unstable with ARM64.

The exact version* of the software  you used is also important so we can know exactly what fixes are present (or not) in the software (so we can map the crash report with any already fixed issues).

* 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).
Comment 6 Rolf Bjarne Kvinge [MSFT] 2015-03-17 11:21:22 UTC
Those crash reports have very limited information (so little it doesn't look like the app actually crashed, they look like someone just collected stack traces at random times); are they what Crittercism produces? If so, please disable Crittercism (and any other crash reporting tools you have), and instead use (and attach here) the built-in crash reports iOS generates.
Comment 7 Alexey Bogdanov 2015-03-17 11:37:37 UTC
Yes, they're crash logs from Crittercism.

It looks like building with Xamarin.iOS from Alpha channel solves the problem. At least I cannot reproduce it locally now.

Probably it's solved with this fix:
[sgen] Fixed bug in 64 bit LOS cardtable scanning [#27147]

I see that bug 27147 notes SIGSEGV too, but I cannot see the whole bug content because it's private.

Is it a similar issue?

It's hard to get real crash log, because I cannot reproduce it on my device.
Comment 8 Rolf Bjarne Kvinge [MSFT] 2015-03-17 11:40:16 UTC
Unfortunately there's not enough information from the crash reports to determine whether it could be the same issue or not (but the fact that you can't reproduce any crashes with the alpha channel is a good sign).

For now I'm going to close this as a dup of #27147, feel free to reopen if the crashes still occur.

*** This bug has been marked as a duplicate of bug 27147 ***
Comment 9 Alexey Bogdanov 2015-03-18 03:44:18 UTC
Reproduced the bug on iOS 7.1 simulator. App crashed on the view with UIWebView. And the app now crashes on launch every time after this crash.

Xamarin.iOS (Alpha channel)
Version: 8.8.1.9 (Business Edition)
Hash: 7e1f69e
Branch: 
Build date: 2015-03-12 15:35:49-0400
Comment 10 Alexey Bogdanov 2015-03-18 03:45:08 UTC
Created attachment 10389 [details]
Initial crash (iPhone 4s iOS 7.1)
Comment 15 Rolf Bjarne Kvinge [MSFT] 2015-03-18 08:52:19 UTC
@Alexey, that doesn't look related to the previous crash (this is something related to UIWebView, while the previous crash didn't have anything UIWebView-related on any thread's stack trace).

Can you attach a project we can use to reproduce this crash?
Comment 16 Alexey Bogdanov 2015-04-03 09:13:57 UTC
The crash was caused by Crittercism library.