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

[Watson] clr20r3: CLR_EXCEPTION_System.Collections.Generic.KeyNotFoundException_80131577_PresentationCore.dll!MS.Internal.DpiUtil+DpiAwarenessScope..ctor #1198

Closed
grubioe opened this issue Jul 9, 2019 · 20 comments
Assignees
Labels
Bug Product bug (most likely) tell-mode Issues and PR's that require notice to .NET Core Shiproom
Milestone

Comments

@grubioe
Copy link
Contributor

grubioe commented Jul 9, 2019

Copied from ADO ID 893177

  • Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes

We have a bug here - a missing check.

\WPF\src\Core\CSharp\MS\Internal\DpiUtil\DpiUtil+DpiAwarenessScope.cs

            [SecuritySafeCritical]
            private DpiAwarenessScope(
                DpiAwarenessContextValue dpiAwarenessContextValue,
                bool updateIfThreadInMixedHostingMode,
                bool updateIfWindowIsSystemAwareOrUnaware,
                IntPtr hWnd)
            {
                if (!OperationSupported)
                {
                    return;
                }

                if (updateIfThreadInMixedHostingMode && !this.IsThreadInMixedHostingBehavior)
                {
                    return;
                }

                if (updateIfWindowIsSystemAwareOrUnaware &&
                    (hWnd == IntPtr.Zero || !this.IsWindowUnawareOrSystemAware(hWnd)))
                {
                    return;
                }

                try
                {
                    this.OldDpiAwarenessContext = 
                        UnsafeNativeMethods.SetThreadDpiAwarenessContext(
                            new DpiAwarenessContextHandle(dpiAwarenessContextValue));
                }
                catch (Exception e) when (e is EntryPointNotFoundException || e is MissingMethodException || e is DllNotFoundException)
                {
                    OperationSupported = false;
                }
            }

We should either be catch KeyNotFoundException, or better yet, checking for dpiAwarenessContextValue==Invalid and return with OperationSupported=false early in the constructor.

Found from Watson data:

Call Stack

  1. mscorlib.ni!System.Collections.Generic.Dictionary_2[[MS.Utility.DpiAwarenessContextValue,_WindowsBase],[System.IntPtr,_mscorlib]].get_Item
  2. at PresentationCore.ni!MS.Internal.DpiUtil in DpiUtil+DpiAwarenessScope.cs
  3. at PresentationFramework.ni!System.Windows.SystemResources.CreateResourceChangeListenerWindow in SystemResources.cs
  4. at PresentationFramework.ni!System.Windows.SystemResources.EnsureResourceChangeListener in SystemResources.cs
  5. at PresentationFramework.ni!System.Windows.SystemResources.GetDpiAwarenessCompatibleNotificationWindow in SystemResources.cs
  6. at PresentationFramework.ni!System.Windows.Interop.HwndHost.BuildOrReparentWindow in HwndHost.cs
  7. at PresentationFramework.ni!System.Windows.Interop.HwndHost.OnSourceChanged in HwndHost.cs
  8. at PresentationCore.ni!System.Windows.SourceChangedEventArgs.InvokeEventHandler in SourceChangedEventArgs.cs
  9. at PresentationCore.ni!System.Windows.RoutedEventArgs.InvokeHandler in RoutedEventArgs.cs
  10. at PresentationCore.ni!System.Windows.RoutedEventHandlerInfo.InvokeHandler in RoutedEventHandlerInfo.cs
  11. at PresentationCore.ni!System.Windows.EventRoute.InvokeHandlersImpl in EventRoute.cs
  12. at PresentationCore.ni!System.Windows.UIElement.RaiseEventImpl in UIElement.cs
  13. at PresentationCore.ni!System.Windows.UIElement.RaiseEvent in UIElement.cs
  14. at PresentationCore.ni!System.Windows.PresentationSource.UpdateSourceOfElement in PresentationSource.cs
  15. at PresentationCore.ni!System.Windows.PresentationSource.RootChanged in PresentationSource.cs
  16. at PresentationCore.ni!System.Windows.Interop.HwndSource.set_RootVisualInternal in HwndSource.cs
  17. at PresentationCore.ni!System.Windows.Interop.HwndSource.Dispose in HwndSource.cs
  18. at PresentationCore.ni!System.Windows.Interop.HwndSource.OnHwndDisposed in HwndSource.cs
  19. at WindowsBase.ni!MS.Win32.HwndWrapper.Dispose in HwndWrapper.cs
  20. at WindowsBase.ni!MS.Win32.HwndWrapper.WndProc in HwndWrapper.cs
  21. at WindowsBase.ni!MS.Win32.HwndSubclass.DispatcherCallbackOperation in HwndSubclass.cs
  22. at WindowsBase.ni!System.Windows.Threading.ExceptionWrapper.InternalRealCall in ExceptionWrapper.cs
  23. at WindowsBase.ni!System.Windows.Threading.ExceptionWrapper.TryCatchWhen in ExceptionWrapper.cs
  24. at WindowsBase.ni!System.Windows.Threading.Dispatcher.LegacyInvokeImpl in Dispatcher.cs
  25. at WindowsBase.ni!MS.Win32.HwndSubclass.SubclassWndProc in HwndSubclass.cs
