FS#78149 - [chromium] crash on wayland when creating new window on monitors with different scaling

Attached to Project: Arch Linux
Opened by Yash Lala (yashlala) - Saturday, 08 April 2023, 21:28 GMT
Last edited by Toolybird (Toolybird) - Thursday, 25 May 2023, 21:51 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

[chromium] crash on wayland when creating new window on monitors with different scaling

Description:

Assume a sway setup with two monitors, each with different scaling factors. One monitor will now become "afflicted"; when attempting to launch chromium with that monitor focused (eg: running `chromium` on an xterm on monitor 1), chromium will launch, create a window, and immediately crash with the following logs:

```
$ chromium --user-data-dir=$(mktemp -d)
[15233:15233:0408/122327.921960:ERROR:wayland_event_watcher.cc(38)] libwayland: xdg_wm_base@15: error 4: wrong configure serial: 13347

[0408/122327.930374:ERROR:elf_dynamic_array_reader.h(64)] tag not found
[1] 15233 trace trap (core dumped) chromium --user-data-dir=$(mktemp -d)
```

This makes it impossible to start chromium on that monitor. More annoyingly, accidentally running "chromium" on that monitor will cause all other windows to crash, due to them sharing the same underlying chromium instance.

- I have not noticed any pattern in terms of _which_ monitor causes chromium to crash; it can switch after restarting sway. But one monitor is always afflicted, and any window created on it will always cause chromium to crash. Chromium seems to work normally on the "healthy" monitor.
- If I start chromium on the "healthy" monitor, move the window to the "afflicted" monitor, then create a new window (via control-shift-n), then chromium will crash.
- Sometimes, the chromium window will persist for a second or two on the affected monitor before crashing.

Core dump backtraces, `about:gpu` info, and package dependency versions are all attached.


Package Versions:

chromium 111.0.5563.64-2, sway 1.8.1. Version numbers of chromium's dependencies are attached.

Hardware:

One high-DPI monitor 3840x2160 with scale 3, one 1920x1080 monitor with scale 1. Error manifests only when using different scaling factors.
Running on an Intel i7 CPU+GPU.

Relevant Issues+Links:

- I'm unable to reproduce this with the official chromium builds, which leads me to believe it's an Arch specific issue.
- NixOS users are having a similar issue at https://github.com/NixOS/nixpkgs/issues/225277 , and have bisected their issue to commit de134a1 (110.0.5481.177 -> 111.0.5563.64). The issue may be sway-specific?
- Relevant chromium upstream issue: https://bugs.chromium.org/p/chromium/issues/detail?id=1430657

Steps to reproduce:

Start sway with two monitors. Give them different scaling factors (eg: `output eDP-1 scale 3`). Launch chromium on one monitor (eg: run ` chromium --user-data-dir=$(mktemp -d)` in an xterm on that monitor). Repeat a few times. chromium will segfault, and all windows will exit. If no error occurs, try the same process on the other monitor, and chromium will segfault.
This task depends upon

Closed by  Toolybird (Toolybird)
Thursday, 25 May 2023, 21:51 GMT
Reason for closing:  Fixed
Additional comments about closing:  chromium 113.0.5672.126-1
Comment by Toolybird (Toolybird) - Saturday, 08 April 2023, 22:14 GMT
Note: Native Wayland support is not the default [1].

What happens if you downgrade wayland (if that is even possible)?

[1] https://wiki.archlinux.org/title/Chromium#Native_Wayland_support
Comment by Yash Lala (yashlala) - Sunday, 09 April 2023, 00:43 GMT
> Note: Native Wayland support is not the default [1].

The issue affects `chromium --ozone-platform=wayland` and `chromium --enable-features=UseOzonePlatform --ozone-platform=wayland`.

> What happens if you downgrade wayland (if that is even possible)?

I can't downgrade very far without getting library soname problems, but can say that wayland 1.20.0-2 and sway 1:1.7.10 (from April 2022 and October 2022 respectively) run into the same issue. I don't recall having this problem that far in the past, though.
Comment by Lukas (luman) - Wednesday, 26 April 2023, 09:06 GMT
Same issue here.

4k screen scaled to 1.2
UHD screen scaled to 1

Browser open at 4k screen.

I have some browser plugins which create popups in certain cases. If the active screen is is the UHD one, i see the popup coming and then immediately ALL chromium instances crash. :(

```
[431418:431418:0426/104121.284340:ERROR:chrome_browser_cloud_management_controller.cc(162)] Cloud management controller initialization aborted as CBCM is not enabled.
[431418:431418:0426/104201.064265:ERROR:wayland_event_watcher.cc(39)] libwayland: xdg_wm_base@15: error 4: wrong configure serial: 101690

[0426/104201.073467:ERROR:elf_dynamic_array_reader.h(64)] tag not found
[0426/104201.073828:ERROR:elf_dynamic_array_reader.h(64)] tag not found
Trace/breakpoint trap (core dumped)
```
Comment by Toolybird (Toolybird) - Thursday, 25 May 2023, 21:28 GMT
Still an issue with latest pkgs? Supposedly fixed by chromium-113.x
Comment by Yash Lala (yashlala) - Thursday, 25 May 2023, 21:40 GMT
The issue is fixed for me as of 113.0.5672.126-1.

Loading...