Bug 1872270 - WebKit renderer hangs on Cockpit
Summary: WebKit renderer hangs on Cockpit
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: libsoup
Version: 8.3
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: 8.3
Assignee: Michael Catanzaro
QA Contact: Desktop QE
Depends On:
TreeView+ depends on / blocked
Reported: 2020-08-25 10:53 UTC by Martin Pitt
Modified: 2020-11-04 01:37 UTC (History)
11 users (show)

Fixed In Version: libsoup-2.62.3-2.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2020-11-04 01:35:59 UTC
Type: Bug
Target Upstream Version:

Attachments (Terms of Use)
simple webkit/python browser (1.84 KB, text/x-python)
2020-08-25 10:53 UTC, Martin Pitt
no flags Details
cockpit (169.00 KB, image/png)
2020-08-27 10:09 UTC, Archana Pandey
no flags Details

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2020:4451 0 None None None 2020-11-04 01:36:54 UTC

Description Martin Pitt 2020-08-25 10:53:17 UTC
Created attachment 1712515 [details]
simple webkit/python browser

Description of problem: In bug 1841104 we got a report that cockpit-desktop does not work properly on RHEL 8.3: The login page still works, but as soon as it connects to the websocket, page hangs or even stays blank.

Version-Release number of selected component (if applicable):


How reproducible: Always

Steps to Reproduce:
1. /usr/libexec/cockpit-desktop /

Or alternatively, use the attached script:
1. sudo systemctl start cockpit.socket
2. ./pywebkit http://localhost:9090
3. Log in as your user

Actual results:
 - In the pywebkit reproducer, the login page works. The login page does not appear with cockpit-desktop (deliberately).
- Webkit window opens and stays empty.

Expected results: webkit window renders cockpit.

Additional info:
 * As the login page works, I suspect this is somehow related to cockpit's websocket -- the "main" pages all require that, but the login page doesn't.

 * ./pywebkit works fine for other pages like https://google.com or https://redhat.com

 * This works fine on Fedora 32, both with epiphany and cockpit-desktop and ./pywebkit. Fedora 32 has the same webkit2gtk3 upstream version.

 * I can't test epiphany on RHEL 8.3, as it's not in RHEL nor EPEL, and installing the Fedora 32 package fails due to dependencies.

 * Firefox works fine with cockpit. But cockpit-desktop prefers webkit to avoid all the browser chrome (it sets up a little network namespace sandbox, so that cockpit is the *only* thing that the page can access -- it's supposed to feel like a desktop app).

 * There are on console messages related to this.

Do you have any hint how to debug that further? Without error messages or console logs I don't know how to proceed here.


Comment 1 Michael Catanzaro 2020-08-26 18:48:33 UTC
(In reply to Martin Pitt from comment #0)
> The login page still works, but as soon
> as it connects to the websocket, page hangs or even stays blank.

It's a good thing you mentioned websocket, otherwise this would have been hard. Here's what I did:

 * Tested your pywebkit script on RHEL 8.2 and verifies it works fine.
 * Installed webkit2gtk3 from RHEL 8.3 on my RHEL 8.2 system and verified it breaks cockpit
 * Installed a hacked up scratch build of libsoup 2.70.0 and verified it fixes cockpit
 * Breathed sigh of relief. Thank goodness!

The problem is likely caused by https://trac.webkit.org/changeset/248099/webkit. We switched from WebKit's cross-platform WebSockets implementation to libsoup's implementation. And our libsoup in RHEL is old and missing a couple dozen WebSocket fixes. So we could either revert that change in WebKit, or figure out what commit in libsoup we need to fix this. Fixing libsoup is almost surely going to be a smaller, easier, and safer change, so next I'll try to figure out which commit in libsoup is needed. So far, I know that the issue was fixed somewhere between 2.62.3 (RHEL 8) and 2.70.0 (latest stable).

Shame we missed blocker/exception deadline, but late-breaking problems like this are what the exception process is for....

Comment 3 Michael Catanzaro 2020-08-26 21:57:35 UTC
OK, I bisected this down to https://gitlab.gnome.org/GNOME/libsoup/-/commit/35f1bac5ff9ec694e64b65e51f0e7a3226aa3aaf. I still need to test a scratch build to ensure that no other older commits are needed too, but that one solves this bug.

Comment 7 Martin Pitt 2020-08-27 05:07:06 UTC
Wow, thanks Michael! I woke up with wanting to do that bisect, and you figured it all out already! So I can at least help with the backporting and validation. That commit alone does not apply; fixing it wouldn't be too difficult, but usually it's preferable to backport a few more patches that then apply, so that the end result isn't entirely new code. I found that these three work, in that order:


(only need to drop the SOUP_AVAILABLE_IN_2_68 bit now).

I unfuzzed the patches, and sent https://src.osci.redhat.com/rpms/libsoup/pull-request/1 for your review. This also provides a scratch build and running tests and such. Of course feel free to ignore this and use your own workflow/commit.

I grabbed the x86_64 build from https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=30982707 , installed the rpm into my RHEL 8.3 desktop, and confirm that both "Red Hat Subscriptions" from the Activities menu as well as a direct "/usr/libexec/cockpit-desktop /" work fine now.

Comment 12 Archana Pandey 2020-08-27 10:09:07 UTC
Created attachment 1712800 [details]

Comment 21 Michal Odehnal 2020-09-04 12:33:46 UTC
Unable to reproduce with libsoup-2.62.3-2.el8.x86_64

Comment 24 errata-xmlrpc 2020-11-04 01:35:59 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: GNOME security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.