@grubioe grubioe added Bug Product bug (most likely) area-netfx labels Jul 9, 2019
@vatsan-madhavan
Copy link
Member

@grubioe this is marked as area_netfx. IIRC we wanted to fix this in .NET Core but decided that the hit-counts were too low to meet the bar for .NET Framework, right?

@grubioe
Copy link
Contributor Author

grubioe commented Jul 10, 2019

Yes, also because it reproduces in .NET Framework,

@grubioe grubioe added this to the Future milestone Jul 11, 2019
@grubioe grubioe removed the area-netfx label Aug 1, 2019
@grubioe grubioe modified the milestones: Future, 3.0 Aug 1, 2019
vatsan-madhavan added a commit that referenced this issue Aug 2, 2019
[Watson] clr20r3: CLR_EXCEPTION_System.Collections.Generic.KeyNotFoundException_80131577_PresentationCore.dll!MS.Internal.DpiUtil+DpiAwarenessScope..ctor
--

When a caller passes in `dpiAwarenessContextValue==Invalid`, `new DpiAwarenessContextHandle(dpiAwarenssContextValue)` throws `KeyNotFoundException`.

This happens because we do not have a pre-created pseudo-_HANDLE_  corresponding to `Invalid` in our internal map of pseudo-handles in `DpiAwarenessContextHandle.WellKnownContextValues`. Such a pseudo-handle cannot be created either.

When `dpiAwarenessContextValue=Invalid` is passed, the correct behavior is to treat it as a no-op and simply `return`. The corresponding `Dispose()` will also run benignly and the caller will get the correct behavior - which is that no changes will be made to the thread-state.
@joergbattermann
Copy link

We get these exceptions in a .Net 4.7.2 application - is there any way to work around this reliably i.e. by disabling dpi awareness (and if so.. what would be the correct approach)?

@vatsan-madhavan vatsan-madhavan added the tell-mode Issues and PR's that require notice to .NET Core Shiproom label Aug 6, 2019
@vatsan-madhavan
Copy link
Member

@jbattermann, I suspect you are on .NET 4.8 runtime - the failing codepath was not introduced until .NET 4.8.

Even then, your app has to use a a somewhat complex configuration. It would have to be an app that is (a) per-monitor DPI aware and (b) also mixes unaware child-windows in the same application. Visual Studio may do this; Word can do this sometimes for certain WinForms or WPF based plug-ins, where it will typically use system-aware (not unaware) plug-ins inside per-monitor aware Word application.

You can certainly disable DPI awareness as a workaround by changing the application manifest to specify system-awareness (see dpiAwareness) - that should do it. That said, if you are encountering this problem, then you probably have an app that cannot be run only in system-aware mode owing to the fact that it needs to mix windows of different DPI_AWARENESS_CONTEXT's in the same application.

All that said, we are working on fixing this in .NET 4.8 as well.

@joergbattermann
Copy link

@vatsan-madhavan We're running 4.7.2 all the way (4.8 isn't rolled out in our it environment yet and our .Net applications are 4.7.2 only, too) so the question is, will this be fixed in 4.7.2, too or "only" in 4.8?

