cefclient raises assertion for multi threaded message loop

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.

cefclient raises assertion for multi threaded message loop

Postby palaver » Tue Jan 19, 2016 6:41 am

I'm building the project on Visual Studio 2015. The sample cefclient project builds and runs nicely out of the box; however, adding the line

Code: Select all
settings.multi_threaded_message_loop = true;


Causes an assertion to be raised at the cef_shutdown() statement of CefShutdown(), when the application is closing. The same behaviour is observed if the --multi-threaded-message-loop flag is set from the command line.
Is this a bug?

Here's the trace:
Code: Select all
 [0119/161611:FATAL:non_thread_safe_impl.cc(16)] Check failed: CalledOnValidThread().


It seems like this has already been discussed in the link below, but again, I'm just opening the cefclient application as it is in the binaries website.

https://code.google.com/p/chromiumembedded/issues/detail?id=755
palaver
Techie
 
Posts: 36
Joined: Wed Nov 25, 2015 9:51 am

Re: cefclient raises assertion for multi threaded message lo

Postby magreenblatt » Tue Jan 19, 2016 2:17 pm

Setting multi_threaded_message_loop = true is not sufficient to use a multi-threaded message loop in cefclient. See all of the logic related to the --multi-threaded-message-loop command-line flag that cefclient implements. Then, pass --disable-extensions to avoid Debug build assertions on shutdown.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: cefclient raises assertion for multi threaded message lo

Postby palaver » Tue Jan 19, 2016 3:38 pm

The same debug assertion is taking place when I pass --multi-threaded-message-loop as a command line flag, without manually setting the value to true in the code, which is why I was confused. As for --disable-extensions, I'm not quite sure what it does. Where is it processed? And which CefSettings parameter (or other) does it set? The list of switch values doesn't have a value of "disable-extensions".

For the record, setting the disable-extensions flag worked in disabling the debug assertion.
palaver
Techie
 
Posts: 36
Joined: Wed Nov 25, 2015 9:51 am

Re: cefclient raises assertion for multi threaded message lo

Postby magreenblatt » Tue Jan 19, 2016 4:32 pm

magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: cefclient raises assertion for multi threaded message lo

Postby HarmlessDave » Thu Aug 11, 2016 2:13 pm

Is it safe to only add command_line->AppendSwitch("disable-extensions"); for debug builds, or is it also needed for release builds?

I ask because using it seems to turn off PDF support in 3.2526.1373.gb660893 -- with it included I do not get a call to bool ClientHandler::OnBeforePluginLoad() for PDF links, so I can't override it with *plugin_policy = PLUGIN_POLICY_ALLOW, and the PDF extensions do not show in the list of supported plugins.
HarmlessDave
Expert
 
Posts: 370
Joined: Fri Jul 11, 2014 2:02 pm

Re: cefclient raises assertion for multi threaded message lo

Postby magreenblatt » Fri Aug 12, 2016 8:27 am

The PDF viewer requires extensions support. You can use a Release build of libcef in your Debug build application if you don't want to see the assertions on shutdown.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: cefclient raises assertion for multi threaded message lo

Postby HarmlessDave » Fri Aug 12, 2016 12:51 pm

Thanks. It's good to know that it's safe to ignore the assertions in release builds. For now I've just wrapped the disable-extensions line in #ifdef _DEBUG so I can still use the debug libcef for all content except PDFs, then use a release build for testing PDFs.
HarmlessDave
Expert
 
Posts: 370
Joined: Fri Jul 11, 2014 2:02 pm


Return to Support Forum

Who is online

Users browsing this forum: Majestic-12 [Bot] and 44 guests