Bug 59916 - get_current_locale_name fails under the load with String conversion error: Illegal byte sequence encounted in the input
Summary: get_current_locale_name fails under the load with String conversion error: Il...
Status: NEW
Alias: None
Product: Runtime
Classification: Mono
Component: General (show other bugs)
Version: master
Hardware: PC Mac OS
: --- major
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-10-03 13:28 UTC by Marek Safar
Modified: 2017-10-03 13:28 UTC (History)
2 users (show)

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


Attachments

Description Marek Safar 2017-10-03 13:28:38 UTC
Using following repro (The repro was extracted from various failing builds on Jenkins and Wrench)

using System.Threading;

class X
{
	public static void Main ()
	{
		string res;
		var range = new Thread [10];
		for (int i = 0; i < range.Length; ++i) {
			range[i] = new Thread (l => {
				Thread.Sleep (20 - i);
				res = 1.ToString ();
			});
		}

		foreach (var r in range)
			r.Start ();

		foreach (var r in range)
			r.Join ();
	}
}

Running this in the loop I get occasional crash

System.ExecutionEngineException: String conversion error: Illegal byte sequence encounted in the input.
  at (wrapper managed-to-native) System.Globalization.CultureInfo.get_current_locale_name()
  at System.Globalization.CultureInfo.ConstructCurrentCulture () [0x0000d] in <57d3528b6e84429aa5b942ad54e87ba8>:0
  at System.Globalization.CultureInfo.get_UserDefaultCulture () [0x00000] in <57d3528b6e84429aa5b942ad54e87ba8>:0
  at System.Threading.Thread.GetCurrentCultureNoAppX () [0x00010] in <57d3528b6e84429aa5b942ad54e87ba8>:0
  at System.Threading.Thread.get_CurrentCulture () [0x00000] in <57d3528b6e84429aa5b942ad54e87ba8>:0
  at System.Globalization.NumberFormatInfo.get_CurrentInfo () [0x00005] in <57d3528b6e84429aa5b942ad54e87ba8>:0
  at System.Int32.ToString () [0x00000] in <57d3528b6e84429aa5b942ad54e87ba8>:0

Note You need to log in before you can comment on or make changes to this bug.