MicrosoftEdge / MicrosoftEdge/WebView2Feedback

Browser process crash in idle mode

Open
#4,141 7 comments 1 reaction 1 assignee View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PowerShell
Stars
526
Forks
67
PR merge metrics
No merged PRs in 30d

Description

What happened?

We have Edge Webview2 integrated in our Windows desktop app, and on receiving the CoreWebView2Environment.NewBrowserVersionAvailable event, we recreate the CoreWebView2Environment and WebView2 instances.
This has been working fine for us for more than a year, but recently we observed the issue on 2 systems that the NewBrowserVersionAvailable event is getting raised while the laptop is in an idle mode.

  • The laptop was locked and left idle overnight, but it appears it did not go to sleep, since we did not get the SystemEvents.PowerModeChanged with PowerModes.Suspend. But from our logs it appears to be running code at reduced frequency since there are gaps of few hours in between.

  • While in this mode, we got the NewBrowserVersionAvailable. CoreWebView2Environment.CreateAsync() completed successfully, and we proceeded with the Webview2 creation. But WebView2.CoreWebView2InitializationCompleted event was received after 1 hour, and then we got the exception "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"

  • We do not have the process dump available.

  • Note: On running the command "powercfg -waketimers" on the laptop, we got the message "There are no active wake timers in the system.".

  • Is this something that can be fixed from Edge Webview2, or is there any event we can listen to which would indicate this kind of idle mode?

Importance

Important. My app's user experience is significantly compromised.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

117.0.2045.47

SDK Version

No response

Framework

WPF

Operating System

Windows 10

OS Version

Build 19044

Repro steps

On receiving the CoreWebView2Environment.NewBrowserVersionAvailable event in idle mode, recreate the CoreWebView2Environment and WebView2 instances.
Expected: CoreWebView2Environment and Webview2 should be initialized successfully.
Observed: Delayed Webview2 initialization, and then crash.

Regression

Don't know

Last working version (if regression)

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.