locked
FatalExecutionEngineError when adding to a collection RRS feed

  • Question

  • Scenario:  WPF application, .NET 4.0

    A GridView exists on a Form, that is bound to collection of type IBindingList.  When the user clicks add, a separate form pops up, they enter some information, and click 'Add'.   This item is added to two different collections. I can trace through the code, no problems, but inside of the Add Function of the collection, I get a Fatal error.

    Here's the definition of the Collection's Add method (Public Function Add(ByVal value as t) As Integer)

     	Me.blnHasChanges = True
            Dim idx As Integer = 0
            AddHandler value.PropertyChanged, AddressOf PendItem
            MyBase.List.Add(value)
            idx = Me.IndexOf(value)
            RaiseEvent ListChanged(value, New ListChangedEventArgs(ListChangedType.ItemAdded, idx))

    The error occurs on the RaiseEvent line. The error is:

    The runtime has encountered a fatal error. The address of the error was at 0x64058fed, on thread 0x19d4. The error code is 0x80131623. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.

    I'm somewhat at a loss...any ideas?

    Wednesday, April 18, 2012 7:31 PM

All replies

  • This is known bug see this http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/3eba415d-943c-460a-ab5d-f7f1721b232b/ 

    NEU_ShieldEdge

    Friday, April 20, 2012 5:55 AM
  • Yes, I see that this was a known bug back in v3 of the .NET Framework, however, it appears the bug has not been fixed in .NET 4.0 either, as that is the platform I am running against.

    Monday, April 23, 2012 12:53 PM
  • Do you have any code to reproduce this issue?

    NEU_ShieldEdge

    Thursday, April 26, 2012 3:01 AM