CEF freezing after upgrade

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

CEF freezing after upgrade

Postby kilo9delta » Sat Dec 19, 2020 9:14 am

I've upgraded my application from CEF79 to use the latest version CEF87 (87.0.4280.88). Ever since my application freezes randomly and is no longer usable.

It only seems to happen when a new browser is created.
How can I investigate that problem?

Details:
- Windows 10 x64, AMD Ryzen CPU, NVIDIA GPU
- Build from Spotify
- No sandbox
- OSR

Switches:
disable-gpu
disable-gpu-compositing
disable-gpu-vsync
off-screen-rendering-enabled
disable-gpu-shader-disk-cache = 1
autoplay-policy = no-user-gesture-required


Last messages from verbose cef log:
[1219/152047.010:VERBOSE1:dispatcher.cc(553)] Num tracked contexts: 0
[1219/152047.849:INFO:cpu_info.cc(53)] Available number of cores: 48
[1219/152047.851:VERBOSE1:script_context.cc(273)] Created context:
extension id: (none)
frame: 000001B809C822B8
URL:
context_type: WEB_PAGE
effective extension id: (none)
effective context type: WEB_PAGE
[1219/152047.852:VERBOSE1:script_context.cc(273)] Created context:
extension id: (none)
frame: 0000000000000000
URL:
context_type: UNSPECIFIED
effective extension id: (none)
effective context type: UNSPECIFIED
[1219/152047.852:VERBOSE1:dispatcher.cc(373)] Num tracked contexts: 1


Thank you!
kilo9delta
Newbie
 
Posts: 8
Joined: Thu Mar 07, 2019 10:34 am

Re: CEF freezing after upgrade

Postby digory » Mon Jan 04, 2021 1:39 am

digory
Expert
 
Posts: 118
Joined: Wed Oct 26, 2016 3:13 am

Re: CEF freezing after upgrade

Postby kilo9delta » Sat Jan 16, 2021 8:47 am



Thanks for your reply. I've read through those issues but in my case there is no increased memory or CPU usage.
I still have this problem described in my post. What else could I try to figure out what is going on?
kilo9delta
Newbie
 
Posts: 8
Joined: Thu Mar 07, 2019 10:34 am

Re: CEF freezing after upgrade

Postby magreenblatt » Sat Jan 16, 2021 9:52 am

What content are you loading? Does the problem reproduce with the cefclient sample application?
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: CEF freezing after upgrade

Postby kilo9delta » Sun Jan 24, 2021 6:27 am

magreenblatt wrote:What content are you loading? Does the problem reproduce with the cefclient sample application?


It's a pretty simple HTML page with CSS and some Javascript. But it also happens with different other HTML pages.
I've tried loading the same page with the cefclient but wasn't able to get a freeze there.

Maybe it's really up to my implementation because it didn't change much since CEF 59 (only changes to solve the breaking changes).
But I'm a bit stuck on how to debug this. Appreciate any tips or hints!
Thank you.
kilo9delta
Newbie
 
Posts: 8
Joined: Thu Mar 07, 2019 10:34 am

Re: CEF freezing after upgrade

Postby magreenblatt » Sun Jan 24, 2021 11:15 am

How are you running the CEF message loop?
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: CEF freezing after upgrade

Postby kilo9delta » Mon Jan 25, 2021 10:28 am

Here's the code:
https://pastebin.com/BhZCTN6p

Using the CefDoMessageLoopWork with OnScheduleMessagePumpWork method.
kilo9delta
Newbie
 
Posts: 8
Joined: Thu Mar 07, 2019 10:34 am

Re: CEF freezing after upgrade

Postby ndesktop » Mon Jan 25, 2021 11:10 am

I would say you are deadlocking in TickMessagePump. If the lock is acquired from OnScheduleMessagePumpWork or some other place, CefDoMessageLoopWork is locked.
I would rewrite (blindly) TickMessagePump as:
Code: Select all
void FCEFBrowserApp::TickMessagePump(float DeltaTime, bool bForce)
{
    bool should_loop = false;
    // scope the locking only to the variables and logic
    // and move CefRunMessageLoop outside locking
    {
        FScopeLock Lock(&MessagePumpCountdownCS);
 
        bool bPump = false;
        // count down in order to call message pump
        if (MessagePumpCountdown >= 0)
        {
            MessagePumpCountdown -= DeltaTime * 1000;
            if (MessagePumpCountdown <= 0)
            {
                bPump = true;
            }
        }
        if (bPump || bForce)
        {
            // -1 indicates that no countdown is currently happening
            MessagePumpCountdown = -1;
            should_loop = true;
        }
    }

    if(should_loop) {
        CefDoMessageLoopWork();
    }
}
ndesktop
Master
 
Posts: 756
Joined: Thu Dec 03, 2015 10:10 am

Re: CEF freezing after upgrade

Postby kilo9delta » Mon Jan 25, 2021 2:10 pm

Did some tests and I didn't get a freeze so far. I wonder why it worked before CEF79, did CefDoMessageLoopWork not trigger OnScheduleMessagePumpWork before?

Anyway, thank you so much!
kilo9delta
Newbie
 
Posts: 8
Joined: Thu Mar 07, 2019 10:34 am


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 49 guests