Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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
GitHub or Developer Community 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.
Created attachment 7523 [details]
Unexpected values and crashes when using Double.ToString("R", CultureInfo.InvariantCulture) in a multithreaded program. I was unable to reproduce the issue on Microsoft .NET, or Mono for Mac (x86, amd64), or using a single thread program. Please note that -as you would expect- the program output below varies from execution to execution (there's always an exception, though). I'm afraid I don't have more insight on why this occurs. Attaching a test case. Compile using mcs test.cs.
Mono JIT compiler version 3.4.0 (tarball Fri Apr 11 22:43:17 UTC 2014)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
LLVM: supported, not enabled.
0.0000000000000000 != 1.23456789
System.FormatException: Unknown char
at System.Double.Parse (System.String s, NumberStyles style, IFormatProvider provider) [0x00000] in <filename unknown>:0
at System.Double.Parse (System.String s, IFormatProvider provider) [0x00000] in <filename unknown>:0
at System.NumberFormatter.FormatRoundtrip (Double origval, System.Globalization.NumberFormatInfo nfi) [0x00000] in <filename unknown>:0
at System.NumberFormatter.NumberToString (System.String format, Double value, IFormatProvider fp) [0x00000] in <filename unknown>:0
at System.Double.ToString (System.String format, IFormatProvider provider) [0x00000] in <filename unknown>:0
at Repro.Program.ThreadProc (System.Object state) [0x00000] in <filename unknown>:0
The bug doesn't exist anymore on git, so it should work OK on release 3.6.x.
Thanks JC. Duplicate of #18599
*** This bug has been marked as a duplicate of bug 18599 ***