Bug 17137 - KERN_INVALID_ADDRESS at 0x00000000
Summary: KERN_INVALID_ADDRESS at 0x00000000
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: 7.1.0.x
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2014-01-09 04:01 UTC by Andy
Modified: 2014-01-16 06:19 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 Andy 2014-01-09 04:01:14 UTC
Exception Subtype: KERN_INVALID_ADDRESS at 0x00000000

Of course the crash log is longer, but I haven't managed to symbolicate it unfortunately (lost the old app and dsym)

My question is however, since this happens:
- only to a very small minority of users
- immediately after launching the app
- but on those device, it happens every time, even after updating the app, even after reinstalling it, even after reboot

Could it be some faults on how xamarin packaged stuff works at run time, with some devices ?

I've read around that apps realized with other frameworks can give this problem, hence my question.

Comment 1 Atin 2014-01-09 06:29:56 UTC
Today, we have checked this issue with:
XS 4.2.3(build 29)
Xcode 5.0
All mac

We are successfully able to deploy the iOS application on Devices/Simulators. Could you please attach the sample or device info? Which you are using so that we can reproduce this issue.
Comment 2 Andy 2014-01-09 06:48:38 UTC
Please consider that I don't have a way to repro the problem, since I guess 99% of the users don't see this. But I had a few reports in the past of just installed apps crashing only on certain devices. And I think I've read on stack overflow of memory alignment issues (or/ and similar stuff) which could be traced back to some Xamarin versions. 

So at this point what I'm asking is:
- could this be remotely due to xamarin ?
- any way for me to check anything, test anything ?

My XS version is stable 4.2.2 build 2
I'm not in front if the computer, but MT version is stable too. 
Xcode 5

I edit and debug from the PC, but distribution is obviously done on the Mac.
Comment 3 Rolf Bjarne Kvinge [MSFT] 2014-01-09 09:01:00 UTC
There is not enough information about this to determine where the problem is - it could be a problem with Xamarin.iOS, it could be a problem in iOS itself or it could be a problem in your code.

A crash report would help (even if it's not symbolicated, you'd still be able to determine if it was a stack overflow for instance).

It would also help to find out what's special about these users' devices, i.e. does it only happen with a specific iOS version / device / culture / localization / etc?
Comment 4 Andy 2014-01-09 09:27:27 UTC
Yes, I understand. Thanks

I am going through heaps of backups and I might have found the relevant DSYM . I'll attache the crash report here first.
Comment 6 Andy 2014-01-09 09:56:52 UTC
I think I might have been able to symbolicate the most relevant part with atos...

I'll attach the result... it seems to me the cause is the Google Ad Bindings (I got them from Monotouch Bindings github) ?
But I don't understand why it crashes this way...
Comment 10 Rolf Bjarne Kvinge [MSFT] 2014-01-13 08:08:07 UTC
1. I used the attachment from comment 5 and ran it through the symbolicatecrash script from Apple (it's somewhere inside Xcode.app, I usually just run 'find' from a terminal to find it).

2. I believe the Build -> Archive menu option is what you want.
Comment 11 Andy 2014-01-13 08:12:52 UTC
2. What, there's a build->archive in XS too ? :) Great ! (feeling stupid)

1. Ah, OK, not sure I understand it fully, I thought atos was already symbolicating everything possible. 
So the part I symbolicated with atos is only partial to my code, while symbolicating with xcode gets system libraries ? 

Regarding the issue at hand, what I was referring in my previous comment was a situation where linking the admob binding that I got from the mt bindings github crashed right at the start, but only on iOS 6 simulator. 

Thanks again
Comment 12 Rolf Bjarne Kvinge [MSFT] 2014-01-13 08:26:43 UTC
1. atos is a very "basic" command, you need to tell it the dSYMs to use, while symbolicatecrash (and Xcode) will automatically look for the dSYMs (using Spotlight). This is probably the reason for the difference you're seeing.
Comment 13 Andy 2014-01-13 08:54:32 UTC
Great, thanks. 

It's in 


After launching and passing my custom dSYM folder, it gave me the same output as yours. I would have expected to symbolicate those addresses that atos managed to link to Admob. Uhm...
Comment 14 Andy 2014-01-13 09:00:51 UTC
This because the topmost line regarding my app says (in atos):

-[GADCachedFile beginFetchWithCacheBuster:] (in LogicGames) (GADCachedFile.m:166)
Comment 15 Andy 2014-01-13 14:50:41 UTC
Ok here is my reasoning, and why I filed a bug

I couldn't symbolicate the bug report properly with symbolicatecrash, only with atos, don't know why.  
Couldn't it be that storekit returns the state of in app purchase, which removes ads, which in turn in my code fires methods regarding admob ?

I'm asking because apparently admob bindings had serious problems linking, evident on some devices on tests I've done. 

Hence my question regarding XS and how it could link it (or maybe how the bindings work)

Otherwise it's obviously something outside xamarin scope.
Comment 16 Andy 2014-01-13 14:56:05 UTC
I'm also extremely puzzled by the fact that the user says it happens even after reinstalling and with airplane mode on. Cached store info ?
Comment 17 Andy 2014-01-14 06:12:35 UTC
Rolf, I see why I didn't notice the archive command when I looked for it. XS, together with the VS plugin, messed up solution and project configurations (I reported in another bug). So when I chose distribution it was linked to some other non distro config, which didn't have Archive as an option. 

Too many moving parts...
Comment 18 Rolf Bjarne Kvinge [MSFT] 2014-01-14 07:06:11 UTC
You could also ask the user to get the device console output as described here: https://developer.apple.com/library/ios/qa/qa1747/_index.html 

In a separate note it would not surprise me if iOS caches store info. Does it still happen if the user logs out out and/or uses a different Apple ID on his device?
Comment 19 Andy 2014-01-16 06:19:44 UTC
Ok apparently this is not the bug I was referring to - the one which goes away by linking sdk assemblies...I can't find it anymore, it was reported in the forums. 

Although it looked similar and the workaround seemed to work, it's something else, unrelated to Xamarin.