@vatsan-madhavan
Copy link
Member

@jbattermann,

This fix will only be made available for 4.8, because this exact problem cannot exist on 4.7.2.

Let me explain.

1. mscorlib.ni!System.Collections.Generic.Dictionary_2[[MS.Utility.DpiAwarenessContextValue,_WindowsBase],[System.IntPtr,_mscorlib]].get_Item


2. at PresentationCore.ni!MS.Internal.DpiUtil in DpiUtil+DpiAwarenessScope.cs

3. at PresentationFramework.ni!System.Windows.SystemResources.CreateResourceChangeListenerWindow in SystemResources.cs

It’s conceivable that a crash involving frame 3 occurs on 4.7.2 runtime, but a crash involving frames 2 or 1 cannot happen on 4.7.2 - the code corresponding to those frames are new in 4.8 (for eg, DpiUtil+DpiAwarenesdScope) and don't exist in 4.7.2.

If your crash stack is an exact match, then the underlying runtime has to be 4.8.

If the runtime is 4.7.2 , then the crash stack is likely a bit different than the one being discussed here.

If the runtime is definitely 4.7.2 and the crash stack is an exact match for this report, then I’m stumped. We’d want to start puzzling out why a 4.8 runtime reports itself as 4.7.2... and go from there.

@joergbattermann
Copy link

Ok here's the full stack trace we get in our .Net Application:

mscorlib: System.Collections.Generic.KeyNotFoundException
The given key was not present in the dictionary.
   at System.ThrowHelper.ThrowKeyNotFoundException()
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at MS.Internal.DpiUtil.DpiAwarenessScope..ctor(DpiAwarenessContextValue dpiAwarenessContextValue, Boolean updateIfThreadInMixedHostingMode, Boolean updateIfWindowIsSystemAwareOrUnaware, IntPtr hWnd)
   at System.Windows.SystemResources.CreateResourceChangeListenerWindow(DpiAwarenessContextValue dpiContextValue, Int32 x, Int32 y, String callerName)
   at System.Windows.SystemResources.EnsureResourceChangeListener(HwndDpiInfo hwndDpiInfo)
   at System.Windows.SystemResources.GetDpiAwarenessCompatibleNotificationWindow(HandleRef hwnd)
   at System.Windows.Interop.HwndHost.BuildOrReparentWindow()
   at System.Windows.Interop.HwndHost.OnSourceChanged(Object sender, SourceChangedEventArgs e)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.PresentationSource.UpdateSourceOfElement(DependencyObject doTarget, DependencyObject doAncestor, DependencyObject doOldParent)
   at System.Windows.PresentationSource.RootChanged(Visual oldRoot, Visual newRoot)
   at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
   at System.Windows.Interop.HwndSource.Dispose(Boolean disposing)
   at System.Windows.Interop.HwndSource.OnHwndDisposed(Object sender, EventArgs args)
   at MS.Win32.HwndWrapper.Dispose(Boolean disposing, Boolean isHwndBeingDestroyed)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)

... which looks at first and second glance similar? If it does / is to you, as well.. is there a quick way to double check what runtime is being used? The users did/could not run our application before explicitly installing the 4.7.2 runtime though.

@vatsan-madhavan
Copy link
Member

vatsan-madhavan commented Aug 8, 2019

https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed describes how to check the version of .NET Framework installed on a machine.

@joergbattermann
Copy link

4.7.2 it appears to be:

PS C:\Users\battjo6r> Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\' |  Get-ItemPropertyValue -Name Release
461808
461808

@grubioe
Copy link
Contributor Author

grubioe commented Aug 8, 2019

@BrettLopez - have you heard reports of corrupt .NET 4.8 installations?

@vatsan-madhavan
Copy link
Member

Can you also open your application in WinDbg in one of the 4.7.2 reporting systems and look up the version of WindowsBase, PresentaionCore and PresentationFramework (using lmvm) ?

@vatsan-madhavan
Copy link
Member

@grubioe, Can we create a new issue for this investigation (which could very well be about figuring out corrupt state) in the right netfx 4.8 feedback repo and use that to track progress?

