1. 29 3月, 2022 28 次提交
  2. 28 3月, 2022 8 次提交
  3. 27 3月, 2022 3 次提交
  4. 26 3月, 2022 1 次提交
    • T
      Fix race condition in loading assemblies with composite native images (#67000) · a2448b02
      Tomáš Rylek 提交于
      I originally hit this bug when testing my Crossgen2 perf optimization
      change involving only registering composite code range once but I
      managed to disprove the bug was caused by this change. Indeed, it
      was caused by my earlier change improving component assembly caching.
      
      In my overzealous attempt to make sure the assembly gets always
      registered I added a new method NativeImage::AddComponentAssemblyToCache
      that registered the assembly which had triggered the native image load
      in the first place. This was incorrect, by that point the assembly
      wasn't yet fully initialized and putting it in the cache made it
      visible to other threads that subsequently crashed trying to access
      the assembly before it was fully loaded.
      
      Furthermore it was unnecessary, once the assembly gets loaded, it
      gets stored in the cache via the call to
      SetNativeMetadataAssemblyRefInCache from ZapSig::DecodeModuleFromIndex.
      Before the fix I was able to repro the bug locally typically after
      about 500 iterations of the thread14 unit test, with the fix I was
      unable to repro after 4500 iterations.
      
      Thanks
      
      Tomas
      
      Fixes: https://github.com/dotnet/runtime/issues/66954
      Probably also fixes: https://github.com/dotnet/runtime/issues/66210
      a2448b02