Firefox frequently freezes, requiring browser restart

Hi! I’m new to Manjaro – I installed it months ago but mostly haven’t used it since then. It seems very possible that this problem has been present the whole time, I just didn’t notice until recently.

The problem

Occasionally (once every few hours) firefox becomes completely unresponsive; the longest I’ve waited is 10 minutes, and it was still unresponsive. This seems to happen more often when I have a lot of tabs open, and am switching between them or closing them. This sounds to me like a RAM issue or a swap space issue, but I don’t really know how to diagnose it.

Today I had htop open and was keeping an eye on RAM/swap when it happened again. My swap space never went above ~20% full, and my RAM was about 60% to 80% full, so the culprit might be something else. The CPU usage was low, even while firefox was frozen. I had 10 tabs open in a single firefox window (another window with 1 or 2 tabs may have also been open). The specific thing I did right before it froze this time was press “ctrl-c” to copy some text. This htop screenshot was taken seconds after the freeze:

htop right as the problem happened

I think the relevant parts of the screenshot are: “Mem 4.99G/7.66G”, “Swp 197M/1024M”, the cpu usage of firefox (10% or so, spread across a few processes), and the cpu usage of my system (8 cores: 3.1%, 15.2%, 8.9%, 0.6%, 6.7%, 4.9%, 2.6%, and 1.9%). (I read [HowTo] Post command output and file content as formatted text but am not sure if there’s a better option here than posting the screenshot; I’m not expert enough to know what I’m looking for in the htop output)

While it was still frozen, I filtered htop by “firefox” and didn’t see anything that seemed suspicious. Lots of processes but no suspiciously-high usage numbers (e.g. RAM or CPU). After 10 minutes of waiting (with no change – still unresponsive) I manually closed firefox (right click in desktop bar, “close”, wait for dialog, confirm). Afterwards, htop showed lower RAM usage: 2.78G/7.66G RAM, 117M/1024M swap, and 1~8% cpu usage on each of my 8 cores. This seems normal and expected to me.

Why does this happen / how do I stop it from happening?

Another instance of the problem

A few days ago this freezing behavior happened every few minutes while playing an HTML game – if I tried to do too many things in-game at once the browser would start to chug, often fully freezing the browser. I’m fairly sure the freezing was happening before I started playing this game last week, and the problem continues to happen on days when I don’t have the game open in another tab. This seems unrelated to me (just an unoptimized game), although one bad tab freezing all of firefox is a bit surprising.

My system info

firefox --version says Mozilla Firefox 107.0.1

inxi and free:

Summary

Here’s inxi -v7azy:

System:
  Kernel: 5.15.81-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
    parameters: BOOT_IMAGE=/boot/vmlinuz-5.15-x86_64
    root=UUID=5cca366c-3f6c-47f2-8665-504baa926be5 rw quiet apparmor=1
    security=apparmor udev.log_priority=3
  Desktop: KDE Plasma v: 5.26.4 tk: Qt v: 5.15.7 wm: kwin_x11 vt: 1 dm: SDDM
    Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Desktop Mobo: ASUSTeK model: M5A97 R2.0 v: Rev 1.xx
    serial: <superuser required> BIOS: American Megatrends v: 2201
    date: 12/10/2013
Battery:
  Device-1: sony_controller_battery_04:76:6e:1f:01:99 model: N/A serial: N/A
    charge: N/A status: N/A
Memory:
  RAM: total: 7.66 GiB used: 4.83 GiB (63.0%)
  RAM Report: permissions: Unable to run dmidecode. Root privileges required.