@vatsan-madhavan
Copy link
Member

Comment from @BrettLopez (who is have trouble with login, so posting for him):

  • From elevated cmd prompt run the below command and share the output back: dism /online /get-packages
  • Run http://aka.ms/vscollect.exe and share back %temp%\vslogs.zip.

@joergbattermann
Copy link

@vatsan-madhavan I've inquired with the user directly and asked to get the file(s) / info and will report back as soon as I have them. Thanks so far!

@AndreaLazz
Copy link

AndreaLazz commented Sep 12, 2019

I'm having the same problem on a mixed application WPF+Windows Forms with .NET 4.8 (version 4.8.03761) and windows 10 with the following version:

PS C:\Users\LazzaAnd> systeminfo /fo csv | ConvertFrom-Csv | select OS*, System*, Hotfix* | Format-List
OS Name : Microsoft Windows 10 Enterprise
OS Version : 10.0.16299 N/A Build 16299
OS Manufacturer : Microsoft Corporation
OS Configuration : Member Workstation
OS Build Type : Multiprocessor Free
System Boot Time : 9/12/2019, 7:59:29 AM
System Manufacturer : Dell Inc.
System Model : Precision 5520
System Type : x64-based PC
System Directory : C:\WINDOWS\system32
System Locale : it;Italian (Italy)
Hotfix(s) : 25 Hotfix(s) Installed.,[01]: KB4506988,[02]: KB4054022,[03]: KB4056887,[04]: KB4057247,[05]:
KB4058702,[06]: KB4073120,[07]: KB4090007,[08]: KB4103729,[09]: KB4287903,[10]: KB4338832,[11]:
KB4339420,[12]: KB4343902,[13]: KB4457146,[14]: KB4462930,[15]: KB4465661,[16]: KB4471331,[17]:
KB4477136,[18]: KB4480979,[19]: KB4485448,[20]: KB4486153,[21]: KB4487038,[22]: KB4500641,[23]:
KB4503308,[24]: KB4509093,[25]: KB4512494

Here below the stackTrace (it crashes when closing application):

System.Transactions Critical: 0 : http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/UnhandledUnhandled exception4GE.exeSystem.Collections.Generic.KeyNotFoundException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089The given key was not present in the dictionary. at System.Collections.Generic.Dictionary2.get_Item(TKey key) at MS.Internal.DpiUtil.DpiAwarenessScope..ctor(DpiAwarenessContextValue dpiAwarenessContextValue, Boolean updateIfThreadInMixedHostingMode, Boolean updateIfWindowIsSystemAwareOrUnaware, IntPtr hWnd) at System.Windows.SystemResources.CreateResourceChangeListenerWindow(DpiAwarenessContextValue dpiContextValue, Int32 x, Int32 y, String callerName) at System.Windows.SystemResources.EnsureResourceChangeListener(HwndDpiInfo hwndDpiInfo) at System.Windows.SystemResources.GetDpiAwarenessCompatibleNotificationWindow(HandleRef hwnd) at System.Windows.Interop.HwndHost.BuildOrReparentWindow() at System.Windows.Interop.HwndHost.OnSourceChanged(Object sender, SourceChangedEventArgs e) at System.Windows.SourceChangedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e) at System.Windows.PresentationSource.UpdateSourceOfElement(DependencyObject doTarget, DependencyObject doAncestor, DependencyObject doOldParent) at System.Windows.PresentationSource.RootChanged(Visual oldRoot, Visual newRoot) at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value) at System.Windows.Interop.HwndSource.Dispose(Boolean disposing) at System.Windows.Interop.HwndSource.OnHwndDisposed(Object sender, EventArgs args) at MS.Win32.HwndWrapper.Dispose(Boolean disposing, Boolean isHwndBeingDestroyed) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean&amp;amp; handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)</StackTrace><ExceptionString>System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. at System.Collections.Generic.Dictionary2.get_Item(TKey key)
at MS.Internal.DpiUtil.DpiAwarenessScope..ctor(DpiAwarenessContextValue dpiAwarenessContextValue, Boolean updateIfThreadInMixedHostingMode, Boolean updateIfWindowIsSystemAwareOrUnaware, IntPtr hWnd)
at System.Windows.SystemResources.CreateResourceChangeListenerWindow(DpiAwarenessContextValue dpiContextValue, Int32 x, Int32 y, String callerName)
at System.Windows.SystemResources.EnsureResourceChangeListener(HwndDpiInfo hwndDpiInfo)
at System.Windows.SystemResources.GetDpiAwarenessCompatibleNotificationWindow(HandleRef hwnd)
at System.Windows.Interop.HwndHost.BuildOrReparentWindow()
at System.Windows.Interop.HwndHost.OnSourceChanged(Object sender, SourceChangedEventArgs e)
at System.Windows.SourceChangedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
at System.Windows.PresentationSource.UpdateSourceOfElement(DependencyObject doTarget, DependencyObject doAncestor, DependencyObject doOldParent)
at System.Windows.PresentationSource.RootChanged(Visual oldRoot, Visual newRoot)
at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
at System.Windows.Interop.HwndSource.Dispose(Boolean disposing)
at System.Windows.Interop.HwndSource.OnHwndDisposed(Object sender, EventArgs args)
at MS.Win32.HwndWrapper.Dispose(Boolean disposing, Boolean isHwndBeingDestroyed)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean&amp; handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
An unhandled exception of type 'System.Collections.Generic.KeyNotFoundException' occurred in mscorlib.dll
The given key was not present in the dictionary.

