Bug 267123 - www/firefox-esr: segmentation fault (dumped core), when launched from Wayland
Summary: www/firefox-esr: segmentation fault (dumped core), when launched from Wayland
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords: crash, needs-qa
Depends on:
Blocks:
 
Reported: 2022-10-16 13:42 UTC by Alain De Vos
Modified: 2023-04-23 09:49 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alain De Vos 2022-10-16 13:42:31 UTC
firefox-esr-102.4.0,1 (quarterly) does not start when launched under wayland.
It gives segmentation fault & dumps core.
[PS: The same problem exists under gentoo-linux]
Comment 1 Graham Perrin freebsd_committer freebsd_triage 2022-10-16 13:58:32 UTC
Thanks, 

> [PS: The same problem exists under gentoo-linux]

Would it help to have a reference to a bug report upstream somewhere? If there is one …
Comment 2 Jan Beich freebsd_committer freebsd_triage 2022-10-16 16:20:33 UTC
I can't reproduce. Works fine locally and within a clean jail:

  $ pkg install cage firefox-esr
  $ export MOZ_ENABLE_WAYLAND=1 XDG_RUNTIME_DIR=/tmp
  $ cage -d env -u DISPLAY firefox https://freebsd.org/

Need more details about the execution environment and backtrace from the crash.
Comment 3 Alain De Vos 2022-10-16 16:36:17 UTC
This is how i start wayland,
```
#!/usr/local/bin/zsh
export BEMENU_BACKEND=wayland
export CLUTTER_BACKEND=wayland
export GDK_BACKEND=wayland
export MOZ_ENABLE_WAYLAND=1
export QT_QPA_PLATFORM=wayland
export QT_QPA_PLATFORMTHEME="qt5ct"
export QT_WAYLAND_DISABLE_WINDOWDECORATION=0
export SDL_VIDEODRIVER=wayland
export WM=labwc
export XDG_RUNTIME_DIR=/home/TMP
export XDG_SESSION_TYPE=wayland
export XKB_DEFAULT_LAYOUT="be(nodeadkeys)"
export XKB_DEFAULT_RULES=evdev
exec labwc
```
Can i dump some info when firefox dies ?
Comment 4 Jan Beich freebsd_committer freebsd_triage 2022-10-16 17:31:49 UTC
(In reply to Alain De Vos from comment #3)
> export BEMENU_BACKEND=wayland
> export CLUTTER_BACKEND=wayland
> export GDK_BACKEND=wayland
> export QT_QPA_PLATFORM=wayland

Already default (when run under Wayland compositor). Worse, this may crash (instead of using Xwayland) any app that calls X11 directly (e.g., editors/vim@gtk3) even if the toolkit itself supports Wayland.

> export XDG_SESSION_TYPE=wayland

Already default since ports 70148c11889b, see https://gitlab.freedesktop.org/wlroots/wlroots/-/commit/90c845295947

> export XKB_DEFAULT_RULES=evdev

Already default since ports 13d4989f6b56.

> export XDG_RUNTIME_DIR=/home/TMP

Is /home/TMP writeable by current user? Setting XDG_RUNTIME_DIR manually is error-prone. It's a common place to store various unix(4) sockets, not just by Wayland compositor. Better use sysutils/pam_xdg or sysutils/consolekit2 (pam_ck_connector or ck_launch_session).

> Can i dump some info when firefox dies ?

Better run from under debugger e.g.,

$ lldb -- $(which firefox) https://freebsd.org/
(lldb) run
(lldb) bt
Comment 5 Jan Beich freebsd_committer freebsd_triage 2022-10-16 18:53:20 UTC
See also bug 240884. Fighting posix_fallocate(2) misuse is an uphill battle (due to emulation in glibc), so sysutils/pam_xdg/pkg-message recommends tmpfs(5) for XDG_RUNTIME_DIR.
Comment 6 Graham Perrin freebsd_committer freebsd_triage 2023-04-23 09:49:16 UTC
Alain, is this reproducible with 102.10.0,1 or greater on FreeBSD 13.2-RELEASE?