CPU:
  Info: model: AMD FX-8350 bits: 64 type: MT MCP arch: Piledriver level: v2
    built: 2012-13 process: GF 32nm family: 0x15 (21) model-id: 2 stepping: 0
    microcode: 0x6000852
  Topology: cpus: 1x cores: 8 smt: enabled cache: L1: 384 KiB
    desc: d-8x16 KiB; i-4x64 KiB L2: 8 MiB desc: 4x2 MiB L3: 8 MiB desc: 1x8 MiB
  Speed (MHz): avg: 1469 high: 1640 min/max: 1400/4000 boost: enabled
    scaling: driver: acpi-cpufreq governor: schedutil cores: 1: 1569 2: 1640
    3: 1404 4: 1404 5: 1404 6: 1405 7: 1448 8: 1484 bogomips: 64245
  Flags: 3dnowprefetch abm aes aperfmperf apic arat avx bmi1 clflush cmov
    cmp_legacy constant_tsc cpb cpuid cr8_legacy cx16 cx8 de decodeassists
    extapic extd_apicid f16c flushbyasid fma fma4 fpu fxsr fxsr_opt ht
    hw_pstate ibpb ibs lahf_lm lbrv lm mca mce misalignsse mmx mmxext monitor
    msr mtrr nodeid_msr nonstop_tsc nopl npt nrip_save nx osvw pae pat
    pausefilter pclmulqdq pdpe1gb perfctr_core perfctr_nb pfthreshold pge pni
    popcnt pse pse36 rdtscp rep_good sep skinit ssbd sse sse2 sse4_1 sse4_2
    sse4a ssse3 svm svm_lock syscall tbm tce topoext tsc tsc_scale vmcb_clean
    vme vmmcall wdt xop xsave
  Vulnerabilities:
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data status: Not affected
  Type: retbleed mitigation: untrained return thunk; SMT vulnerable
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
    prctl and seccomp
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
    sanitization
  Type: spectre_v2 mitigation: Retpolines, IBPB: conditional, STIBP:
    disabled, RSB filling, PBRSB-eIBRS: Not affected
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: NVIDIA GM107 [GeForce GTX 750 Ti] vendor: eVga.com. driver: nvidia
    v: 525.60.11 alternate: nouveau,nvidia_drm non-free: 520.xx+
    status: current (as of 2022-10) arch: Maxwell code: GMxxx
    process: TSMC 28nm built: 2014-19 pcie: gen: 2 speed: 5 GT/s lanes: 8
    link-max: lanes: 16 bus-ID: 01:00.0 chip-ID: 10de:1380 class-ID: 0300
  Device-2: Logitech HD Webcam C910 type: USB driver: snd-usb-audio,uvcvideo
    bus-ID: 10-2:2 chip-ID: 046d:0821 class-ID: 0e02 serial: <filter>
  Display: x11 server: X.Org v: 21.1.4 with: Xwayland v: 22.1.5
    compositor: kwin_x11 driver: N/A display-ID: :0 screens: 1
  Screen-1: 0 s-res: 3840x1242 s-dpi: 94 s-size: 1038x335mm (40.87x13.19")
    s-diag: 1091mm (42.94")
  Monitor-1: DVI-I-1 pos: primary,bottom-r res: 1920x1080 hz: 60 dpi: 94
    size: 521x293mm (20.51x11.54") diag: 598mm (23.53") modes: N/A
  Monitor-2: HDMI-0 pos: top-left res: 1920x1080 dpi: 92
    size: 530x300mm (20.87x11.81") diag: 609mm (23.98") modes: N/A
  API: OpenGL v: 4.6.0 NVIDIA 525.60.11 renderer: NVIDIA GeForce GTX 750
    Ti/PCIe/SSE2 direct render: Yes
Audio:
  Device-1: AMD SBx00 Azalia vendor: ASUSTeK driver: snd_hda_intel v: kernel
    bus-ID: 10-2:2 chip-ID: 046d:0821 bus-ID: 00:14.2 class-ID: 0e02
    chip-ID: 1002:4383 serial: <filter> class-ID: 0403
  Device-2: NVIDIA GM107 High Definition Audio [GeForce 940MX]
    vendor: eVga.com. driver: snd_hda_intel v: kernel pcie: gen: 2 speed: 5 GT/s
    lanes: 8 link-max: lanes: 16 bus-ID: 01:00.1 chip-ID: 10de:0fbc
    class-ID: 0403
  Device-3: Logitech HD Webcam C910 type: USB driver: snd-usb-audio,uvcvideo
  Device-4: Shure MV5 type: USB driver: hid-generic,snd-usb-audio,usbhid
    bus-ID: 4-3:4 chip-ID: 14ed:1000 class-ID: 0300
  Sound API: ALSA v: k5.15.81-1-MANJARO running: yes
  Sound Server-1: JACK v: 1.9.21 running: no
  Sound Server-2: PulseAudio v: 16.1 running: yes
  Sound Server-3: PipeWire v: 0.3.61 running: yes
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: ASUSTeK P8 series driver: r8169 v: kernel pcie: gen: 1
    speed: 2.5 GT/s lanes: 1 port: d000 bus-ID: 02:00.0 chip-ID: 10ec:8168
    class-ID: 0200
  IF: enp2s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
  IP v4: <filter> type: dynamic noprefixroute scope: global
    broadcast: <filter>
  IP v6: <filter> type: noprefixroute scope: link
  WAN IP: <filter>
Bluetooth:
  Message: No bluetooth data found.
Logical:
  Message: No logical block device data found.
RAID:
  Message: No RAID data found.
Drives:
  Local Storage: total: 577.55 GiB used: 436.06 GiB (75.5%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/sda maj-min: 8:0 vendor: Samsung model: SSD 840 EVO 120GB
    size: 111.79 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
    type: SSD serial: <filter> rev: BB6Q scheme: MBR
  ID-2: /dev/sdb maj-min: 8:16 vendor: Western Digital
    model: WDS500G2B0A-00SM50 size: 465.76 GiB block-size: physical: 512 B
    logical: 512 B speed: 6.0 Gb/s type: SSD serial: <filter> rev: 40WD
    scheme: MBR
  Optical-1: /dev/sr0 vendor: ASUS model: DRW-24B1ST i rev: 1.00
    dev-links: cdrom
  Features: speed: 48 multisession: yes audio: yes dvd: yes
    rw: cd-r,cd-rw,dvd-r,dvd-ram state: running
Partition:
  ID-1: / raw-size: 87.89 GiB size: 85.95 GiB (97.80%) used: 46.22 GiB (53.8%)
    fs: ext4 dev: /dev/sdb2 maj-min: 8:18 label: N/A
    uuid: 5cca366c-3f6c-47f2-8665-504baa926be5
  ID-2: /run/media/pancelor/6EF3AF59591C039D raw-size: 103.89 GiB
    size: 103.89 GiB (100.00%) used: 97.91 GiB (94.2%) fs: ntfs dev: /dev/sda1
    maj-min: 8:1 label: N/A uuid: 6EF3AF59591C039D
  ID-3: /run/media/pancelor/data raw-size: 377.87 GiB
    size: 377.87 GiB (100.00%) used: 291.93 GiB (77.3%) fs: ntfs dev: /dev/sdb1
    maj-min: 8:17 label: data uuid: 462C821B2C8205E1
Swap:
  Kernel: swappiness: 60 (default) cache-pressure: 100 (default)
  ID-1: swap-1 type: file size: 1024 MiB used: 768 KiB (0.1%) priority: -2
    file: /root/swapfile01
Unmounted:
  ID-1: /dev/sda2 maj-min: 8:2 size: 1 KiB fs: <superuser required> label: N/A
    uuid: N/A
USB:
  Hub-1: 1-0:1 info: Full speed or root hub ports: 5 rev: 2.0 speed: 480 Mb/s
    chip-ID: 1d6b:0002 class-ID: 0900
  Hub-2: 2-0:1 info: Full speed or root hub ports: 5 rev: 2.0 speed: 480 Mb/s
    chip-ID: 1d6b:0002 class-ID: 0900
  Hub-3: 3-0:1 info: Full speed or root hub ports: 4 rev: 2.0 speed: 480 Mb/s
    chip-ID: 1d6b:0002 class-ID: 0900
  Hub-4: 4-0:1 info: Full speed or root hub ports: 5 rev: 1.1 speed: 12 Mb/s
    chip-ID: 1d6b:0001 class-ID: 0900
  Device-1: 4-1:2 info: Logitech G402 Gaming Mouse type: Mouse,HID
    driver: hid-generic,usbhid interfaces: 2 rev: 2.0 speed: 12 Mb/s power: 300mA
    chip-ID: 046d:c07e class-ID: 0300 serial: <filter>
  Device-2: 4-2:3 info: Razer USA BlackWidow Tournament Edition Stealth
    type: Keyboard,Mouse driver: hid-generic,usbhid interfaces: 3 rev: 2.0
    speed: 12 Mb/s power: 100mA chip-ID: 1532:011c class-ID: 0300
  Device-3: 4-3:4 info: Shure MV5 type: Audio,HID
    driver: hid-generic,snd-usb-audio,usbhid interfaces: 4 rev: 2.0
    speed: 12 Mb/s power: 100mA chip-ID: 14ed:1000 class-ID: 0300
  Hub-5: 5-0:1 info: Full speed or root hub ports: 5 rev: 1.1 speed: 12 Mb/s
    chip-ID: 1d6b:0001 class-ID: 0900
  Hub-6: 6-0:1 info: Full speed or root hub ports: 2 rev: 1.1 speed: 12 Mb/s
    chip-ID: 1d6b:0001 class-ID: 0900
  Hub-7: 7-0:1 info: Full speed or root hub ports: 4 rev: 1.1 speed: 12 Mb/s
    chip-ID: 1d6b:0001 class-ID: 0900
  Hub-8: 8-0:1 info: Hi-speed hub with single TT ports: 2 rev: 2.0
    speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900
  Device-1: 8-2:2 info: Sony Batoh Device / PlayStation 3 Controller
    type: HID driver: sony,usbhid interfaces: 1 rev: 2.0 speed: 12 Mb/s
    power: 500mA chip-ID: 054c:0268 class-ID: 0300
  Hub-9: 9-0:1 info: Super-speed hub ports: 2 rev: 3.0 speed: 5 Gb/s
    chip-ID: 1d6b:0003 class-ID: 0900
  Hub-10: 10-0:1 info: Hi-speed hub with single TT ports: 2 rev: 2.0
    speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900
  Device-1: 10-2:2 info: Logitech HD Webcam C910 type: Audio,Video
    driver: snd-usb-audio,uvcvideo interfaces: 4 rev: 2.0 speed: 480 Mb/s
    power: 500mA chip-ID: 046d:0821 class-ID: 0e02 serial: <filter>
  Hub-11: 11-0:1 info: Super-speed hub ports: 2 rev: 3.0 speed: 5 Gb/s
    chip-ID: 1d6b:0003 class-ID: 0900
Sensors:
  System Temperatures: cpu: 23.2 C mobo: N/A gpu: nvidia temp: 22 C
  Fan Speeds (RPM): N/A gpu: nvidia fan: 42%
Info:
  Processes: 267 Uptime: 3h 36m wakeups: 1 Init: systemd v: 251
  default: graphical tool: systemctl Compilers: gcc: 12.2.0 clang: 14.0.6
  Packages: 1409 pm: pacman pkgs: 1395 libs: 367 tools: pamac pm: flatpak
  pkgs: 0 pm: snap pkgs: 14 Shell: Zsh v: 5.9 default: Bash v: 5.1.16
  running-in: yakuake inxi: 3.3.23

And here’s free:

               total        used        free      shared  buff/cache   available
Mem:            7842        4382         308         240        3151        2909
Swap:           1023           0        1023

Some more maybe-relevant info

  • I think my swap space is smaller than it should be (8GB RAM + 1GB swap), but I don’t think that directly caused this issue (based on htop, as described above)
  • I ran a “windows memory diagnostic” RAM check from Windows (I’m dual-booted) and it found no issues with my RAM hardware.
  • My motherboard is 8 years old. It gave me a lot of trouble when installing Manjaro, something to do with UEFI or GPT/MBR tables, if I remember right.
  • I had some issues with my graphics card when I installed Manjaro, but iirc they went away when I (1) switched from Wayland to X11, and (2) switched from the nouveau driver to the nvidia driver.

I’m probably going to upgrade my motherboard and maybe my RAM soon (mostly unrelated to this), but I’d like to understand the problem properly and be able to troubleshoot future issues without resorting to replacing bits of hardware that I vaguely think might be the problem! It’d be nice to feel knowledgeable enough to track this sort of thing down myself in the future.

I went looking for log files ([HowTo] Find error logs) and found this SE question + answer.

~/.mozilla/firefox/Crash\ Reports/events/ was empty, but journalctl -qb /usr/bin/firefox included this line a few times:

Dec 06 17:19:25 pancelor-manjaro plasmashell[10455]: [GFX1-]: glxtest: VA-API test failed: process crashed. Please check your VA-API drivers.

I found a reddit post which led me to a mozilla bug and an x11 bug. This seems like my issue! I can now consistently reproduce the freeze by having a video running in one firefox window and highlighting text in another firefox window.

A reddit commentor says “Temporary Solution: Downgrading to libx11 1.8.1-3 solves this issue”.

After some more tutorial searching, I’m looking at my cached libx11 packages:
ls /var/cache/pacman/pkg/libx11*

/var/cache/pacman/pkg/libx11-1.8.1-2-x86_64.pkg.tar.zst  /var/cache/pacman/pkg/libx11-1.8.2-1-x86_64.pkg.tar.zst      /var/cache/pacman/pkg/libx11-1.8.2-2-x86_64.pkg.tar.zst
/var/cache/pacman/pkg/libx11-1.8-1-x86_64.pkg.tar.zst    /var/cache/pacman/pkg/libx11-1.8.2-1-x86_64.pkg.tar.zst.sig  /var/cache/pacman/pkg/libx11-1.8.2-2-x86_64.pkg.tar.zst.sig

Cool, I guess I’ll downgrade to 1.8.1-2. (sudo pacman -U /var/cache/pacman/pkg/libx11-1.8.1-2-x86_64.pkg.tar.zst)

Will this break anything in some way I’m not expecting? Will my libx11 get updated next release, or do I need to remember to manually un-downgrade it?

I suppose I’ve mostly answered my question at this point, but at the very least this thread might be useful if others have the same issue. I’ve cobbled together a solution (I haven’t tested it yet) but if any experts out there have holistic advice/comments I’d appreciate it. (or specific comments – maybe my solution doesn’t even work! I’ll try it in a few days if this keeps being an issue)

Try to turn off hardware acceleration in Firefox to see if the problem persists.

Hello. I had the same problem with version 107 (french). Disabling harware acceleration limited the number of problems but not completely. First time I downgraded Manjaro to stable and it worked fine for several days then it started again to freeze. This time I uninstalled standard Firefox & replaced with Beta 108 (English). I haven’t had any problems since (I didn’t disable harware acceleration). I hope this helps someone. Sorry for my English.

PC Brix gbbxbt2807

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.