I found a workaround.
In App.Config I need to add the following settings on runtime information:

AppContextSwitchOverrides value = "Switch.System.Windows.DoNotScaleForDpiChanges=true; Switch.System.Windows.DoNotUsePresentationDpiCapabilityTier2OrGreater=true"

Do you plan a fix for .NET 4.8?
Or does it exists other "more specific" workarounds?

@vatsan-madhavan
Copy link
Member

@AndreaLazz The fix for .NET 4.8 will be coming out soon.

@AndreaLazz
Copy link

Thank you for your information.
However, I found a "more specific" workaround.
Instead of declaring (in mixed WPF+WindowsForm application) WindowsFormsHost container in XAML, i declared it using code saving the reference of this object in application.
When closing application, I disposed the referenced object.

@yingfangdu
Copy link

yingfangdu commented Sep 23, 2019

We have reproduced and this becomes the top crash in our product Microsoft Advertising Editor. and we are targeting 4.7.1 .NetFramework.

Currently we cannot offer upgrading to 4.8 even the fix is released as it is close to holiday seasons.

And our product must enable this DPI awareness otherwise introducing rendering bugs.

I would be great to have the fix for 4.7. too.

Thanks,
Yvonne

at System.ThrowHelper.ThrowKeyNotFoundException() + 0x5 (C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll + 0x06000337)
at System.Collections.Generic.Dictionary`2.get_Item(TKey key) + 0x1e (C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll + 0x06003923)
at MS.Internal.DpiUtil+DpiAwarenessScope..ctor(DpiAwarenessContextValue dpiAwarenessContextValue, Boolean updateIfThreadInMixedHostingMode, Boolean updateIfWindowIsSystemAwareOrUnaware, IntPtr hWnd) + 0x37 (C:\windows\Microsoft.Net\assembly\GAC_64\PresentationCore\v4.0_4.0.0.0__31bf3856ad364e35\PresentationCore.dll + 0x06005955)
at System.Windows.SystemResources.CreateResourceChangeListenerWindow(DpiAwarenessContextValue dpiContextValue, Int32 x, Int32 y, String callerName) + 0x0 (C:\windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.dll + 0x06000b81)
at System.Windows.SystemResources.EnsureResourceChangeListener(HwndDpiInfo hwndDpiInfo) + 0x39 (C:\windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.dll + 0x06000b80)
at System.Windows.SystemResources.GetDpiAwarenessCompatibleNotificationWindow(HandleRef hwnd) + 0x29 (C:\windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.dll + 0x06000b92)
at System.Windows.Interop.HwndHost.BuildOrReparentWindow() + 0xd7 (C:\windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.dll + 0x0600620c)
at System.Windows.Interop.HwndHost.OnSourceChanged(Object sender, SourceChangedEventArgs e) + 0x96 (C:\windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.dll + 0x06006208)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) + 0x7 (C:\windows\Microsoft.Net\assembly\GAC_64\PresentationCore\v4.0_4.0.0.0__31bf3856ad364e35\PresentationCore.dll + 0x06000baa)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) + 0x3d (C:\windows\Microsoft.Net\assembly\GAC_64\PresentationCore\v4.0_4.0.0.0__31bf3856ad364e35\PresentationCore.dll + 0x06000bb7)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) + 0xee (C:\windows\Microsoft.Net\assembly\GAC_64\PresentationCore\v4.0_4.0.0.0__31bf3856ad364e35\PresentationCore.dll + 0x060005cf)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) + 0x57 (C:\windows\Microsoft.Net\assembly\GAC_64\PresentationCore\v4.0_4.0.0.0__31bf3856ad364e35\PresentationCore.dll + 0x0600083c)
at System.Windows.PresentationSource.UpdateSourceOfElement(DependencyObject doTarget, DependencyObject doAncestor, DependencyObject doOldParent) + 0x45 (C:\windows\Microsoft.Net\assembly\GAC_64\PresentationCore\v4.0_4.0.0.0__31bf3856ad364e35\PresentationCore.dll + 0x06000b86)
at System.Windows.PresentationSource.RootChanged(Visual oldRoot, Visual newRoot) + 0xa8 (C:\windows\Microsoft.Net\assembly\GAC_64\PresentationCore\v4.0_4.0.0.0__31bf3856ad364e35\PresentationCore.dll + 0x06000b77)
at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value) + 0xe8 (C:\windows\Microsoft.Net\assembly\GAC_64\PresentationCore\v4.0_4.0.0.0__31bf3856ad364e35\PresentationCore.dll + 0x06001a6e)
at System.Windows.Interop.HwndSource.Dispose(Boolean disposing) + 0x4a (C:\windows\Microsoft.Net\assembly\GAC_64\PresentationCore\v4.0_4.0.0.0__31bf3856ad364e35\PresentationCore.dll + 0x06001ab4)
at System.Windows.Interop.HwndSource.OnHwndDisposed(Object sender, EventArgs args) + 0x7 (C:\windows\Microsoft.Net\assembly\GAC_64\PresentationCore\v4.0_4.0.0.0__31bf3856ad364e35\PresentationCore.dll + 0x06001ab1)
at MS.Win32.HwndWrapper.Dispose(Boolean disposing, Boolean isHwndBeingDestroyed) + 0x14 (C:\windows\Microsoft.Net\assembly\GAC_MSIL\WindowsBase\v4.0_4.0.0.0__31bf3856ad364e35\WindowsBase.dll + 0x0600019c)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) + 0x66 (C:\windows\Microsoft.Net\assembly\GAC_MSIL\WindowsBase\v4.0_4.0.0.0__31bf3856ad364e35\WindowsBase.dll + 0x060001a3)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) + 0x36 (C:\windows\Microsoft.Net\assembly\GAC_MSIL\WindowsBase\v4.0_4.0.0.0__31bf3856ad364e35\WindowsBase.dll + 0x06000193)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) + 0x77 (C:\windows\Microsoft.Net\assembly\GAC_MSIL\WindowsBase\v4.0_4.0.0.0__31bf3856ad364e35\WindowsBase.dll + 0x06000f73)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) + 0x2 (C:\windows\Microsoft.Net\assembly\GAC_MSIL\WindowsBase\v4.0_4.0.0.0__31bf3856ad364e35\WindowsBase.dll + 0x06000f72)

@yingfangdu
Copy link

yingfangdu commented Sep 23, 2019

And I have another question: this crash is caused by the setting per-monitor (V1) or per-monitor (V2)?

Our rendering issue can be fixed by only enabling V1.

@vatsan-madhavan
Copy link
Member

fyi (esp. @jbattermann, @AndreaLazz):

#1953 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Product bug (most likely) tell-mode Issues and PR's that require notice to .NET Core Shiproom
Projects
None yet
Development

No branches or pull requests

5 participants