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

[Problem/Bug]: The WebView control is no longer valid because the browser process crashed #4452

Closed
Paulismo opened this issue Mar 26, 2024 · 4 comments
Assignees
Labels
bug Something isn't working regression Something used to work but doesn't anymore

Comments

@Paulismo
Copy link

Paulismo commented Mar 26, 2024

What happened?

A few of our big customer's employees(3-4 people) are currently facing an issue with the latest(122) version of the webview runtime and Microsoft.Web.WebView2 v1.0.1462.37. When they open our app they're faced with the following message:

System.InvalidOperationException: The WebView control is no longer valid because the browser process crashed.To work around this, please listen for the CoreWebView2.ProcessFailed event to explicitly manage the lifetime of the WebView2 control in the event of a browser failure.https://docs.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.core.corewebview2.processfailed
at Microsoft.Web.WebView2.Wpf.WebView2.VerifyBrowserNotCrashed()
at Microsoft.Web.WebView2.Wpf.WebView2.get_CoreWebView2()
at Microsoft.Web.WebView2.Wpf.WebView2.TabIntoCore(TraversalRequest request)
at System.Windows.Interop.HwndHost.System.Windows.Interop.IKeyboardInputSink.TabInto(TraversalRequest request)
at System.Windows.Input.KeyboardNavigation.Navigate(DependencyObject currentElement, TraversalRequest request, ModifierKeys modifierKeys, DependencyObject firstElement, Boolean fromProcessInputTabKey)
at System.Windows.FrameworkElement.MoveFocus(TraversalRequest request)
at System.Windows.Controls.TabItem.OnPreviewGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
at ActiproSoftware.Windows.Controls.Docking.AdvancedTabItem.OnPreviewGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.KeyboardDevice.TryChangeFocus(DependencyObject newFocus, IKeyboardInputProvider keyboardInputProvider, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
at System.Windows.Input.KeyboardDevice.Focus(DependencyObject focus, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
at System.Windows.Input.KeyboardDevice.Focus(IInputElement element)
at System.Windows.UIElement.Focus()
at System.Windows.Controls.TabItem.SetFocus()
at System.Windows.Controls.TabControl.OnSelectionChanged(SelectionChangedEventArgs e)
at ActiproSoftware.Windows.Controls.Docking.AdvancedTabControl.OnSelectionChanged(SelectionChangedEventArgs e)
at System.Windows.Controls.Primitives.Selector.InvokeSelectionChanged(List1 unselectedInfos, List1 selectedInfos)
at System.Windows.Controls.Primitives.Selector.SetSelectedHelper(Object item, FrameworkElement UI, Boolean selected)
at System.Windows.Controls.Primitives.Selector.NotifyIsSelectedChanged(FrameworkElement container, Boolean selected, RoutedEventArgs e)
at System.Windows.Controls.Primitives.Selector.OnSelected(Object sender, RoutedEventArgs e)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at ActiproSoftware.Windows.Controls.Docking.AdvancedTabItem.OnSelected(RoutedEventArgs e)
at System.Windows.Controls.TabItem.OnIsSelectedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
at System.Windows.Controls.TabItem.set_IsSelected(Boolean value)
at ActiproSoftware.Windows.Controls.Docking.AdvancedTabItem.s25(Object , InputPointerButtonEventArgs )
at ActiproSoftware.Windows.Input.InputAdapter.XIi(Object , InputEventArgs , InputPointerButtonKind )
at ActiproSoftware.Windows.Input.InputAdapter.TIh(Object , InputEventArgs )
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
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)

On a separate note, there are no webview runtime related child processes spawned as a result of us trying to open a webview browser window in our app on their machine. So I presume they're either killed before they can even show up in the task manager or they're being prevented from starting up at all.

We tried to look into the event viewer to see whether there is anything logged in there but didn't see anything even remotely related.

Please share some insights on what could we implement to help our users.

Importance

Moderate. My app's user experience is affected, but still usable.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

122.0.2365.92

SDK Version

1.0.1462.37

Framework

WPF

Operating System

Windows 10, Windows 11

OS Version

No response

Repro steps

There are no specific steps that we know of, it just doesn't work from the moment you open the app.
The issue is also pretty rare and for a little while it seemed to be fixed with no input from our side but then it broke again, I suspect that happened when the user switched from 121 to 122 or due to some change in user's machine, that were not disclosed, as they can't recall their actions before and after the problem went away and came back.

Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

Regression in newer Runtime

Last working version (if regression)

SDK 1.0.1462.37 Runtime 115

AB#49174522

@Paulismo Paulismo added the bug Something isn't working label Mar 26, 2024
@github-actions github-actions bot added the regression Something used to work but doesn't anymore label Mar 26, 2024
@victorhuangwq
Copy link
Collaborator

Could you attach a crash dump as a comment?

WV2 crash dumps are located in a subfolder of the app's user data folder (UDF): \EBWebView\Crashpad\reports. By default, the user data folder is created in the app's folder with a name like .exe.WebView2. Refer to Crash Diagnostics for more information.

Thanks!

@champnic
Copy link
Member

champnic commented Apr 2, 2024

@Paulismo We just checked in a change today that should resolves crashes stemming from "TabIntoCore", like your current stack does. It should be available for you to test out in our next prerelease SDK. Thanks!

@Paulismo
Copy link
Author

Paulismo commented Apr 3, 2024

Hi Victor, sorry but we're still waiting for the crash dump.

@Paulismo
Copy link
Author

Paulismo commented Apr 3, 2024

@champnic Thanks for the good news, I will send a new build to our user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regression Something used to work but doesn't anymore
Projects
None yet
Development

No branches or pull requests

5 participants