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

Assertion failed under System.ComponentModel.TypeDescriptor.CheckDefaultProvider #104221

Closed
jkotas opened this issue Jul 1, 2024 · 2 comments · Fixed by #104407
Closed

Assertion failed under System.ComponentModel.TypeDescriptor.CheckDefaultProvider #104221

jkotas opened this issue Jul 1, 2024 · 2 comments · Fixed by #104407
Assignees
Labels
area-System.ComponentModel blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' Known Build Error Use this to report build issues in the .NET Helix tab
Milestone

Comments

@jkotas
Copy link
Member

jkotas commented Jul 1, 2024

From https://dev.azure.com/dnceng-public/public/_build/results?buildId=725665&view=ms.vss-test-web.build-test-results-tab&runId=18226406&resultId=209449&paneView=dotnet-dnceng.dnceng-anon-build-release-tasks.helix-anon-test-information-tab

  Starting:    System.Data.Common.Tests (parallel test collections = on [2 threads], stop on fail = off)
    System.Data.Tests.DataSetTypedDataSetTest.TypedDataSet [SKIP]
      Condition(s) not met: "IsBinaryFormatterSupported"
    System.Data.Tests.DataSetTest2.Bug537229_BinFormatSerializer_Test [SKIP]
      Condition(s) not met: "IsBinaryFormatterSupported"
    System.Data.Tests.DataTableReadXmlSchemaTest.XsdSchemaSerializationIgnoresLocale [SKIP]
      Condition(s) not met: "IsBinaryFormatterSupported"
    System.Data.Tests.DataTableReadXmlSchemaTest.XsdSchemaDeserializationIgnoresLocale [SKIP]
      Condition(s) not met: "IsBinaryFormatterSupported"
    System.Data.Tests.DataSetTest.SerializationFormat_Binary_works_with_appconfig_switch [SKIP]
      Condition(s) not met: "RemoteExecutorBinaryFormatter"
Process terminated. Assertion failed.
   at System.Collections.Generic.Dictionary`2.FindValue(TKey key) in /_/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Dictionary.cs:line 446
   at System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value) in /_/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Dictionary.cs:line 1394
   at System.ComponentModel.TypeDescriptor.CheckDefaultProvider(Type type) in /_/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs:line 336
   at System.ComponentModel.TypeDescriptor.NodeFor(Type type, Boolean createDelegator) in /_/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs:line 1649
   at System.ComponentModel.TypeDescriptor.NodeFor(Type type) in /_/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs:line 1629
   at System.ComponentModel.TypeDescriptor.NodeFor(Object instance, Boolean createDelegator) in /_/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs:line 1773
   at System.ComponentModel.TypeDescriptor.NodeFor(Object instance) in /_/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs:line 1711
   at System.ComponentModel.TypeDescriptor.GetCache(Object instance) in /_/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs:line 786
   at System.ComponentModel.TypeDescriptor.GetPropertiesImpl(Object component, Attribute[] attributes, Boolean noCustomTypeDesc, Boolean noAttributes) in /_/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs:line 1493
   at System.ComponentModel.TypeDescriptor.GetProperties(Object component, Boolean noCustomTypeDesc) in /_/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs:line 1403
   at System.ComponentModel.TypeDescriptor.GetProperties(Object component) in /_/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs:line 1385
   at System.Data.XmlTreeGen.AddXdoProperties(Object instance, XmlElement root) in /_/src/libraries/System.Data.Common/src/System/Data/xmlsaver.cs:line 117
   at System.Data.XmlTreeGen.SchemaTree(XmlDocument xd, XmlWriter xmlWriter, DataSet ds, DataTable dt, Boolean writeHierarchy) in /_/src/libraries/System.Data.Common/src/System/Data/xmlsaver.cs:line 690
   at System.Data.XmlTreeGen.Save(DataSet ds, DataTable dt, XmlWriter xw, Boolean writeHierarchy, Converter`2 multipleTargetConverter) in /_/src/libraries/System.Data.Common/src/System/Data/xmlsaver.cs:line 1144
   at System.Data.XmlTreeGen.Save(DataSet ds, DataTable dt, XmlWriter xw, Boolean writeHierarchy) in /_/src/libraries/System.Data.Common/src/System/Data/xmlsaver.cs:line 1127
   at System.Data.XmlDataTreeWriter.Save(XmlWriter xw, Boolean writeSchema) in /_/src/libraries/System.Data.Common/src/System/Data/xmlsaver.cs:line 2878
   at System.Data.DataTable.WriteXml(XmlWriter writer, XmlWriteMode mode, Boolean writeHierarchy) in /_/src/libraries/System.Data.Common/src/System/Data/DataTable.cs:line 5418
   at System.Data.DataTable.WriteXml(Stream stream, XmlWriteMode mode, Boolean writeHierarchy) in /_/src/libraries/System.Data.Common/src/System/Data/DataTable.cs:line 5344
   at System.Data.Tests.DataTableTest4.XmlTest7() in /_/src/libraries/System.Data.Common/tests/System/Data/DataTableTest4.cs:line 760

Build Information

Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=725665
Build error leg or test failing: System.Data.Common.Tests.WorkItemExecution
Pull request: #104219

Error Message

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

{
  "ErrorMessage": "at System.ComponentModel.TypeDescriptor.CheckDefaultProvider(Type type)",
  "ErrorPattern": "",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=725665
Error message validated: [at System.ComponentModel.TypeDescriptor.CheckDefaultProvider(Type type)]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 7/1/2024 6:48:36 AM UTC

Report

Build Definition Test Pull Request
2487307 dotnet-runtime Microsoft.Extensions.Options.Tests.WorkItemExecution
725665 dotnet/runtime System.Data.Common.Tests.WorkItemExecution #104219

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 1 2
@jkotas jkotas added blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' Known Build Error Use this to report build issues in the .NET Helix tab labels Jul 1, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Jul 1, 2024
@jkotas
Copy link
Member Author

jkotas commented Jul 1, 2024

This code does not look thread safe:

if (s_defaultProviderInitialized.TryGetValue(type, out object? provider) && provider == s_initializedDefaultProvider)
{
return;
}
lock (s_commonSyncObject)
{
AddDefaultProvider(type);
}

Generic Dictionary is not thread safe. It has to be both read and modified under a lock. This code reads it outside the lock and modifies is under the lock.

Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-componentmodel
See info in area-owners.md if you want to be subscribed.

@steveharter steveharter self-assigned this Jul 1, 2024
@steveharter steveharter added this to the 9.0.0 milestone Jul 1, 2024
@dotnet-policy-service dotnet-policy-service bot removed the untriaged New issue has not been triaged by the area owner label Jul 2, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Aug 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.ComponentModel blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' Known Build Error Use this to report build issues in the .NET Helix tab
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants