mozilla / nixpkgs-mozilla

Mozilla overlay for Nixpkgs.
MIT License
516 stars 128 forks source link

Firefox Nightly is segfaulting (SIGSEGV) after most recent update; installing firefox-beta fixes it #319

Closed pmarreck closed 11 months ago

pmarreck commented 11 months ago

This just began to happen and I couldn't see any other tickets about it, if this ends up just being a "me thing" then we'll find out soon I guess, so just an FYI! I saw some coredumps in coredumpctl for it, but I'm not familiar enough with gdb to be able to peruse/use them.

I ride on the "unstable" channel.

Installing firefox-beta instead of the overlay does get my sessions back up though (whew! But this also seems to point to an issue with the Nightly build.)

Here is some system info provided by inxi and neofetch:

20230920162435 ~ bash> neofetch --off
pmarreck@nixos
--------------
OS: NixOS 23.11pre526521.970a59bd19ef (Tapir) x86_64
Host: System76 Thelio Major
Kernel: 6.1.53
Uptime: 19 mins
Packages: 3086 (nix-system), 3388 (nix-user), 147 (nix-default), 49 (flatpak)
Shell: bash 5.2.15
Resolution: 3440x1440
DE: GNOME 44.4
WM: Mutter
WM Theme: Nordic
Theme: Adwaita [GTK2/3]
Icons: Adwaita [GTK2/3]
Terminal: WezTerm
CPU: AMD Ryzen Threadripper 3990X (128) @ 2.900GHz
GPU: NVIDIA GeForce RTX 2080 Ti Rev. A
GPU: NVIDIA GeForce RTX 3080 Ti
Memory: 17889MiB / 128556MiB

20230920162826 ~ bash> inxi -Fxz
System:    Kernel: 6.1.53 x86_64 bits: 64 compiler: gcc v: 12.3.0 Desktop: GNOME 44.4 Distro: NixOS 23.11 (Tapir)
Machine:   Type: Desktop System: System76 product: Thelio Major v: thelio-major-r2.1 serial: <filter>
           Mobo: System76 model: Thelio Major v: thelio-major-r2.1 serial: <filter> UEFI: System76 v: FBh Z5 date: 04/06/2021
CPU:       Info: 64-Core (8-Die) model: AMD Ryzen Threadripper 3990X bits: 64 type: MT MCP MCM arch: Zen 2 rev: 0 cache:
           L2: 32 MiB
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 740998
           Speed: 2900 MHz min/max: 2200/2900 MHz boost: enabled Core speeds (MHz): 1: 2900 2: 2900 3: 2900 4: 2900 5: 2900
           6: 2900 7: 2900 8: 2900 9: 2900 10: 2900 11: 2900 12: 2900 13: 2900 14: 2900 15: 2900 16: 3764 17: 2900 18: 2900
           19: 2900 20: 2900 21: 2900 22: 2900 23: 2900 24: 2900 25: 2900 26: 2900 27: 2900 28: 2900 29: 2900 30: 2900
           31: 2900 32: 2900 33: 2900 34: 2900 35: 2900 36: 3767 37: 2900 38: 2900 39: 2900 40: 2900 41: 2900 42: 2900
           43: 4167 44: 2900 45: 2900 46: 3636 47: 2900 48: 3686 49: 2900 50: 2900 51: 2900 52: 2900 53: 2900 54: 2900
           55: 2900 56: 2900 57: 2900 58: 2900 59: 2900 60: 2900 61: 2900 62: 4118 63: 2900 64: 2900 65: 2900 66: 2900
           67: 2900 68: 2900 69: 2900 70: 2900 71: 2900 72: 2900 73: 2900 74: 2900 75: 2900 76: 2900 77: 2900 78: 2900
           79: 2900 80: 2900 81: 2900 82: 2900 83: 2900 84: 2900 85: 2900 86: 2900 87: 2900 88: 2900 89: 2900 90: 2900
           91: 2900 92: 2900 93: 2900 94: 2900 95: 2900 96: 2900 97: 2900 98: 2900 99: 2900 100: 2900 101: 2900 102: 2900
           103: 2900 104: 2900 105: 2900 106: 2900 107: 2900 108: 2900 109: 2900 110: 2900 111: 2900 112: 2900 113: 2900
           114: 2900 115: 2900 116: 2900 117: 3948 118: 2900 119: 2900 120: 3593 121: 2900 122: 2900 123: 2900 124: 2900
           125: 2900 126: 2900 127: 2900 128: 2900
Graphics:  Device-1: NVIDIA TU102 [GeForce RTX 2080 Ti Rev. A] vendor: Gigabyte driver: nvidia v: 535.104.05 bus-ID: 21:00.0
           Device-2: NVIDIA GA102 [GeForce RTX 3080 Ti] vendor: eVga.com. driver: nvidia v: 535.104.05 bus-ID: 49:00.0
           Device-3: SHENZHEN AONI ELECTRONIC Full HD webcam type: USB driver: snd-usb-audio,uvcvideo bus-ID: 1-2.2:4
           Display: x11 server: X.org 1.21.1.8 driver: loaded: nvidia note: n/a (using device driver)
           resolution: <missing: xdpyinfo>
           Message: Unable to show advanced data. Required tool glxinfo missing.
