canonical / canonical/authd

E2E device-code browser crashes when GTK_PATH and GIO_MODULE_DIR leak from Snap VS Code

Open
#1,829 1 comment 0 reactions 1 assignee Claimed by @OrazioLucioTerranova View on GitHub
e2e-tests
Dominant language
Go
Stars
308
Forks
41
Avg merge
2d 4h
Merged PRs (30d)
58

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues and found none that matched mine

### Describe the issue

When the authd E2E tests are launched from a terminal belonging to the
Snap-packaged VS Code editor, device-code login flows can fail because the
host-side GTK/WebKit browser inherits VS Code's GTK and GIO module paths.

The E2E tests drive GDM inside a VM, but `e2e-tests/resources/Browser.py`
launches the device-code browser on the host using `xvfb-run`. The browser subprocess inherits the parent environment, including
`GTK_PATH` and `GIO_MODULE_DIR`.

This causes WebKit's `WebKitNetworkProcess` to load modules from the VS Code
Snap environment while using the host GTK/WebKit stack. The process then
crashes with an unresolved `libpthread` symbol before the login page can be
used.

Expected behavior: the device-code browser starts and displays the identity
provider's code-entry page.

Actual behavior: the browser exits during startup, and the Robot test later
times out waiting for the device-code page.

The issue affects the host-side E2E browser launcher. It is triggered by
GDM/CLI/SSH device-code flows that call `Browser.Login`; password-only flows
that do not launch the browser are not affected.

### Steps to reproduce

1. Set up the authd E2E environment according to `e2e-tests/TESTING.md`.
Provision an Ubuntu resolute VM with the Microsoft Entra ID broker

2. Run `./e2e-tests/run-tests.sh --broker authd-msentraid --release resolute --output-dir /tmp/authd-gtk-repro ./e2e-tests/tests/login_gdm.robot
`
3. Observe in terminal error: /usr/lib/x86_64-linux-gnu/webkit2gtk-4.1/WebKitNetworkProcess: symbol lookup error: /snap/core20/current/lib/x86_64-linux-gnu/libpthread.so.0: undefined symbol: __libc_pthread_init, version GLIBC_PRIVATE
And finally timeout: ERROR: WebKit encountered an internal error. This is a WebKit bug.
TimeoutError: Timed out after 10000ms waiting for pattern 'Enter code to allow access'
Browser login failed (exit code 1)

### System information and logs

_No response_

### Double check your logs

- [x] I have redacted any sensitive information from the logs

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.