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]: ICoreWebView2Controller invalid read on Close() C++ #4773

Closed
brandon-chan0400 opened this issue Aug 27, 2024 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@brandon-chan0400
Copy link

What happened?

I have implemented an embedded browser that inherits from CWnd, using the C++ SDK, and am getting an invalid read error upon closing the ICoreWebView2Controller class object.

*** ERROR: Access violation
+++ Invalid read from FFFFFFFFFFFFFFFF
rsp: 89f91fa890, rip: 7ffd40440d62, rbp: 7db800287530
rsi: 7db800269d48, rdi: 7db800269d40
rax: 6f007200620062, rbx: 1, rcx: 27067ab69c8, rdx: 0
r8: 0, r9: 7ffd4064cf70, r10: 1, r11: 1
r12: 7db8002e10f0, r13: 7db800287530, r14: 7db800256940, r15: 7db800256958

Within the CWnd::OnDestroy function override, I am trying to shut down the ICoreWebView2Controller object when I get this error and I believe that I have removed all the event handlers I added. Additionally, I have implemented my own host interop object that interacts with the browser. I believe it should've been deleted correctly.

Below is the stack trace that I am getting before running into this critical error.
image

I have other embedded browser instances that run JavaScript but close correctly. What could be the cause for this issue?

Importance

Blocking. My app's basic functions are not working due to this issue.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

127.0.2651.105

SDK Version

1.0.2151.40

Framework

Win32

Operating System

Windows 11

OS Version

No response

Repro steps

  1. The implemented web browser initialises and connects a host interop object between the web code and WebView2 objects.
  2. Some JS runs and the host interop object completes its calls.
  3. Implemented web browser is attempted to be shut down. Error is produced at this step

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

@brandon-chan0400 brandon-chan0400 added the bug Something isn't working label Aug 27, 2024
@brandon-chan0400
Copy link
Author

Found fix on my side

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

1 participant