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

UCEERR_RENDERTHREADFAILURE when hosting ElementHost within WindowsFormsHost #3719

Open
AndreasBreuninger opened this issue Oct 29, 2020 · 7 comments
Labels
Investigate Requires further investigation by the WPF team. .NET Framework
Milestone

Comments

@AndreasBreuninger
Copy link

  • .NET Core Version:
    Did not find a quick way doing this in .net core

  • Have you experienced this same bug with .NET Framework?:
    Yes
    .net 4.8

Problem description:

I have a hybrid WinForms/WPF (so I'm not sure if its a WinForms or WPF issue) application with an ElementHost. The child element is a WPF UserControl with a TabControl. Via the ItemsSource different types of tabs are displayed.

  1. WinForms Controls, integrated via a WindowsFormsHost
  2. WPF Controls, directly through the ElementHost
  3. WPF Control, provided via a WinForms UserControl, hosted on a WindowsFormsHost, which displays a WPF Control via an ElementHost

The third case seems pretty crazy and stupid, but is the case.
Switching between the tabs, the application crashes pretty fast with 2 exceptions.

1st UCEERR_RENDERTHREADFAILURE System.Windows.Media.Composition.DUCE+Channel.SyncFlush
2nd FATAL_USER_CALLBACK_EXCEPTION An unhandled exception was encountered during a user callback.

PresentationCore_ni!System.Windows.Media.Composition.DUCE+Channel.SyncFlush+0x98b9ae
PresentationCore_ni!System.Windows.Media.MediaContext.CompleteRender+0x57
PresentationCore_ni!System.Windows.Interop.HwndTarget.OnResize+0x1cb
PresentationCore_ni!System.Windows.Interop.HwndTarget.HandleMessage+0x2f4
PresentationCore_ni!System.Windows.Interop.HwndSource.HwndTargetFilterMessage+0x3f
WindowsBase_ni!MS.Win32.HwndWrapper.WndProc+0xc4
WindowsBase_ni!MS.Win32.HwndSubclass.DispatcherCallbackOperation+0x84
WindowsBase_ni!System.Windows.Threading.ExceptionWrapper.InternalRealCall+0x68
WindowsBase_ni!System.Windows.Threading.ExceptionWrapper.TryCatchWhen+0x36
WindowsBase_ni!System.Windows.Threading.Dispatcher.LegacyInvokeImpl+0x172
WindowsBase_ni!MS.Win32.HwndSubclass.SubclassWndProc+0x152
WindowsBase_ni!MS.Win32.UnsafeNativeMethods.CallWindowProc+0x1
WindowsBase_ni!MS.Win32.HwndSubclass.DefWndProcWrapper+0x97
WindowsBase_ni!MS.Win32.UnsafeNativeMethods.CallWindowProc+0x1
WindowsBase_ni!MS.Win32.HwndSubclass.SubclassWndProc+0x1e2

Example

Expected behavior:
The render thread failure is not random and always renders on the correct thread.

Minimal repro:
https://github.com/AndreasBreuninger/ElementHost_RenderError
CrashDumps included.

Related issues
These issues seem to be related, but still different. They all rely on the HostVisual element.

wpf/128
wpf/3100
wpf/3567

Also checked the release notes of kb4562900-cumulative-update-for-net-framework

@RussKie
Copy link
Member

RussKie commented Oct 29, 2020

The stack trace is all WPF, so transferring there until it can be established the issue is in our code.

@vatsan-madhavan vatsan-madhavan transferred this issue from dotnet/winforms Oct 29, 2020
@ryalanms ryalanms added the Investigate Requires further investigation by the WPF team. label Jan 7, 2021
@AndreasBreuninger
Copy link
Author

Is there anything new regarding this ticket?

@ryalanms ryalanms added this to the 7.0.0 milestone Aug 27, 2021
@julian-di
Copy link

Hi this is still an issue are there any updates on this?

@lindexi
Copy link
Member

lindexi commented Dec 18, 2023

@julian-di Do you find the repro?

@julian-di
Copy link

julian-di commented Dec 18, 2023

@lindexi, what do you mean with repro?

@byayex
Copy link

byayex commented Mar 20, 2024

Are there any news on this?

@Tim-Bendig
Copy link

Are there any updates on this issue / underlaying problem ? Any approach how the bug can be solved or prevented ?

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. .NET Framework
Projects
None yet
Development

No branches or pull requests

8 participants