Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message loop work hangs in wxPython / Qt examples on Mac. Fixed in examples. Needs further debugging in next releases. #442

Open
cztomczak opened this issue Jul 31, 2018 · 8 comments

Comments

@cztomczak
Copy link
Owner

cztomczak commented Jul 31, 2018

These examples freeze during initial loading or later when typing something on a page. Issues occurs in v66.0 on Mac 10.9.

Temporary solution
See Migration Guide doc "v66+ Changes to Mac apps that integrate into existing message loop (Qt, wxPython)":
https://github.com/cztomczak/cefpython/blob/master/docs/Migration-guide.md#v66-changes-to-mac-apps-that-integrate-into-existing-message-loop-qt-wxpython

Reported problem on the CEF Forum in many details:
https://magpcss.org/ceforum/viewtopic.php?f=6&t=16181

I can see ERROR:gpu_process_transport_factory.cc(1017)] Lost UI shared context error message in console, however this message doesn't seem to be the cause, as I also see this message when running hello_world.py example and it works fine.

The Lost UI shared context error can be safely ignored according to:
https://stackoverflow.com/questions/49094399/chromedriver-showing-lost-ui-shared-context

hello_world.py, screenshot.py and tutorial.py examples do work fine on Mac.

I can also see ERROR:command_buffer_proxy_impl.cc(133)] ContextResult::kTransientFailure: Failed to send GpuChannelMsg_CreateCommandBuffer.

Passing disable-gpu and disable-gpu-compositing switches to cef.Initialize does not help. However it seems that the ContextResult::kTransientFailure.. error message disappears after these switches are passed (though more testing needed if it's just luck).

Issue is not related to recent Cython dupate, as I've tested both 0.25.2 and 0.28.4 and the issue occurs in both.

TODO: Compare cefpython/src/subprocess/main_message_loop* files with cef/tests/shared/browser/main_message_loop* files. These files may have been changed after v66 update.

@cztomczak cztomczak added this to the v66 milestone Jul 31, 2018
@cztomczak cztomczak changed the title qt.py PySide and wxpython.py examples freeze randomly on Mac Message loop hangs in wxPython / Qt examples on Mac Aug 7, 2018
@cztomczak cztomczak changed the title Message loop hangs in wxPython / Qt examples on Mac Message loop work hangs in wxPython / Qt examples on Mac Aug 7, 2018
cztomczak added a commit that referenced this issue Aug 7, 2018
Enable external message pump to temporarily fix Issue #442.
@cztomczak
Copy link
Owner Author

Examples qt.py and wxpython.py fixed in rev b20c79b by enabling external message pump. This is just a temporary solution that combines two different approaches of integrating message loop at the same time: 1. Do message loop work in a timer 2. Enable external message pump. A correct approach is to do only one of these and not both at the same time.

@cztomczak cztomczak changed the title Message loop work hangs in wxPython / Qt examples on Mac Message loop work hangs in wxPython / Qt examples on Mac. Temporary solution: enable external message pump and also run message loop work in a timer. Aug 7, 2018
@cztomczak cztomczak changed the title Message loop work hangs in wxPython / Qt examples on Mac. Temporary solution: enable external message pump and also run message loop work in a timer. Message loop work hangs in wxPython / Qt examples on Mac. Temporary fix: enable external message pump and also run message loop work in a timer. Aug 7, 2018
cztomczak added a commit that referenced this issue Aug 7, 2018
integrate into existing message loops (Qt, wxPython) (#442).
@cztomczak
Copy link
Owner Author

Migration Guide document was updated.

@cztomczak
Copy link
Owner Author

cztomczak commented Aug 7, 2018

Further debugging of the issue:

cztomczak added a commit that referenced this issue Aug 8, 2018
Minor fix to CefAppProtocol implementation, see CEF Forum
topic for details.

Updated Qt example so that message loop work is not
called in a timer when message pump is enabled. This
is not required.

In wxPython apps it is still required to enable both
message pump and message looper timer work.
@cztomczak cztomczak changed the title Message loop work hangs in wxPython / Qt examples on Mac. Temporary fix: enable external message pump and also run message loop work in a timer. Message loop work hangs in wxPython / Qt examples on Mac Aug 14, 2018
@cztomczak cztomczak changed the title Message loop work hangs in wxPython / Qt examples on Mac Message loop work hangs in wxPython / Qt examples on Mac. Fixed in examples. Needs further debugging in next releases. Aug 16, 2018
@cztomczak
Copy link
Owner Author

Fixes to CefAppProtocol did not change anything. Need to debug this further in v68+ release and on Mac 10.10.

@cztomczak
Copy link
Owner Author

Fixes to external message pump in upstream CEF:
https://bitbucket.org/chromiumembedded/cef/commits/869efa1

@cztomczak
Copy link
Owner Author

@cztomczak
Copy link
Owner Author

Maybe related issue reported on CEF Forum:
https://magpcss.org/ceforum/viewtopic.php?f=6&t=17118

@cztomczak
Copy link
Owner Author

It seems the issue on Mac was that Chromium was messing with NSTimer, so that all wxTimers stop working. See for more details https://www.magpcss.org/ceforum/viewtopic.php?f=6&t=17118 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant