Bug 20552 - Calling ToString on integer throws an System.AggregateException (French locale)
Summary: Calling ToString on integer throws an System.AggregateException (French locale)
Status: VERIFIED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 4.12.4
Hardware: PC Mac OS
: High normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2014-06-12 11:56 UTC by Prashant Cholachagudda
Modified: 2014-06-12 14:21 UTC (History)
2 users (show)

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


Attachments
AndroidApplication3.zip (17.16 KB, application/zip)
2014-06-12 13:55 UTC, Jonathan Pryor
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:
VERIFIED FIXED

Description Prashant Cholachagudda 2014-06-12 11:56:35 UTC
Calling ToString on an integer throws an System.AggregateException when used within Parallel.For

Steps:

- Set the device locale to French (fr)
- Add the below code in main activity's `OnCreate` method
  `Parallel.For(0, 5000, i => variable.ToString("0.0", CultureInfo.CurrentCulture));`
- Run the project
Comment 1 Ram Chandra 2014-06-12 12:45:24 UTC
I tried this issue and with the help of bug description I am able to reproduce this issue.

Steps to reproduce:

1. Create an "Android Application" on XS.
2. Paste the following code on "OnCreate" method of "MainActivity.cs" file

            var currentCulture = CultureInfo.CurrentCulture;
            var variable = 10;
            Parallel.For(0, 5000, i => variable.ToString("0.0",currentCulture));

3. Deploy the application.
4. Exception will occur.

I observed that when I write the following code I am also getting "System.AggregateException" on my current culture i.e "en-IN"
            var currentCulture = CultureInfo.CurrentCulture;
            var variable = 10;
            Parallel.For(0, 5000, i => variable.ToString("0.0",currentCulture));

I also observed that when I convert int variable to string outside the "Parallel.For()" I am not getting "System.AggregateException".

Screencast: http://www.screencast.com/t/i7HlZWyYxi

Regression Status: This issue does not exits on  stable build(XA 4.12.3.3)

Environment Info:

Xamarin Studio
Version 5.0 (build 878)
Installation UUID: 6ea47b0d-1852-4aaf-808d-373ff0a5002b
Runtime:
	Mono 3.4.0 ((no/63569a7)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 304000205

Xamarin.Android
Version: 4.12.4 (Trial Edition)
Android SDK: /Users/jatin66/Desktop/Backup/android-sdk-macosx
	Supported Android versions:
		1.6   (API level 4)
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		3.2   (API level 13)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
		4.3   (API level 18)
		4.4   (API level 19)
Java SDK: /usr
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)

Apple Developer Tools
Xcode 5.1 (5084)
Build 5B130a

Xamarin.iOS
Version: 7.2.3.39 (Trial Edition)
Hash: fc6f56b
Branch: 
Build date: 2014-05-19 19:10:29-0400

Xamarin.Mac
Xamarin.Mac: 1.8.0.8

Build Information
Release ID: 500000878
Git revision: bcd66920d963483e7d638a2339c4022fe035b529
Build date: 2014-05-27 17:36:26-04
Xamarin addins: da9064ce55b0fa90930a7c437a4cc1ae0e5c778c

Operating System
Mac OS X 10.9.2
Darwin Jatin66s-iMac.local 13.1.0 Darwin Kernel Version 13.1.0
    Thu Jan 16 19:40:37 PST 2014
    root:xnu-2422.90.20~2/RELEASE_X86_64 x86_64
Comment 2 Jonathan Pryor 2014-06-12 13:55:18 UTC
Created attachment 7054 [details]
AndroidApplication3.zip

Test case.
Comment 4 Jonathan Pryor 2014-06-12 13:56:22 UTC
Ram: Please re-test on 4.14. It appeared to work for me on master.
Comment 5 Ram Chandra 2014-06-12 14:21:02 UTC
I have checked this issue on following build:

Mac OS X 10.8.4
Xamarin Studio: 5.1 (build 460)
Xamarin.Android: 4.14.0 

Build Information 
Release ID: 501000460
Git revision: bc17bce73e31bd942f6c177f961c2829de69c326
Build date: 2014-06-11 16:43:24-04
Xamarin addins: 3df9673bc634c099bc9ab33aad12dbf9d82669af

Screencast: http://screencast.com/t/Oar5air8

This issue has been fixed. Hence I am closing this issue