cog
cog copied to clipboard
WPE/cog continues to run even after wayland compositor is gone
Use case
I’m building a kiosk-style appliance on the Ubuntu Core platform. I use Canonical’s mir-kiosk
snap which provides Mir display server as a Wayland compositor, and I have packaged WPE + cog as a browser snap [snapcraft.yaml source]. The appliance doesn’t have any keyboard attached, and does not use a GUI desktop.
Problem statement
Every time mir-kiosk
is refreshed (snap lingo for auto-update), the Mir display server is restarted. Thus, WPE/cog temporarily loses its wayland compositor, resulting in a black screen. That is expected and how snap refreshes work, but it leaves the browser in a defunct state even after mir-kiosk
comes back up. Restarting cog resolves the issue, but this is not very user-friendly for appliance-style use cases.
Debug settings:
export G_MESSAGES_DEBUG=all
export LIBGL_DEBUG=verbose
export WAYLAND_DEBUG=1
Log:
2020-04-20T08:59:13Z -[24019]: received frame 1 with 36 payload
2020-04-20T08:59:13Z -[24019]: message: delivering 1 with 36 length
# manual restart of mir-kiosk → wayland compositor goes away
2020-04-20T08:59:14Z -[24009]: Removed output 5 # <<---
2020-04-20T08:59:16Z -[24019]: received frame 1 with 36 payload
2020-04-20T08:59:16Z -[24019]: message: delivering 1 with 36 length
2020-04-20T08:59:19Z -[24019]: received frame 1 with 36 payload
2020-04-20T08:59:19Z -[24019]: message: delivering 1 with 36 length
2020-04-20T08:59:22Z -[24019]: received frame 1 with 36 payload
2020-04-20T08:59:22Z -[24019]: message: delivering 1 with 36 length
2020-04-20T08:59:25Z -[24019]: received frame 1 with 36 payload
The debug message originates here: https://github.com/Igalia/cog/blob/19a4ac9f31d19491b96eb87a72361d77dd39457b/platform/cog-platform-fdo.c#L1458
Am I missing something obvious? I looked through WebKit’s build flags and mir-kiosk’s configuration options, but can’t find a clue to what might be a proper fix for this.
Ping @philn who asked me on IRC to file this 😊 Thanks in advance!