WinForms - CefSharp 151.3.170 crashes in libcef.dll with 0xC0000005 when typing in HTML input fields
Is there an existing issue for this?
- [x] I have searched both open/closed issues, no issue already exists.
CefSharp Version
151.3.170
Operating System
Windows 11
Architecture
x64
.Net Version
.NET 4.8
Implementation
WinForms
Reproduction Steps
-
Run a CefSharp WinForms application using CefSharp.WinForms 151.3.170 on Windows 11 x64 with .NET Framework 4.8.
-
Create a ChromiumWebBrowser and navigate to a page containing a normal HTML text input, for example:
https://www.baidu.com/
-
Click the search input field.
-
Start typing several characters.
-
Continue typing/interacting with the text field and autocomplete suggestions.
-
The main application process intermittently terminates with:
3221225477 (0xC0000005) Access violation
There is no managed exception.
IRequestHandler.OnRenderProcessTerminated is not called.
The CEF log contains normal page/network activity immediately before the application terminates. There is no corresponding CEF FATAL or CHECK failure.
A native minidump captured from MyBrowser.exe shows:
Exception code: 0xC0000005 Operation: Read Invalid read address: 0x0000000000000010 Faulting module: libcef.dll Architecture: x64
The fault is consistent with a null-pointer dereference inside libcef.dll.
Most importantly, the exact same application, operating system, input method and webpages are stable after downgrading to CefSharp 150.0.110.
Expected behavior
Typing into standard HTML and
The behavior should be the same as CefSharp 150.0.110, where the same application and environment are stable.
Actual behavior
With CefSharp 151.3.170, the main WinForms process intermittently crashes while typing in an HTML input field.
The process exit code is:
0xC0000005
A native minidump shows a read access violation inside libcef.dll:
Exception: 0xC0000005 Read address: 0x0000000000000010 Module: libcef.dll
No managed exception is raised and OnRenderProcessTerminated is not invoked.
Regression?
Yes.
This is reproducible as a version regression in the same application and environment:
CefSharp 150.0.110 - Stable CefSharp 151.3.170 - Crashes with 0xC0000005 in libcef.dll
No application code changes are required to make the crash disappear other than downgrading CefSharp from 151.3.170 to 150.0.110.
Known Workarounds
Downgrading to CefSharp 150.0.110 completely resolves the crash in our application.
Does this problem also occur in the CEF Sample Application
Yes using WinForms command line args
Other information
Additional investigation performed:
-
The application targets x64.
-
CefSharp.Common and CefSharp.WinForms are both version 151.3.170.
-
A clean browser cache/profile was tested.
-
The crash still occurred with GPU acceleration disabled:
settings.CefCommandLineArgs.Add("disable-gpu", "1"); settings.CefCommandLineArgs.Add("disable-gpu-compositing", "1");
-
Browser controls are explicitly disposed before their parent tabs/forms are disposed.
-
Manual Cef.Shutdown() during FormClosing was removed to rule out shutdown/lifetime ordering issues.
-
The crash happens while the browser is actively running, not during shutdown.
-
A custom OnRenderProcessTerminated handler was added, but it is not invoked before the process terminates.
Native dump details:
Exception code: 0xC0000005 Exception type: Read access violation Read address: 0x0000000000000010 Faulting module: libcef.dll Process: MyBrowser.exe Architecture: x64
The affected Windows environment also has a third-party Chinese IME installed, and TSF/IME related DLLs are loaded in the host process.
However, the same machine, same IME, same application and same websites are stable with CefSharp 150.0.110.
Only upgrading to CefSharp 151.3.170 causes the native crash, so this appears to be a regression in CEF/Chromium 151 text-input/IME handling.
I can provide the native minidump if required.
The fault is consistent with a null-pointer dereference inside libcef.dll.
If the problem reproduces with 151.3.240 then you'll need to raise an issue at https://github.com/chromiumembedded/cef
https://github.com/cefsharp/CefSharp/wiki/Trouble-Shooting#unmanaged-crashes-when-the-process-dies