简体   繁体   English

CefSharp/Cef libcef.dll 堆栈溢出 (0xC00000FD)

[英]CefSharp/Cef libcef.dll stack overflow (0xC00000FD)

CefSharp Winforms Version 43.0.0.0, libcef.dll 3.2357.1287. CefSharp Winforms 版本 43.0.0.0,libcef.dll 3.2357.1287。

When selecting text in a text box, and then hitting a key on the on screen keyboard (does not happen on the normal keyboard), I sometimes get a stack overflow in libcef.dll.在文本框中选择文本,然后按屏幕键盘上的键(在普通键盘上不会发生)时,有时会在 libcef.dll 中出现堆栈溢出。

I am ripping my hair out trying to isolate the cause.我正在扯头发试图找出原因。 One thing that is slowing me down is the inability to connect a proper pdb file to the dll.让我慢下来的一件事是无法将正确的 pdb 文件连接到 dll。 Despite downloading all variations of it from CefBuilds .尽管从CefBuilds下载了它的所有变体。

I have various crash dumps, and was wondering if anybody else has had experience troubleshooting this kind of thing.我有各种故障转储,想知道是否有其他人有解决此类问题的经验。 WinDBG may as well be chinese, with DebugDiag being much easier to follow, but without the valid pdb file neither are any use at all. WinDBG 也可能是中文的,DebugDiag 更容易理解,但没有有效的 pdb 文件,两者都没有任何用处。

I cannot recreate the issue in the winform example application, so its definitely local to us, so I am currently ripping code out left right and center to isolate the cause, but would really appreciate some guidance on how to load the pdb file into debugdiag to stop this:我无法在 winform 示例应用程序中重新创建该问题,因此它绝对是我们本地的,所以我目前正在将代码从左到右和中间撕开以隔离原因,但非常感谢有关如何将 pdb 文件加载到 debugdiag 中的一些指导停止这个:

调试诊断错误

Despite this:尽管如此:

在此处输入图片说明

libcef.dll version: libcef.dll 版本:

在此处输入图片说明

For anyone interested, this is the current crashing thread's stack trace:对于任何感兴趣的人,这是当前崩溃线程的堆栈跟踪:

在此处输入图片说明

... and on and on and on... ……等等…………

I guess the main question is does anybody know what could be causing the stack overflow?我想主要问题是有人知道是什么导致堆栈溢出吗? (This problem existed in 41.0.0 in the winform example application, now it only exists within our own application in 43.0.0). (这个问题在winform示例应用41.0.0中存在,现在只存在于我们自己的43.0.0应用中)。

With a secondary question of why aren't the pdb files loading in debugdiag.第二个问题是为什么 pdb 文件没有在 debugdiag 中加载。

Edit.编辑。 I am compiling in 32bit, and it appears there is no pdb file for the 32 bit edition of libcef.dll v3.2357.1287.我在 32 位编译,似乎没有 libcef.dll v3.2357.1287 的 32 位版本的 pdb 文件。 In fact, according to cefbuilds.com this file does not exist.事实上,根据cefbuilds.com 这个文件是不存在的。

It appeared that although I couldn't re-create the issue using the winform example's main form, I could whilst using its SimpleBrowserForm.cs.看来虽然我无法使用 winform 示例的主窗体重新创建问题,但我可以在使用它的 SimpleBrowserForm.cs 时。

This allowed me to compare the different implementations.这使我能够比较不同的实现。

In the main form, once the browser control is initialised, a hacky message loop interceptor is created, to pass internal WM_MOUSEACTIVATE events up to the parent container.在主窗体中,一旦浏览器控件被初始化,就会创建一个 hacky 消息循环拦截器,将内部 WM_MOUSEACTIVATE 事件传递给父容器。 This appears to be an effort to ensure that if a context menu is open at the time the click is received, it will be closed by the click event (chromium suppresses internal mouse clicks it seems).这似乎是为了确保如果在接收到单击时打开上下文菜单,它将被单击事件关闭(铬似乎抑制了内部鼠标单击)。

private void OnIsBrowserInitializedChanged(object sender, IsBrowserInitializedChangedEventArgs args)
    {
        if (args.IsBrowserInitialized)
        {
            ChromeWidgetMessageInterceptor.SetupLoop((ChromiumWebBrowser)Browser, (message) =>
            {
                const int WM_MOUSEACTIVATE = 0x0021;
                const int WM_NCLBUTTONDOWN = 0x00A1;

                if (message.Msg == WM_MOUSEACTIVATE) {
                    // The default processing of WM_MOUSEACTIVATE results in MA_NOACTIVATE,
                    // and the subsequent mouse click is eaten by Chrome.
                    // This means any .NET ToolStrip or ContextMenuStrip does not get closed.
                    // By posting a WM_NCLBUTTONDOWN message to a harmless co-ordinate of the
                    // top-level window, we rely on the ToolStripManager's message handling
                    // to close any open dropdowns:
                    // http://referencesource.microsoft.com/#System.Windows.Forms/winforms/Managed/System/WinForms/ToolStripManager.cs,1249
                    var topLevelWindowHandle = message.WParam;
                    PostMessage(topLevelWindowHandle, WM_NCLBUTTONDOWN, IntPtr.Zero, IntPtr.Zero);
                }
            });
        }
    }

Anyway, with this weird little hack in place, my stack overflow crash goes away.无论如何,有了这个奇怪的小技巧,我的堆栈溢出崩溃就消失了。

I have raised a github ticket to try get the underlying issue resolved, but for now this is preventing the issue.我已经提出了一个github票来尝试解决潜在的问题,但现在这正在阻止这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM