Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firefox 82 and firefox-bin 82 do not run under Wayland when LTO is enabled #101429

Closed
artemist opened this issue Oct 22, 2020 · 7 comments · Fixed by #106617
Closed

Firefox 82 and firefox-bin 82 do not run under Wayland when LTO is enabled #101429

artemist opened this issue Oct 22, 2020 · 7 comments · Fixed by #106617

Comments

@artemist
Copy link
Member

Describe the bug
A clear and concise description of what the bug is.
When I attempt to run firefox-wayland within my Sway session it runs under X11. This happens even if I set XDG_SESSION_TYPE=wayland and MOZ_ENABLE_WAYLAND=1. If I set GDK_BACKEND=wayland then Firefox prints to stderr:

(firefox:4408): Gtk-WARNING **: 23:20:43.048: cannot open display: :0
mozilla::detail::MutexImpl::~MutexImpl: pthread_mutex_destroy failed: Device or resource busy

and then crashes with a segfault. I get the same result with firefox-bin

To Reproduce
Steps to reproduce the behavior:
1.nix-shell -p firefox-wayland --run "env GDK_BACKEND=wayland firefox"

Expected behavior
A clear and concise description of what you expected to happen.
Firefox runs using Wayland

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Notify maintainers

@edolstra @andir

Metadata
Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

  • system: "x86_64-linux"
  • host os: Linux 5.8.14, NixOS, 21.03.git.a920bf43082 (Okapi)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.3.7
  • channels(root): "nixos-21.03pre246543.24c9b05ac53"
  • channels(artemis): ""
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute: [firefox,firefox-bin,firefox-wayland]
# a list of nixos modules affected by the problem
module:
@andir
Copy link
Member

andir commented Oct 22, 2020

Yeah I can confirm this happening. For some reason my firefox-wayland now defaults to X11 unless I unset DISPLAY (which comes from yet to figure out locations).

@artemist
Copy link
Member Author

If I unset DISPLAY then I get the same error for GDK_BACKEND=wayland, just with an empty display. I have no idea where this is coming from. This is probably a NixOS thing since Firefox runs perfectly fine in Wayland under arch

@andir
Copy link
Member

andir commented Oct 22, 2020

I am currently rebuilding firefox without LTO as that is also something that recently changed on unstable.

@andir
Copy link
Member

andir commented Oct 23, 2020

Yeah, disabling LTO did the trick. I'll open a PR disabling it again and then we can go ahead and figure out why it is causing this regression.

andir added a commit to andir/nixpkgs that referenced this issue Oct 23, 2020
As discussed in NixOS#101429 firefox 82 started crashing when used with
wayland. A brief investigation showed that this appears to be rooted
within the LTO support that was recently added to the package. For the
time being, until someone figures out where the crashes are coming from,
we can just disable LTO.
@S-NA
Copy link
Contributor

S-NA commented Oct 24, 2020

Sorry for the delay, I will investigate this.
I got around to digging into this. The issue seems to be that libwayland-client.so's symbols are not being found. libmozwayland.so is supposed to be a sort of wrapper which provides them by dlopen or some other run-time magic and for some reason it is not. One can however set LD_PRELOAD with libwayland-client.so to work around this. At this time I have not come up with a proper solution but I am still looking into this.

@andir
Copy link
Member

andir commented Nov 2, 2020

We can probably patch the rpath in the Mozilla wrapper as part of the Firefox build. I am still a bit irritated by the fact that this only occurs on LTO.

@andir andir changed the title Firefox 82 and firefox-bin 82 do not run under Wayland Firefox 82 and firefox-bin 82 do not run under Wayland when LTO is enabled Nov 19, 2020
andir added a commit to andir/nixpkgs that referenced this issue Nov 21, 2020
The segfault we did observe with Firefox 82 doesn't appear to be there
anymore. Closes NixOS#101429
marcus7070 pushed a commit to marcus7070/nixpkgs that referenced this issue Nov 22, 2020
As discussed in NixOS#101429 firefox 82 started crashing when used with
wayland. A brief investigation showed that this appears to be rooted
within the LTO support that was recently added to the package. For the
time being, until someone figures out where the crashes are coming from,
we can just disable LTO.
@ajs124
Copy link
Member

ajs124 commented Dec 16, 2020

Why was this closed? As far as I can tell, this hasn't been re-enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants