Bug 50434 - Race in cctor initialization
Summary: Race in cctor initialization
Alias: None
Product: Runtime
Classification: Mono
Component: JIT ()
Version: 4.8.0 (C9)
Hardware: PC Mac OS
: --- major
Target Milestone: ---
Assignee: Zoltan Varga
Depends on:
Reported: 2016-12-20 14:33 UTC by Marek Safar
Modified: 2017-02-06 21:49 UTC (History)
4 users (show)

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

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 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.

Related Links:

Description Marek Safar 2016-12-20 14:33:10 UTC
This is when running Roslyn on ARM. It does not happen very often though

Here is the relevant stack trace

error CS1504: Source file '/media/ssd/jenkins/workspace/test-mono-pull-request-armel/mcs/nunit24/NUnitExtensions/core/RowTest/RowTestAddIn.cs' could not be opened -- System.ArgumentNullException: Value cannot be null.
Parameter name: obj
  at (wrapper managed-to-native) System.Object:__icall_wrapper_mono_monitor_enter_v4_internal (object,intptr)
  at System.Security.Cryptography.CryptoConfig.CreateFromName (System.String name, System.Object[] args) [0x00016] in <3ebebd72c4054f9e9b2097fbd808f2b5>:0 
  at System.Security.Cryptography.CryptoConfig.CreateFromName (System.String name) [0x00000] in <3ebebd72c4054f9e9b2097fbd808f2b5>:0 

which makes no sense as the static field is cctor initialized at https://github.com/mono/mono/blob/5148ac7e887f8a9a49f51056ef4e9a44921d025b/mcs/class/corlib/System.Security.Cryptography/CryptoConfig.cs#L287
Comment 1 Marek Safar 2016-12-20 14:48:28 UTC
This is during default build so the mscorlib is AOTed
Comment 2 Rodrigo Kumpera 2017-02-06 19:20:58 UTC
Hey Zoltan,

Didn't you fix this?
Comment 3 Zoltan Varga 2017-02-06 21:49:36 UTC