Bug 12741 - new Random() throws IndexOutOfRangeException on device when compiled to Armv7s and run on a device
Summary: new Random() throws IndexOutOfRangeException on device when compiled to Armv7...
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 6.3.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Zoltan Varga
URL:
Depends on:
Blocks:
 
Reported: 2013-06-18 14:59 UTC by Josh
Modified: 2013-06-22 08:00 UTC (History)
4 users (show)

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


Attachments
This sample app is a standard single view iOS app. I added Random r = new Random(); into the AppDelegate FinishedLaunching method to show the exception. (4.08 KB, application/x-gzip)
2013-06-18 14:59 UTC, Josh
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 FIXED

Description Josh 2013-06-18 14:59:59 UTC
Created attachment 4144 [details]
This sample app is a standard single view iOS app. I added Random r = new Random();  into the AppDelegate FinishedLaunching method to show the exception.

I just upgraded Xamarin studio's beta channel with the update that came out today. I'm running Xamarin Studio 4.1.4 (build 117), Xamarin.iOS 6.3.6.77. If I set my iOS Build->Advanced settings to support the ARMv7s architecture I get a crash anytime I new up a new System.Random() object on my iPhone 5, running iOS 7 beta 1. I have pointed Xamarin Studio's iOS SDK Location to Xcode-DP5.app. Incidentally this same problem occurs on the Alpha channel.

This works fine if it is built with ARMv7 or run on the simulator.

I have attached a sample project that illustrates the problem.

Thanks,

Josh
Comment 1 Rolf Bjarne Kvinge [MSFT] 2013-06-21 21:03:34 UTC
Zoltan, I can reproduce this only with armv7s, looks like we're generating different code for armv7s than for armv7.
Comment 2 Zoltan Varga 2013-06-22 08:00:26 UTC
Fixed in master-3.0.