Bug 20142 - Index out of range exception when background activation check runs
Summary: Index out of range exception when background activation check runs
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 4.14.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Jonathan Pryor
Depends on:
Reported: 2014-05-29 11:21 UTC by PJ
Modified: 2014-07-23 18:24 UTC (History)
3 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 PJ 2014-05-29 11:21:49 UTC
After leaving XS running for several hours, this error appeared:


This occurred again several hours later. I came back to it this morning and 2 instances of the error dialog appeared.

I then got into a state where I could reproduce just by opening the Account dialog: http://screencast.com/t/qpxbr8c5vB

This state was cleared by restarting XS.

It seems to be that we're failing in https://github.com/xamarin/activation/blob/master/src/utils/activation.cs#L269 

systemProfileXml is the output of:

> /usr/sbin/system_profiler -xml SPHardwareDataType SPNetworkLocationDataType SPSoftwareDataType > o.xml

Here's the discussion from IRC:

and potentially system_profiler output varies over time?
jonp: indeed it does
jonp: just ran it twice, w/ ~3s between them, and the output differs
jonp: usually in time-based ways
rolf: looks like system_profiler -xml didn't write valid xml
jonp: which seems rather odd
jonp: and not what i'd expect of that stack trace
jonp: what's NameTable.Add() do...?
rolf: if XmlDocument.LoadXml fails, then my first assumption would be that the xml input is not valid xml
jonp: which would be a fair assumption... ;-)
rolf: iirc there's also some dtd validation that requires network access, so if the network was flaky / returned bad results, then that might have influenced the parsing as well
jonp: that's probably it; it's in XmlTextReader.GenerateDTDObjectModel
jonp: so it hasn't even gotten to the system_profiler document text yet, it's still doing DTD-related stuff
jonp: presumably parsing http://www.apple.com/DTDs/PropertyList-1.0.dtd
jonp: pjbearman: and you're in a place with a flakey network connection... ;-)

The discussion continued and JonP thinks it might be due to running out of file handles, and then he pointed me at https://bugzilla.xamarin.com/show_bug.cgi?id=10088

Test build:
Git revision: 3efbb96fa3ef47a060d7e77a1a2f42b5237a835d
Build date: 2014-05-27 12:32:55-04
Xamarin addins: da9064ce55b0fa90930a7c437a4cc1ae0e5c778c

Example output from system_profiler for my machine: https://gist.github.com/anonymous/72aefab8334238ad3476

Going to have to leave this one for now, I can come back to this if more information is needed. I can't easily reproduce this after restarting XS, but I'll see if it occurs after several hours again.
Comment 1 PJ 2014-07-23 18:24:36 UTC
I have not seen this since I reported the issue, and this report is less than helpful in its current state.

Resolving as WORKSFORME.