chromiumembedded / cef

Chromium Embedded Framework (CEF). A simple framework for embedding Chromium-based browsers in other applications.
https://bitbucket.org/chromiumembedded/cef/
Other
3.21k stars 455 forks source link

Linux: 100% CPU when using external-message-pump with Version 84+ #3002

Open magreenblatt opened 4 years ago

magreenblatt commented 4 years ago

Original report by Stephan Engelmann (Bitbucket: Stephan Engelmann).


This issue is related to Issue #2809. I already reported my findings there, but was unsure if it was the right place, as the ticket was already closed.

We tested the fix using the CEF Automated build cef_binary_84.4.1+gfdc7504+chromium-84.0.4147.105_linux64.tar.bz2.

After building the test applications and starting the cefclient application with the external message pump flag one core is always using 100% CPU.

./cefclient --external-message-loop

magreenblatt commented 4 years ago

Original comment by Stephan Engelmann (Bitbucket: Stephan Engelmann).


I removed a lot of possibly not relevant information from the ticket.

magreenblatt commented 3 years ago

Original comment by Salvador Diaz Fau (Bitbucket: salvadordf, GitHub: salvadordf).


We also detected this issue using CEF4Delphi demos in Linux with CEF 88.1.6

magreenblatt commented 3 years ago

Original comment by Salvador Diaz Fau (Bitbucket: salvadordf, GitHub: salvadordf).


I just tested this issue with the latest cefclient again (CEF 88.2.8) and I can reproduce it only when I execute this command :

./cefclient --multi-threaded-message-loop

If I remove the multi-threaded-message-loop switch then cefclient works perfectly and no core is used at 100%

Edit: fixed the command that reproduces this issue.

magreenblatt commented 4 years ago

Original changes by Stephan Engelmann (Bitbucket: Stephan Engelmann).


magreenblatt commented 4 years ago

Original changes by Stephan Engelmann (Bitbucket: Stephan Engelmann).


vadz commented 5 days ago

FWIW running ./cefclient --external-message-pump reproduces the problem even with the latest 128 beta. I've tried debugging this, but it's difficult without having debug information for Chromium code (is it possible to get binaries with it without building all of it oneself?), e.g. I can't see MessagePumpGlib internals at all. But from what I could see, the problem is that MessagePumpGlib::HandlePrepare() returns something different from -1 all the time, so glib main loop considers this source ready all the time.

IOW I don't think anything can be done about this without modifying MessagePumpGlib itself. Is it conceivable that it could be modified or does this mean (if true) that this bug just can't be fixed and external message pump under Linux will basically always remain unusable?

vadz commented 5 days ago

P.S. I forgot to mention, but using ./cefclient --multi-threaded-message-loop also pegs a CPU core, so there is no way to embed CEF inside another GUI application (which has to have its own message loop) at all AFAICS.