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 segfaults immediately when started (if using hardened NixOS profile) #97898

Closed
alexbakker opened this issue Sep 13, 2020 · 8 comments
Closed
Labels
0.kind: bug Something is broken

Comments

@alexbakker
Copy link
Member

Describe the bug

Firefox segfaults immediately when started.

To Reproduce
Steps to reproduce the behavior:

  1. Start Firefox.
  2. Observe that it segfaults.

Expected behavior

I expect Firefox to launch.

Additional context

I don't know how to get debug symbols for Firefox, but here's the backtrace of the crash:

Reading symbols from /nix/store/mc47vql2pjjkx9rqshx6klf89v4rhslq-firefox-unwrapped-80.0.1/lib/firefox/firefox...
(No debugging symbols found in /nix/store/mc47vql2pjjkx9rqshx6klf89v4rhslq-firefox-unwrapped-80.0.1/lib/firefox/firefox)

warning: core file may not match specified executable file.
[New LWP 12963]
[New LWP 12967]
[New LWP 12968]
[New LWP 12971]
[New LWP 12970]
[New LWP 12969]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/nix/store/jvjchabdmcxlwjhbiii5sy6d2hcg6z7r-glibc-2.31/lib/libthread_db.so.1".
Core was generated by `/nix/store/mc47vql2pjjkx9rqshx6klf89v4rhslq-firefox-unwrapped-80.0.1/bin/.firef'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007fd80c849d9a in raise () from /nix/store/jvjchabdmcxlwjhbiii5sy6d2hcg6z7r-glibc-2.31/lib/libpthread.so.0
[Current thread is 1 (Thread 0x7fd80c192340 (LWP 12963))]
(gdb) bt f
#0  0x00007fd80c849d9a in raise () from /nix/store/jvjchabdmcxlwjhbiii5sy6d2hcg6z7r-glibc-2.31/lib/libpthread.so.0
No symbol table info available.
#1  0x00007fd806aa6f3a in ?? () from /nix/store/mc47vql2pjjkx9rqshx6klf89v4rhslq-firefox-unwrapped-80.0.1/lib/firefox/libxul.so
No symbol table info available.
#2  <signal handler called>
No symbol table info available.
#3  0x00007fd803330017 in ?? () from /nix/store/mc47vql2pjjkx9rqshx6klf89v4rhslq-firefox-unwrapped-80.0.1/lib/firefox/libxul.so
No symbol table info available.
#4  0x00007fd803c85d27 in ?? () from /nix/store/mc47vql2pjjkx9rqshx6klf89v4rhslq-firefox-unwrapped-80.0.1/lib/firefox/libxul.so
No symbol table info available.
#5  0x00007fd803c93386 in ?? () from /nix/store/mc47vql2pjjkx9rqshx6klf89v4rhslq-firefox-unwrapped-80.0.1/lib/firefox/libxul.so
No symbol table info available.
#6  0x00007fd806ab8c15 in ?? () from /nix/store/mc47vql2pjjkx9rqshx6klf89v4rhslq-firefox-unwrapped-80.0.1/lib/firefox/libxul.so
No symbol table info available.
#7  0x00007fd806ab9717 in ?? () from /nix/store/mc47vql2pjjkx9rqshx6klf89v4rhslq-firefox-unwrapped-80.0.1/lib/firefox/libxul.so
No symbol table info available.
#8  0x00007fd806ab999e in ?? () from /nix/store/mc47vql2pjjkx9rqshx6klf89v4rhslq-firefox-unwrapped-80.0.1/lib/firefox/libxul.so
No symbol table info available.
#9  0x000055ba2fa63b76 in ?? ()
No symbol table info available.
#10 0x000055ba2fa62fbc in ?? ()
No symbol table info available.
#11 0x00007fd80c358c7d in __libc_start_main () from /nix/store/jvjchabdmcxlwjhbiii5sy6d2hcg6z7r-glibc-2.31/lib/libc.so.6
No symbol table info available.
#12 0x000055ba2fa633ba in _start ()
No symbol table info available.

Notify maintainers
@edolstra, @andir

Metadata

 - system: `"x86_64-linux"`
 - host os: `Linux 5.8.6, NixOS, 20.09alpha192.18f9a651f5c (Nightingale)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.7`
 - channels(root): `"nixos-20.09alpha192.18f9a651f5c, home-manager, nixos-unstable-20.09pre242769.61525137fd1"`
 - channels(alex): `""`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute: firefox
# a list of nixos modules affected by the problem
module:
@alexbakker alexbakker added the 0.kind: bug Something is broken label Sep 13, 2020
@andir
Copy link
Member

andir commented Sep 13, 2020 via email

@alexbakker
Copy link
Member Author

Yes, still the same crash after mv ~/.mozilla ~/.mozilla_backup.

@andir
Copy link
Member

andir commented Sep 13, 2020 via email

@alexbakker
Copy link
Member Author

And it works just fine for me.

Are you also on 20.09?

What kind of environment are you running in?

Since upgrading to 20.09, this issue appears on both of my machines. One has an Intel 7200U and uses integrated graphics. The other has an AMD 3900X and an RX 590.

Firefox worked fine on 20.03.

Anything in LD_LIBRARY_PATH or LD_PRELOAD that
could interfere with this?

I don't manually set LD_LIBRARY_PATH or LD_PRELOAD, if that's what you mean.

@andir
Copy link
Member

andir commented Sep 14, 2020 via email

@alexbakker
Copy link
Member Author

alexbakker commented Sep 14, 2020

It seems that using the hardened profile (<nixpkgs/nixos/modules/profiles/hardened.nix>) has something to do with causing the segfault. Commenting that import out allows Firefox to start again. I'll do some more digging to see which option is the culprit when I have some more time.

On a side note: disabling the hardened profile also fixes a crash I was encountering with Spotify.

@alexbakker alexbakker changed the title Firefox segfaults immediately when started Firefox segfaults immediately when started (if using hardened NixOS profile) Sep 14, 2020
@alexbakker
Copy link
Member Author

Ah, it appears that this is a known issue: #73763 (comment). Setting the memory allocator back to libc fixes the problem:

environment.memoryAllocator.provider = "libc";

It would be nice if this were documented, though I get that using the hardened profile is not exactly common.

@ajs124
Copy link
Member

ajs124 commented Sep 14, 2020

Also related: #93154

Are there any upstream bugreports on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

3 participants