Audio:     Device-1: NVIDIA TU102 High Definition Audio vendor: Gigabyte driver: snd_hda_intel v: kernel bus-ID: 21:00.1
           Device-2: Advanced Micro Devices [AMD] Starship/Matisse HD Audio driver: snd_hda_intel v: kernel bus-ID: 23:00.4
           Device-3: NVIDIA GA102 High Definition Audio vendor: eVga.com. driver: snd_hda_intel v: kernel bus-ID: 49:00.1
           Device-4: USB PnP Audio Device type: USB driver: hid-generic,snd-usb-audio,usbhid bus-ID: 1-2.1:3
           Device-5: SHENZHEN AONI ELECTRONIC Full HD webcam type: USB driver: snd-usb-audio,uvcvideo bus-ID: 1-2.2:4
           Device-6: Sonicstar Klipsch R-1ÿPM type: USB driver: hid-generic,snd-usb-audio,usbhid bus-ID: 7-4.3:6
           Device-7: Generic USB Audio type: USB driver: hid-generic,snd-usb-audio,usbhid bus-ID: 7-5:3
           Sound Server-1: ALSA v: k6.1.53 running: yes
           Sound Server-2: PipeWire v: 0.3.79 running: yes
Network:   Device-1: Intel I211 Gigabit Network vendor: Gigabyte driver: igb v: kernel port: 9000 bus-ID: 44:00.0
           IF: enp68s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
           Device-2: Intel Wi-Fi 6 AX200 driver: iwlwifi v: kernel port: 9000 bus-ID: 45:00.0
           IF: wlo2 state: down mac: <filter>
Bluetooth: Device-1: N/A type: USB driver: btusb v: 0.8 bus-ID: 9-5:2
           Report: hciconfig ID: hci0 rfk-id: 0 state: up address: <filter> bt-v: 3.0 lmp-v: 5.2
RAID:      Device-1: bpool type: zfs status: ONLINE level: mirror-0 size: 3.75 GiB free: 3.21 GiB
           Components: Online: N/A
           Device-2: cache type: zfs status: - level: linear size: N/A free: N/A
           Components: Online: N/A
           Device-3: cache type: zfs status: - level: linear size: N/A free: N/A
           Components: Online: N/A
           Device-4: logs type: zfs status: - level: linear size: N/A free: N/A
           Components: Online: N/A
           Device-5: rpool type: zfs status: ONLINE level: mirror-0 size: 8.92 TiB free: 2.73 TiB
           Components: Online: N/A
Drives:    Local Storage: total: raw: 34.57 TiB usable: 43.49 TiB used: 6.2 TiB (14.2%)
           ID-1: /dev/nvme0n1 vendor: Sabrent model: Rocket 4.0 2TB size: 1.82 TiB
           ID-2: /dev/nvme1n1 vendor: Sabrent model: Rocket 4.0 2TB size: 1.82 TiB
           ID-3: /dev/sda vendor: Samsung model: SSD 870 QVO 4TB size: 3.64 TiB
           ID-4: /dev/sdb vendor: Seagate model: ST5000LM000-2AN170 size: 4.55 TiB
           ID-5: /dev/sdc vendor: Seagate model: ST5000LM000-2AN170 size: 4.55 TiB
           ID-6: /dev/sdd type: USB vendor: Western Digital model: WD101FZBX-00ATAA0 size: 9.1 TiB
           ID-7: /dev/sde type: USB vendor: Western Digital model: WD101FZBX-00ATAA0 size: 9.1 TiB
Partition: ID-1: / size: 2.68 TiB used: 76.75 GiB (2.8%) fs: zfs logical: rpool/nixos/root
           ID-2: /boot size: 3.62 GiB used: 552.6 MiB (14.9%) fs: zfs logical: bpool/nixos/root
           ID-3: /boot/efi size: 1022 MiB used: 228 KiB (0.0%) fs: vfat dev: /dev/sde1
           ID-4: /home size: 8.71 TiB used: 6.11 TiB (70.2%) fs: zfs logical: rpool/nixos/home
           ID-5: /var/log size: 2.6 TiB used: 2 MiB (0.0%) fs: zfs logical: rpool/nixos/var/log
Swap:      ID-1: swap-1 type: partition size: 160 GiB used: 0 KiB (0.0%) dev: /dev/sdd4
           ID-2: swap-2 type: partition size: 150 GiB used: 0 KiB (0.0%) dev: /dev/sde4
Sensors:   Missing: Required tool sensors not installed. Check --recommends
Info:      Processes: 1859 Uptime: N/A Memory: 125.54 GiB used: 17.34 GiB (13.8%) Init: systemd Compilers: gcc: 12.3.0
           Packages: 3633 Shell: Bash v: 5.2.15 inxi: 3.3.04
Artturin commented 11 months ago

It's not a you problem, mozilla changed something.

https://github.com/NixOS/patchelf/issues/520

nbp commented 11 months ago

Thanks for opening the issue.

The problem has been reported on matrix, investigated and solved by @K900 :tada: as part of #322 .

The issue was that Firefox changed the way firefox ELF (binary format) is updated at the end of the compilation. Firefox used to rely on a tool named elfhack which recently got replaced by relrhack. This change highlighted an issue in how Nixpkgs handles pre-compiled binaries.

In Nixpkgs, pre-compiled binaries are unlikely to work as they would not find the proper libraries nor the ELF interpreter. Thus a tool named patchelf is used to update the binary and let it know where the libraries it is loading are supposed to be.

With the analysis from @glandium, patchelf proved to be faulty, and @K900 provided a patch to fix the issue.

In the mean time, the firefox overlay applies this not-yet approved patch of patchelf as part of #322, with the goal of fixing firefox nightly and avoiding these SEGV. This should fix nightly builds after updating nixpkgs-mozilla repository.