infrequent crash in libcef.dll on shutdown in simple test app

788 views
Skip to first unread message

J Pierce

unread,
May 27, 2015, 6:18:30 PM5/27/15
to cefs...@googlegroups.com
Using CefSharp WPF 39.0.1 (x86) under Visual Studio 2013, I ran into crashing errors and created this simple test app (code at the end). This app starts up, loading google maps and then closes the window after a delay.

I then run the program 1,000 times from the command-line with:
for /l %f in (1,1,1000) do @testapp.exe && @echo %f && @sleep 7

Out of 1,000 runs, I get 8 crashes on shutdown that are of the sort:

Problem signature:
  Problem Event Name:    APPCRASH
  Application Name:    TestApp.exe
  Application Version:    1.0.0.0
  Application Timestamp:    55662259
  Fault Module Name:    libcef.dll
  Fault Module Version:    3.2171.2069.0
  Fault Module Timestamp:    5511ef73
  Exception Code:    80000003
  Exception Offset:    0013b2d0
  OS Version:    6.1.7601.2.1.0.256.48
  Locale ID:    1033
  Additional Information 1:    2c36
  Additional Information 2:    2c3604cc63615066c18b5988e846206d
  Additional Information 3:    97c6
  Additional Information 4:    97c6a9c8c371c03331461cc76e6c0fc4

This is similar to some other reports of crashes, though with the code 80000003 instead of the others reported. Can anyone find any fault with my test app? Am I doing something that might be causing this problem? I'm both knew to CefSharp and C# in general, so it's quite possible I'm missing something even in this simple app. I just wanted to check here before I go reporting it as a bug in CefSharp.

I will also note that I arrived here after running into a similar error in the Delphi DCEF3 wrapper for libcef. That one happened MUCH more frequently, around 5% in the best case scenario. And it was more likely to happen when loading google maps than a simple page like www.google.com.

------------------------------------------------
App.xaml.cs:
------------------------------------------------
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using CefSharp;

namespace TestApp
{
    public partial class App : Application
    {
        public App()
        {
            Cef.Initialize(new CefSharp.CefSettings());
        }
    }
}


------------------------------------------------
MainWindow.xaml:
------------------------------------------------
<Window x:Class="TestApp.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:cefSharp="clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf"
        WindowStartupLocation="CenterScreen"
        WindowState="Minimized"
        Title="TestApp" Height="350" Width="300">
    <cefSharp:ChromiumWebBrowser x:Name="web"/>   
</Window>
 

------------------------------------------------
MainWindow.xaml.cs:
------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using CefSharp;
using CefSharp.Wpf;
using System.Windows.Threading;

namespace TestApp
{
    public partial class MainWindow : Window
    {
        public Window wind;

        public MainWindow()
        {
            InitializeComponent();

            wind = this;

            web.Address = "http://maps.google.com/";
            web.FrameLoadEnd += web_FrameLoadEnd;
        }

        void web_FrameLoadEnd(object sender, FrameLoadEndEventArgs e)
        {
            DispatcherTimer timer = new DispatcherTimer();
            timer.Interval = TimeSpan.FromMilliseconds(5000);
            timer.Tick += TimerTick;
            timer.Start();
        }

        private void TimerTick(object sender, EventArgs e)
        {
            DispatcherTimer timer = (DispatcherTimer)sender;
            timer.Stop();
            timer.Tick -= TimerTick;

            wind.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.SystemIdle, new TimeSpan(0, 0, 0, 1),
                new Action(
                    delegate()
                        {
                            wind.Close();
                        }
                )
            );
        }
    }
}



Alex Maitland

unread,
May 28, 2015, 4:45:55 AM5/28/15
to cefs...@googlegroups.com
Try downloading the `CEF` symbols

https://github.com/cefsharp/cef-binary/releases/tag/v3.2171.2069

If it happens most of the time then it maybe a bug in the underlying `CEF` framework, in which case it would need to be reported upstream.

