Repository navigation
Message loop work hangs in wxPython / Qt examples on Mac. Fixed in examples. Needs further debugging in next releases. #442
Description
Activity
- changed the title
[-]qt.py PySide and wxpython.py examples freeze randomly on Mac[/-][+]Message loop hangs in wxPython / Qt examples on Mac[/+]on Aug 7, 2018 - changed the title
[-]Message loop hangs in wxPython / Qt examples on Mac[/-][+]Message loop work hangs in wxPython / Qt examples on Mac[/+]on Aug 7, 2018 - added a commit that references this issue
on Aug 7, 2018 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.
- 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.[/+]on Aug 7, 2018 - 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.[/+]on Aug 7, 2018 - added a commit that references this issue
on Aug 7, 2018 Migration Guide document was updated.
Further debugging of the issue:
- See CefAppProtocol implemented in cefsimple/cefclient:
https://github.com/chromiumembedded/cef/search?q=cefappprotocol&unscoped_q=cefappprotocol - See JCEFApplication implementation in java-cef project:
https://bitbucket.org/chromiumembedded/java-cef/src/master/native/util_mac.mm?fileviewer=file-view-default - See CefAppProtocol initially implemented by cefpython. There were some issues though, so
it might be that this wasn't implemented properly.
Mouse context menu and <select> control crash app on Mac #156 (comment) - See "util_mac.mm" for CEFPythonApplication implementation:
https://github.com/cztomczak/cefpython/blob/master/src/client_handler/util_mac.mm#L18 - MacInitialize is called in cef.Initialize:
Line 502 in 4e77c93
# Mac initialization. Need to call NSApplication.sharedApplication()
- See CefAppProtocol implemented in cefsimple/cefclient:
- added a commit that references this issue
on Aug 8, 2018 - 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[/+]on Aug 14, 2018 - 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.[/+]on Aug 16, 2018 Fixes to CefAppProtocol did not change anything. Need to debug this further in v68+ release and on Mac 10.10.
Fixes to external message pump in upstream CEF:
https://bitbucket.org/chromiumembedded/cef/commits/869efa1Maybe related issue reported on CEF Forum:
https://magpcss.org/ceforum/viewtopic.php?f=6&t=17118It 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 .
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 contexterror 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 contexterror 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-gpuanddisable-gpu-compositingswitches tocef.Initializedoes not help. However it seems that theContextResult::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 withcef/tests/shared/browser/main_message_loop*files. These files may have been changed after v66 update.