Skip to content

Creating multi-thread UI has a very very low probability to crash #298

Open

Description

@walterlv
  • .NET Core Version: 3.0.100-preview-009812 But not sure because we can't reproduce it
  • Windows version: Windows 10.0.17763.0
  • Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes

Problem description:

An exception is thrown when multi-threaded UI is shown during the application startup and the application crashes. We created a solution to reproduce it but actually, we got the issue at #297 but still can't reproduce this one.

Actual behavior:

System.Windows.Markup.XamlParseException: Collection was modified; enumeration operation may not execute. ---> System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
   在 System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   在 System.Collections.Generic.List`1.Enumerator.MoveNextRare()
   在 System.Collections.Generic.List`1.Enumerator.MoveNext()
   在 System.Windows.Baml2006.WpfSharedBamlSchemaContext.GetKnownXamlType(Type type)
   在 System.Windows.Baml2006.WpfSharedBamlSchemaContext.GetXamlType(Type type)
   在 System.Windows.Baml2006.Baml2006SchemaContext.GetXamlType(Type type)
   在 System.Xaml.XamlObjectWriter.GetXamlType(Type clrType)
   在 System.Xaml.XamlObjectWriter.WriteEndMember()
   在 System.Xaml.XamlWriter.WriteNode(XamlReader reader)
   在 System.Windows.Markup.WpfXamlLoader.TransformNodes(XamlReader xamlReader, XamlObjectWriter xamlWriter, Boolean onlyLoadOneNode, Boolean skipJournaledProperties, Boolean shouldPassLineNumberInfo, IXamlLineInfo xamlLineInfo, IXamlLineInfoConsumer xamlLineInfoConsumer, XamlContextStack`1 stack, IStyleConnector styleConnector)
   在 System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
   --- End of inner exception stack trace ---
   在 System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
   在 System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
   在 System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
   在 System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)

Expected behavior:

Don't crash.

Minimal repro:

Maybe it is the same reproduction to #297 but we only receive these exceptions from our partners' PCs and we can't reproduce it in our PCs.

Activity

  1. walterlv commented on Jan 29, 2019

    @walterlv
    ContributorAuthor

    More analysis can be seen here with a Chinese version and its Google translated version.

  2. added
    Bug
    on Apr 4, 2019
  3. added this to the Future milestone on Apr 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions