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 10734 [details]
In mono-4.0.0-branch/9236ac4 and master/4fc75b3, CultureInfo.DateTimeFormat will throw a NullReferenceException for the ar-SA culture (only, it seems), if obtained via CultureInfo.GetCultures(CultureTypes.SpecificCultures). This is a regression from 3.12.0.
I don't know if it's relevant that ar-SA is the first culture returned by CultureInfo.GetCultures(CultureTypes.SpecificCultures), probably not. (That's also true in 3.12.0.)
This does not happen with any other culture, including ar-SA returned via CultureInfo.GetCultures(CultureTypes.AllCultures) or CultureInfo.GetCultureInfo("ar-SA").
A simple reproduction is attached. In 4.0.0/master, this prints:
Failed for culture ar-SA
System.NullReferenceException: Object reference not set to an instance of an object
at System.Globalization.DateTimeFormatInfo.get_OptionalCalendars () [0x0000b] in /home/malcolm/mono/mono-git/external/referencesource/mscorlib/system/globalization/datetimeformatinfo.cs:715
at System.Globalization.DateTimeFormatInfo.set_Calendar (System.Globalization.Calendar value) [0x00140] in /home/malcolm/mono/mono-git/external/referencesource/mscorlib/system/globalization/datetimeformatinfo.cs:632
at System.Globalization.DateTimeFormatInfo..ctor (System.Globalization.CultureData cultureData, System.Globalization.Calendar cal) [0x00022] in /home/malcolm/mono/mono-git/external/referencesource/mscorlib/system/globalization/datetimeformatinfo.cs:355
at System.Globalization.CultureInfo.get_DateTimeFormat () [0x0002d] in /home/malcolm/mono/mono-git/mcs/class/corlib/System.Globalization/CultureInfo.cs:542
at Program.Test (System.Globalization.CultureInfo ci) [0x0000a] in /home/malcolm/mono/repro2/Program.cs:27
Fixed in master
I am able to reproduce this issue with latest Mono 126.96.36.199 but this is C5 latest build as we don't have mono in Master dropbox. Here is the screencast to reproduce the issue : http://www.screencast.com/t/EHkkWIvmokZq\
Please provide the Master Mono where we can verify this issue.
I have verified this issue on Master branch Mono 188.8.131.523 and observed that now I am not getting any exception for CultureInfo.GetCultures(CultureTypes.SpecificCultures). Screencast for the same : http://www.screencast.com/t/NOFpmGQpz
Environment Info : https://gist.github.com/Shruti360/4ce6bce69c785afab959
I also checked this issue on C5 Mono and did not face any exception with Mono 184.108.40.206 also. Screencast regarding same : http://www.screencast.com/t/sx6tWgGKZz
Environment Info : https://gist.github.com/Shruti360/3fce96c3932f6faefb56