J Pierce

unread,
May 28, 2015, 10:39:01 AM5/28/15
to cefs...@googlegroups.com
Thanks for that. Are they useful for diagnostics outside of the debugger, thought? Like I said, it happens 0.8% of the time, so definitely not "most"! So getting it to happen in the debugger would be quite difficult. Will any of the debug logging use the symbols?

Does my test code look legitimate? Nothing there that I'm obviously screwing up?

Another thing I'll note is that if you turn off Windows Error reporting by setting HKEY_CURRENT_USER\Software\Microsoft\Windows\Windows Error Reporting\DontShowUI=1, you never see these errors. So i wonder if some people never get them because that's off (I find the "helpful" dialog to be rather annoying most of the time).

The other thing I'm looking at is adding more debug logging. Right now it's just on the default logging level and there's nothing suspicious showing up for the runs where it crashes versus the others. If you have any suggestions on that, I'm all ears.

J Pierce

unread,
May 28, 2015, 12:51:57 PM5/28/15
to cefs...@googlegroups.com
I successfully turned on verbose logging and captured a specific instance of the crashing app (had to do some voodoo with naming each run a different EXE and logging to a unique file so they wouldn't all muddle together).  Here it is:
http://pastebin.com/raw.php?i=JxRV2cjp

I've now got the symbols downloaded and will be trying to debug the session when it crashes. I THINK just having the libcef.dll.pdb in the dir with libcef.dll (and my app, etc.) will be enough for it to pick those up. I'm new at this so please correct me if I'm wrong.

Also, I assume I'm just really looking for a call stack dump once I'm debugging. I'm not sure what else I can usefully divine from it.


On Thursday, May 28, 2015 at 3:45:55 AM UTC-5, Alex Maitland wrote:

J Pierce

unread,
May 28, 2015, 1:10:36 PM5/28/15
to cefs...@googlegroups.com
Well, debugging (with the symbols) didn't really do all that much for me. The app crashed and on the error box, I clicked the Debug option and chose my VS 2013 window that I had compiled the app in. It switched to the window, but the test program had already exited so it didn't actually debug anything at all.

In case it's helpful to compare against the other one, here's the log of a successful run:
http://pastebin.com/raw.php?i=yTQzfLTR

Here's the crashing one again:
http://pastebin.com/raw.php?i=JxRV2cjp

They diverge after
[0528/120357:WARNING:message_in_transit_queue.cc(18)] Destroying nonempty message queue

The successful one goes on to dump some performance info and the failed one prints:
[0528/120402:FATAL:url_request_context.cc(107)] Check failed: false. Leaked 1 URLRequest(s). First URL: https://www.google.com/gen_204?v=3&s=tactile&action=bootstrap_performance_flow&tran=15&cad=ifps:11.76,tt:0,fps:34.58,cr:wccf1,ct:2,jsv:73.0,cz:15,w:1,h:11,drv:m&e=10200084,10200889,10200898,10200982,10201040,10201082,10201086,10201102,10201138,10201178,10201180,10201191,10201197,10201200,10201203,10201206,10201208&atyp=csi&ei=eUpnVbOQCYbYtQWY3oH4Ag&rt=fbp.494,ff1t.2427,ffht.2427,ffat.2427,apr.3470,bg0.6805,tbc.6824,adt.6824,prt.6825.

J Pierce

unread,
May 29, 2015, 12:12:08 PM5/29/15
to cefs...@googlegroups.com
I wound up posting to the CEF forum and it appears to be a bug in 3.2171.2069:
http://www.magpcss.org/ceforum/viewtopic.php?f=6&t=13044

It's fixed in 3.2357, apparently. Now I just need a CefSharp that supports that.


On Thursday, May 28, 2015 at 3:45:55 AM UTC-5, Alex Maitland wrote:
Reply all
Reply to author
Forward
0 new messages