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 newly added FailureSourceModulePath string in the SDK of 1.0.2164 prerelease will throw an exception #4119

Closed
sln162 opened this issue Nov 2, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@sln162
Copy link

sln162 commented Nov 2, 2023

What happened?

The SDK version 1.0.2164 pre release has added a string FailureSourceModulePath, which means: contains full path of the module that caused the crash in cases of Windows code integrity failures

The required runtime version is 120.0.2164.0. Running above this version has no problem and can output normally. However, when used in WV2 of v118, the program will throw an exception, as shown in the following figure.

image
image

When using this string, it is necessary to first determine the version of its WV2. If used directly, such as to determine whether the string is empty, this exception will be thrown. I think this is a bug because there must be WV2 versions earlier than v120 among many users. As long as this character string is used without determining the version of WV2, the program will exception.

I think,Instead of informing all developers that when using FailureSourceModulePath, it is important to first determine the version, why not it is better to make a judgment in the SDK,alternatively, errors should not be thrown at all.

Error Stack:

************** 异常文本 **************
System.InvalidCastException: 无法将类型为“System.__ComObject”的 COM 对象强制转换为接口类型“Microsoft.Web.WebView2.Core.Raw.ICoreWebView2ExperimentalProcessFailedEventArgs”。此操作失败的原因是对 IID 为“{A9FC1AF8-F934-4F0F-A788-7BE0808C329B}”的接口的 COM 组件调用 QueryInterface 因以下错误而失败: 不支持此接口 (异常来自 HRESULT:0x80004002 (E_NOINTERFACE))。
   在 Microsoft.Web.WebView2.Core.CoreWebView2ProcessFailedEventArgs.get__nativeICoreWebView2ExperimentalProcessFailedEventArgs()


************** 已加载的程序集 **************
mscorlib
    程序集版本:4.0.0.0
    Win32 版本:4.8.9181.0 built by: NET481REL1LAST_C
    基本代码:file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
**
    程序集版本:1.1.9.9
    Win32 版本:1.1.9.9
    基本代码:file://192.168.31.1/Generic_Flash_Disk(761D)/Debug/**.exe
----------------------------------------
System
    程序集版本:4.0.0.0
    Win32 版本:4.8.9172.0 built by: NET481REL1LAST_C
    基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
    程序集版本:4.0.0.0
    Win32 版本:4.8.9181.0 built by: NET481REL1LAST_C
    基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    程序集版本:4.0.0.0
    Win32 版本:4.8.9037.0 built by: NET481REL1
    基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Microsoft.Web.WebView2.Core
    程序集版本:1.0.2164.0
    Win32 版本:1.0.2164.0
    基本代码:file://192.168.31.1/Generic_Flash_Disk(761D)/Debug/Microsoft.Web.WebView2.Core.DLL
----------------------------------------
System.Core
    程序集版本:4.0.0.0
    Win32 版本:4.8.9200.0 built by: NET481REL1LAST_C
    基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Configuration
    程序集版本:4.0.0.0
    Win32 版本:4.8.9037.0 built by: NET481REL1
    基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    程序集版本:4.0.0.0
    Win32 版本:4.8.9037.0 built by: NET481REL1
    基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.resources
    程序集版本:4.0.0.0
    Win32 版本:4.8.9037.0 built by: NET481REL1
    基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.resources/v4.0_4.0.0.0_zh-Hans_b77a5c561934e089/System.resources.dll
----------------------------------------
Microsoft.Web.WebView2.WinForms
    程序集版本:1.0.2164.0
    Win32 版本:1.0.2164.0
    基本代码:file://192.168.31.1/Generic_Flash_Disk(761D)/Debug/Microsoft.Web.WebView2.WinForms.DLL
----------------------------------------
StripStatusLabel
    程序集版本:1.0.0.0
    Win32 版本:1.0.0.0
    基本代码:file://192.168.31.1/Generic_Flash_Disk(761D)/Debug/StripStatusLabel.DLL
----------------------------------------
System.Windows.Forms.resources
    程序集版本:4.0.0.0
    Win32 版本:4.8.9037.0 built by: NET481REL1
    基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms.resources/v4.0_4.0.0.0_zh-Hans_b77a5c561934e089/System.Windows.Forms.resources.dll
----------------------------------------
BrotliSharpLib
    程序集版本:0.3.2.0
    Win32 版本:0.3.3
    基本代码:file://192.168.31.1/Generic_Flash_Disk(761D)/Debug/BrotliSharpLib.DLL
----------------------------------------
Newtonsoft.Json
    程序集版本:13.0.0.0
    Win32 版本:13.0.3.27908
    基本代码:file://192.168.31.1/Generic_Flash_Disk(761D)/Debug/Newtonsoft.Json.DLL
----------------------------------------
System.Numerics
    程序集版本:4.0.0.0
    Win32 版本:4.8.9037.0 built by: NET481REL1
    基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
System.Runtime.Serialization
    程序集版本:4.0.0.0
    Win32 版本:4.8.9037.0 built by: NET481REL1
    基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Serialization/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll
----------------------------------------
System.Data
    程序集版本:4.0.0.0
    Win32 版本:4.8.9191.0 built by: NET481REL1LAST_C
    基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
mscorlib.resources
    程序集版本:4.0.0.0
    Win32 版本:4.8.9037.0 built by: NET481REL1
    基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/mscorlib.resources/v4.0_4.0.0.0_zh-Hans_b77a5c561934e089/mscorlib.resources.dll
----------------------------------------
Microsoft.GeneratedCode
    程序集版本:1.0.0.0
    Win32 版本:4.8.9037.0 built by: NET481REL1
    基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

Importance

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

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

118.0.2088.76

SDK Version

1.0.2164-release

Framework

Winforms

Operating System

Windows 10, Windows 11

OS Version

No response

Repro steps

image

To call FailureSourceModulePath normally, it is necessary to first determine e ExitCode==-1073740760, here is to do a test, place it here, and then terminate the WV2 process from the task manager

Regression

Don't know

Last working version (if regression)

No response

@sln162 sln162 added the bug Something isn't working label Nov 2, 2023
@sln162
Copy link
Author

sln162 commented Nov 2, 2023

@vbryh-msft Can you add a judgment in the SDK instead of throwing an exception? For developers, we don't know if calling it will result in an exception. There is no prompt for this field, and there is no explanation in the official documentation.

image
image

Do we still need to write like this?
image

@vbryh-msft vbryh-msft self-assigned this Nov 2, 2023
@vbryh-msft
Copy link
Contributor

@sln162 this behavior is by design - you can find more about using new APIs here . One more doc about using runtimes.

@sln162
Copy link
Author

sln162 commented Nov 2, 2023

@vbryh-msft However, this is just a string. For developers, subconsciously, they don't think it will also throw exceptions. Can it return null without throwing exceptions when it's not supported?

@sln162
Copy link
Author

sln162 commented Nov 4, 2023

Adding a try to the string is not a difficult thing, I just made a personal suggestion. Close this issue, because you already know this, thank you.

@sln162 sln162 closed this as completed Nov 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants