Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NativeAOT] Object synchronization method was called from an unsynchronized block of code. #104340

Open
jkotas opened this issue Jul 3, 2024 · 4 comments
Labels
area-NativeAOT-coreclr Known Build Error Use this to report build issues in the .NET Helix tab
Milestone

Comments

@jkotas
Copy link
Member

jkotas commented Jul 3, 2024

Intermittent Object synchronization method was called from an unsynchronized block of code. exceptions.

Known Issue Error Message

Fill the error message using step by step known issues guidance.

{
  "ErrorMessage": "Object synchronization method was called from an unsynchronized block of code.",
  "ErrorPattern": "",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Known issue validation

Build: 🔎
Result validation: ⚠️ Validation could not be done without an Azure DevOps build URL on the issue. Please add it to the "Build: 🔎" line.
Validation performed at: 7/3/2024 2:40:39 AM UTC

Report

Build Definition Step Name Console log Pull Request
735305 dotnet/runtime Build Tests Log #103735
735014 dotnet/runtime Build Tests Log #104603
733925 dotnet/runtime Build Tests Log #104445
732512 dotnet/runtime Build Tests Log #104534
730825 dotnet/runtime Build Tests Log #104440
729981 dotnet/runtime Build Tests Log #101580
729766 dotnet/runtime Build Tests Log #104379
728548 dotnet/runtime Build Tests Log #104332

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
2 7 8
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Jul 3, 2024
Copy link
Contributor

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

@jkotas
Copy link
Member Author

jkotas commented Jul 3, 2024

Hit in #104202. Log https://helixre8s23ayyeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-104202-merge-fe38091c4b294deca8/System.Threading.Channels.Tests/1/console.5ad789fe.log?helixlogtype=result :

[FAIL] System.Threading.Channels.Tests.UnboundedPrioritizedChannelTests.ManyProducerConsumer_ConcurrentReadWrite_Success(numReaders: 1, numWriters: 10)
System.AggregateException : One or more errors occurred. (Object synchronization method was called from an unsynchronized block of code.)
---- System.Threading.SynchronizationLockException : Object synchronization method was called from an unsynchronized block of code.
   at System.Threading.Tasks.Task.WaitAllCore(ReadOnlySpan`1, Int32, CancellationToken) + 0x304
   at System.Threading.Tasks.Task.WaitAll(Task[]) + 0x54
   at System.Threading.Channels.Tests.ChannelTestBase.ManyProducerConsumer_ConcurrentReadWrite_Success(Int32 numReaders, Int32 numWriters) + 0x16c
   at System.Threading.Channels!<BaseAddress>+0xaa3254

@jkotas jkotas added the Known Build Error Use this to report build issues in the .NET Helix tab label Jul 3, 2024
@jkotas
Copy link
Member Author

jkotas commented Jul 3, 2024

Hit in #104332. Log https://dev.azure.com/dnceng-public/public/_build/results?buildId=728548&view=logs&j=eb3d96e8-a17f-53b1-ecea-be64723f4b14&t=d8e271dd-8628-5dad-a374-176afa32935b&l=673 :

    Generating native code
    Generating native code
    Unhandled exception: System.AggregateException: One or more errors occurred. (Object synchronization method was called from an unsynchronized block of code.)
     ---> System.Threading.SynchronizationLockException: Object synchronization method was called from an unsynchronized block of code.
       at System.Threading.ObjectHeader.Release(Object) + 0x14a
       at System.Threading.Monitor.Exit(Object) + 0x17
       at System.Resources.ResourceReader.GetValueForNameIndex(Int32) + 0x253
       at System.Resources.ResourceReader.ResourceEnumerator.get_Value() + 0xdd
       at ILCompiler.SubstitutionProvider.AssemblyFeatureInfo..ctor(EcmaModule, Logger, IReadOnlyDictionary`2, BodyAndFieldSubstitutions) + 0x5eb
       at ILCompiler.SubstitutionProvider.FeatureSwitchHashtable.CreateValueFromKey(EcmaModule) + 0x5a
       at Internal.TypeSystem.LockFreeReaderHashtable`2.CreateValueAndEnsureValueIsInTable(TKey) + 0x3b
       at Internal.TypeSystem.LockFreeReaderHashtable`2.GetOrCreateValue(TKey) + 0x62
       at ILCompiler.SubstitutionProvider.GetSubstitution(MethodDesc) + 0xaa
       at ILCompiler.SubstitutedILProvider.GetMethodIL(MethodDesc) + 0x67
       at ILCompiler.Compilation.CombinedILProvider.GetMethodIL(MethodDesc) + 0x4f
       at ILCompiler.Compilation.ILCache.CreateValueFromKey(MethodDesc) + 0x6a

@agocke agocke added this to the 9.0.0 milestone Jul 8, 2024
@agocke agocke removed the untriaged New issue has not been triaged by the area owner label Jul 8, 2024
@MichalStrehovsky
Copy link
Member

I think the failure in ILC.exe started happening after #103574 (this is ILC-compiled ILC, using the LKG ILC), so that narrows it down to like two weeks worth of commits -_-

ILC.exe failures don't have crashdumps because of infra limitations and neither does the libraries test failure (again because of infra design).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-NativeAOT-coreclr Known Build Error Use this to report build issues in the .NET Helix tab
Projects
Status: No status
Development

No branches or pull requests

3 participants