[Problem/Bug]: "The group or resource is not in the correct state to perform the requested operation" when launching multiple instances
SkipperRobbins opened this issue · 4 comments
What happened?
On Windows Server OS (2016 and 2022 so far), when launching multiple instances of our app users occasionally see the following error:
I reviewed the following threads where this same error was reported, but I don't believe the situations described apply. For the first, our control appears to be initialized on the UI thread. For the latter, users run into this launching multiple instances of the same version of the app, not different versions, so the environment options should be the same.
I created the following lightweight project to simulate this behavior.
CrashDemo.zip
It's common for users to launch multiple instances of our app on Windows Server through virtualization platforms. We have been unable to reproduce this on Windows Desktop OS. I have crash dmps if those would be helpful.
************** Exception Text **************
System.Runtime.InteropServices.COMException (0x8007139F): The group or resource is not in the correct state to perform the requested operation. (0x8007139F)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
at Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateCoreWebView2ControllerAsync(IntPtr ParentWindow, CoreWebView2ControllerOptions options)
at Microsoft.Web.WebView2.WinForms.WebView2.InitCoreWebView2Async(CoreWebView2Environment environment, CoreWebView2ControllerOptions controllerOptions)
at CrashDemo.Form1.MainForm_Load(Object sender, EventArgs e) in C:\CrashDemo\Form1.cs:line 35
at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
Importance
Important. My app's user experience is significantly compromised.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
126.0.2592.113
SDK Version
1.0.2592.51
Framework
Winforms
Operating System
Windows Server
OS Version
2016, 2022
Repro steps
Package the attached demo app. On Windows Server OS (was able to reproduce on both 2016 and 2022) launch multiple instances of the executable concurrently. Occasionally, one of the launched instances will crash in the call to EnsureCoreWebView2Async().
Repros in Edge Browser
No, issue does not reproduce in the corresponding Edge version
Regression
Don't know
Last working version (if regression)
No response
Hi, @SkipperRobbins!
It seems that your issue contains the word "crash". If you have not already, 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): <UDF>\EBWebView\Crashpad\reports\. By default, the user data folder is created in the app's folder with a name like <App Exe Name>.exe.WebView2. Refer to Crash Diagnostics for more information.
Thank you for your cooperation!
Unfortunately, there were no crash dumps in the <UDF>\EBWebView\Crashpad\reports\ directory. I generated dumps of the CrashDemo and msedgewebview2 processes through task manager while the dialog was up, if that would be helpful. Though, looking at the stack it seems the exception code is gone.
Thanks for reporting the bug, and I can repro it. We will investigate and report back.
The issue has been fixed in Edge WebView2 Runtime version >= 129.0.2779.0. Edge 129 is scheduled to be released in Week of 19-Sep-2024.
