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

BindingExpressionBase.UpdateNotifyDataErrorValidationErrors throws NullReferenceException #10150

Open
znakeeye opened this issue Dec 6, 2024 · 1 comment
Labels
Investigate Requires further investigation by the WPF team. 📭 waiting-author-feedback To request more information from author. Needs minimal repro project

Comments

@znakeeye
Copy link

znakeeye commented Dec 6, 2024

Description

Targeting .NET 6. This happened twice, but I have no reliable way to reproduce it.

PresentationFramework.dll!System.Windows.Data.BindingExpressionBase.UpdateNotifyDataErrorValidationErrors(System.Collections.Generic.List<object> errors) Unknown
PresentationFramework.dll!System.Windows.Data.BindingExpression.UpdateNotifyDataErrors(System.ComponentModel.INotifyDataErrorInfo indei, string propertyName, object value)   Unknown
PresentationFramework.dll!System.Windows.Data.BindingExpression.OnErrorsChanged.AnonymousMethod__108_0(object arg)       Unknown
               PresentationFramework.dll!MS.Internal.Data.DataBindEngine.ProcessCrossThreadRequests()                Unknown
        WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs) Unknown
               WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source, System.Delegate callback, object args, int numArgs, System.Delegate catchHandler)               Unknown
               WindowsBase.dll!System.Windows.Threading.DispatcherOperation.InvokeImpl()       Unknown
               WindowsBase.dll!MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(object obj)                Unknown
> System.Private.CoreLib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) Line 179           C#
WindowsBase.dll!MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext executionContext, System.Threading.ContextCallback callback, object state) Unknown
               WindowsBase.dll!System.Windows.Threading.DispatcherOperation.Invoke()  Unknown
               WindowsBase.dll!System.Windows.Threading.Dispatcher.ProcessQueue()      Unknown
               WindowsBase.dll!System.Windows.Threading.Dispatcher.WndProcHook(nint hwnd, int msg, nint wParam, nint lParam, ref bool handled)             Unknown
               WindowsBase.dll!MS.Win32.HwndWrapper.WndProc(nint hwnd, int msg, nint wParam, nint lParam, ref bool handled)      Unknown
        WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs) Unknown
               WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source, System.Delegate callback, object args, int numArgs, System.Delegate catchHandler)               Unknown
WindowsBase.dll!System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority priority, System.TimeSpan timeout, System.Delegate method, object args, int numArgs)         Unknown
               WindowsBase.dll!MS.Win32.HwndSubclass.SubclassWndProc(nint hwnd, int msg, nint wParam, nint lParam)              Unknown
               [Native to Managed Transition]          
               [Managed to Native Transition]          
WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame frame) Unknown
               PresentationFramework.dll!System.Windows.Application.RunDispatcher(object ignore)                Unknown
               PresentationFramework.dll!System.Windows.Application.RunInternal(System.Windows.Window window)            Unknown

Image

Reproduction Steps

No way to reproduce it. You will have to perform some static analysis...

Expected behavior

We should not get a NullReferenceException for each item in the rendered items control.

Actual behavior

A NullReferenceException is thrown for each item in our bound list.

Regression?

No response

Known Workarounds

No response

Impact

No response

Configuration

No response

Other information

We are using BindingOperations.EnableCollectionSynchronization() on our custom ObservableCollection, if that matters. (This code has been in production for several years, and we never encountere this prior to .NET Core migration.)

@himgoyalmicro himgoyalmicro added Needs minimal repro project Investigate Requires further investigation by the WPF team. labels Dec 9, 2024
@himgoyalmicro
Copy link
Contributor

@znakeeye Can you please provide more information about the use case where you are encountering the NRE exception?

@himgoyalmicro himgoyalmicro added the 📭 waiting-author-feedback To request more information from author. label Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Investigate Requires further investigation by the WPF team. 📭 waiting-author-feedback To request more information from author. Needs minimal repro project
Projects
None yet
Development

No branches or pull requests

2 participants