Open Bug 1964852 Opened 9 months ago Updated 6 months ago

YouTube video yields out of memory (triggering oom-killer) after image freezes

Categories

(Core :: Audio/Video: Playback, defect, P3)

Firefox 138
Desktop
Linux
defect

Tracking

()

UNCONFIRMED

People

(Reporter: vincent-moz, Unassigned)

Details

Attachments

(1 file)

Attached file System logs

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:138.0) Gecko/20100101 Firefox/138.0

Steps to reproduce:

Play a video on YouTube.

Actual results:

After some time, the image completely froze, but the sound was still working. I ran htop and could see that Firefox was taking more and more memory. When the memory became full, the whole Firefox got killed (not just the culprit tab).

The system logs (attached, starting around the first oom-killer invocation) also show that various processes, including daemons, got killed due to the lack of memory.

Expected results:

The image shouldn't freeze. Moreover, there should be protection concerning the abnormal memory usage.

The severity field is not set for this bug.
:jimm, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(jmathies)

You have a lot of content processes running. Potentially a lot of tabs open? The oom was detected in pipewire.

May 07 01:16:37 qaa kernel: oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/user.slice/user-1000.slice/user@1000.service/session.slice/pipewire-pulse.service,task=pipewire-pulse,pid=1905,uid=1000
May 07 01:16:37 qaa kernel: Out of memory: Killed process 1905 (pipewire-pulse) total-vm:204160kB, anon-rss:34260kB, file-rss:5360kB, shmem-rss:88kB, UID:1000 pgtables:152kB oom_score_adj:200
May 07 01:16:37 qaa systemd[1880]: pipewire-pulse.service: A process of this unit has been killed by the OOM killer.
May 07 01:16:37 qaa systemd[1]: user@1000.service: A process of this unit has been killed by the OOM killer.
May 07 01:16:37 qaa systemd[1880]: pipewire-pulse.service: Main process exited, code=killed, status=9/KILL
May 07 01:16:37 qaa systemd[1880]: pipewire-pulse.service: Failed with result 'oom-kill'.
May 07 01:16:37 qaa systemd[1880]: pipewire-pulse.service: Consumed 15min 920ms CPU time, 53M memory peak, 404K memory swap peak.
May 07 01:16:38 qaa systemd[1880]: pipewire-pulse.service: Scheduled restart job, restart counter is at 1.
May 07 01:16:38 qaa systemd[1880]: Started pipewire-pulse.service - PipeWire PulseAudio.

Severity: -- → S3
Flags: needinfo?(jmathies)
OS: Unspecified → Linux
Priority: -- → P3
Hardware: Unspecified → Desktop

(In reply to Jim Mathies [:jimm] from comment #2)

You have a lot of content processes running. Potentially a lot of tabs open?

Yes, but also usually plenty of memory available. Currently, with all these tabs, htop outputs

  Mem[|||||||||||||||||||||16.8G/31.0G] Tasks: 170, 1559 thr, 241 kthr; 1 runn

So, there are 15 GB free. I don't think that playing a video should take as much.

The oom was detected in pipewire.

No, the OOM killer kills random processes (not the one that takes the most memory). Here's what I can see concerning the killed processes for this crash:

May 07 01:16:37 qaa kernel: Out of memory: Killed process 1905 (pipewire-pulse) total-vm:204160kB, anon-rss:34260kB, file-rss:5360kB, shmem-rss:88kB, UID:1000 pgtables:152kB oom_score_adj:200
May 07 01:16:40 qaa kernel: Out of memory: Killed process 166568 (python3) total-vm:40656kB, anon-rss:18416kB, file-rss:7064kB, shmem-rss:0kB, UID:1000 pgtables:112kB oom_score_adj:200
May 07 01:16:42 qaa kernel: Out of memory: Killed process 1904 (wireplumber) total-vm:677444kB, anon-rss:8000kB, file-rss:7220kB, shmem-rss:0kB, UID:1000 pgtables:312kB oom_score_adj:200
May 07 01:16:50 qaa kernel: Out of memory: Killed process 39685 (xdg-desktop-por) total-vm:554272kB, anon-rss:2176kB, file-rss:8088kB, shmem-rss:0kB, UID:1000 pgtables:184kB oom_score_adj:200
May 07 01:16:50 qaa kernel: Out of memory: Killed process 1407379 (wireplumber) total-vm:397912kB, anon-rss:3456kB, file-rss:6160kB, shmem-rss:0kB, UID:1000 pgtables:116kB oom_score_adj:200
May 07 01:16:50 qaa kernel: Out of memory: Killed process 1136190 (xdg-desktop-por) total-vm:409992kB, anon-rss:2816kB, file-rss:6100kB, shmem-rss:0kB, UID:1000 pgtables:164kB oom_score_adj:200
May 07 01:16:50 qaa kernel: Out of memory: Killed process 166519 (gvfs-afc-volume) total-vm:387508kB, anon-rss:256kB, file-rss:6948kB, shmem-rss:0kB, UID:1000 pgtables:108kB oom_score_adj:200
May 07 01:16:50 qaa kernel: Out of memory: Killed process 1900 (pipewire) total-vm:99488kB, anon-rss:2384kB, file-rss:4276kB, shmem-rss:216kB, UID:1000 pgtables:88kB oom_score_adj:200
May 07 01:16:52 qaa kernel: Out of memory: Killed process 166508 (gvfs-udisks2-vo) total-vm:388572kB, anon-rss:1024kB, file-rss:5816kB, shmem-rss:0kB, UID:1000 pgtables:120kB oom_score_adj:200
May 07 01:16:55 qaa kernel: Out of memory: Killed process 31073 (at-spi-bus-laun) total-vm:381280kB, anon-rss:128kB, file-rss:6064kB, shmem-rss:0kB, UID:1000 pgtables:100kB oom_score_adj:200
May 07 01:16:55 qaa kernel: Out of memory: Killed process 166530 (gvfs-mtp-volume) total-vm:305392kB, anon-rss:384kB, file-rss:5760kB, shmem-rss:0kB, UID:1000 pgtables:92kB oom_score_adj:200
May 07 01:16:55 qaa kernel: Out of memory: Killed process 166514 (gvfs-gphoto2-vo) total-vm:306348kB, anon-rss:512kB, file-rss:5748kB, shmem-rss:0kB, UID:1000 pgtables:96kB oom_score_adj:200
May 07 01:16:55 qaa systemd-journald[815]: /dev/kmsg buffer overrun, some messages lost.
May 07 01:16:55 qaa kernel: Out of memory: Killed process 1407401 (wireplumber) total-vm:397816kB, anon-rss:3328kB, file-rss:5816kB, shmem-rss:0kB, UID:1000 pgtables:132kB oom_score_adj:200
May 07 01:16:55 qaa kernel: Out of memory: Killed process 2416 (xdg-permission-) total-vm:306228kB, anon-rss:128kB, file-rss:5720kB, shmem-rss:0kB, UID:1000 pgtables:92kB oom_score_adj:200
May 07 01:16:55 qaa kernel: Out of memory: Killed process 166525 (gvfs-goa-volume) total-vm:305304kB, anon-rss:128kB, file-rss:5752kB, shmem-rss:0kB, UID:1000 pgtables:92kB oom_score_adj:200
May 07 01:16:55 qaa kernel: Out of memory: Killed process 111864 (dconf-service) total-vm:165400kB, anon-rss:384kB, file-rss:5280kB, shmem-rss:0kB, UID:1000 pgtables:80kB oom_score_adj:200
May 07 01:16:55 qaa kernel: Out of memory: Killed process 1407364 (pipewire-pulse) total-vm:96372kB, anon-rss:384kB, file-rss:4996kB, shmem-rss:0kB, UID:1000 pgtables:72kB oom_score_adj:200
May 07 01:16:55 qaa kernel: Out of memory: Killed process 1407400 (pipewire) total-vm:92896kB, anon-rss:512kB, file-rss:3444kB, shmem-rss:0kB, UID:1000 pgtables:80kB oom_score_adj:200
May 07 01:16:55 qaa kernel: Out of memory: Killed process 1906 (mpris-proxy) total-vm:7356kB, anon-rss:128kB, file-rss:3652kB, shmem-rss:0kB, UID:1000 pgtables:48kB oom_score_adj:200
May 07 01:16:55 qaa kernel: Out of memory: Killed process 1897 (dbus-daemon) total-vm:8624kB, anon-rss:128kB, file-rss:3176kB, shmem-rss:0kB, UID:1000 pgtables:52kB oom_score_adj:200
May 07 01:16:55 qaa kernel: Out of memory: Killed process 90391 (gpg-agent) total-vm:226868kB, anon-rss:256kB, file-rss:2144kB, shmem-rss:0kB, UID:1000 pgtables:72kB oom_score_adj:200
May 07 01:16:55 qaa kernel: Out of memory: Killed process 1160140 (Isolated Web Co) total-vm:2918828kB, anon-rss:249960kB, file-rss:5896kB, shmem-rss:2704kB, UID:1000 pgtables:2524kB oom_score_adj:167

If I understand correctly, this ended up by killing Firefox itself (Isolated Web Co).

Note: After this issue, I eventually installed earlyoom, whose goal is to kill the largest process when the available memory becomes low. Now, I can still reproduce crashes with YouTube from time to time, but only the tab crashes.

Here's the crash last night with earlyoom installed:

Jun 11 01:11:35 qaa kernel: audit: type=1400 audit(1749597095.964:1776): apparmor="DENIED" operation="ptrace" class="ptrace" profile="firejail-default" pid=3290 comm="crashhelper" requested_mask="trace" denied_mask="trace" peer="firejail-default"
Jun 11 01:11:35 qaa kernel: audit: type=1400 audit(1749597095.964:1777): apparmor="DENIED" operation="ptrace" class="ptrace" profile="firejail-default" pid=3290 comm="crashhelper" requested_mask="tracedby" denied_mask="tracedby" peer="firejail-default"
Jun 11 01:11:35 qaa kernel: audit: type=1400 audit(1749597095.964:1778): apparmor="DENIED" operation="ptrace" class="ptrace" profile="firejail-default" pid=3290 comm="crashhelper" requested_mask="trace" denied_mask="trace" peer="firejail-default"
Jun 11 01:11:35 qaa kernel: audit: type=1400 audit(1749597095.964:1779): apparmor="DENIED" operation="ptrace" class="ptrace" profile="firejail-default" pid=3290 comm="crashhelper" requested_mask="tracedby" denied_mask="tracedby" peer="firejail-default"
Jun 11 01:11:35 qaa kernel: audit: type=1400 audit(1749597095.964:1780): apparmor="DENIED" operation="ptrace" class="ptrace" profile="firejail-default" pid=3290 comm="crashhelper" requested_mask="trace" denied_mask="trace" peer="firejail-default"
Jun 11 01:11:35 qaa kernel: audit: type=1400 audit(1749597095.964:1781): apparmor="DENIED" operation="ptrace" class="ptrace" profile="firejail-default" pid=3290 comm="crashhelper" requested_mask="tracedby" denied_mask="tracedby" peer="firejail-default"
Jun 11 01:11:35 qaa kernel: audit: type=1400 audit(1749597095.964:1782): apparmor="DENIED" operation="ptrace" class="ptrace" profile="firejail-default" pid=3290 comm="crashhelper" requested_mask="trace" denied_mask="trace" peer="firejail-default"
Jun 11 01:11:35 qaa kernel: audit: type=1400 audit(1749597095.964:1783): apparmor="DENIED" operation="ptrace" class="ptrace" profile="firejail-default" pid=3290 comm="crashhelper" requested_mask="tracedby" denied_mask="tracedby" peer="firejail-default"
Jun 11 01:11:35 qaa kernel: audit: type=1400 audit(1749597095.964:1784): apparmor="DENIED" operation="ptrace" class="ptrace" profile="firejail-default" pid=3290 comm="crashhelper" requested_mask="trace" denied_mask="trace" peer="firejail-default"
Jun 11 01:11:35 qaa kernel: audit: type=1400 audit(1749597095.964:1785): apparmor="DENIED" operation="ptrace" class="ptrace" profile="firejail-default" pid=3290 comm="crashhelper" requested_mask="tracedby" denied_mask="tracedby" peer="firejail-default"
Jun 11 01:11:36 qaa earlyoom[1267]: mem avail:  1199 of 13225 MiB ( 9.07%), swap free:    0 of  975 MiB ( 0.01%)
Jun 11 01:11:36 qaa earlyoom[1267]: low memory! at or below SIGTERM limits: mem 10.00%, swap 10.00%
Jun 11 01:11:36 qaa earlyoom[1267]: sending SIGTERM to process 743843 uid 1000 "Isolated Web Co": oom_score 846, VmRSS 5540 MiB, cmdline "/usr/lib/firefox/firefox -contentproc -isForBrowser -prefsHandle 0:42811 -prefMapHandle 1:281074 -jsInitHandle 2:245828 -parentBuildID 20250522210034 -sandboxReporter 3 -ipcHandle 4 -initialChannelId {4f58bb3f-6ede-40bf-b8fe-8a36600535bb} -parentPid 46 -"
Jun 11 01:11:36 qaa earlyoom[1267]: kill_release: pid=743843: process_mrelease pidfd=4 failed: Invalid argument
Jun 11 01:11:36 qaa systemd[1]: fwupd.service: Deactivated successfully.
Jun 11 01:11:36 qaa systemd[1]: fwupd.service: Consumed 2.254s CPU time, 18M memory peak.
Jun 11 01:11:36 qaa earlyoom[1267]: escalating to SIGKILL after 0.401 seconds
Jun 11 01:11:36 qaa earlyoom[1267]: kill_release: pid=743843: process_mrelease pidfd=4 failed: Invalid argument
Jun 11 01:11:36 qaa wireplumber[2041]: spa.audioconvert: 0x5585210b8800: (0 suppressed) out of buffers on port 0 1
Jun 11 01:11:37 qaa bluetoothd[1275]: Player unregistered: sender=:1.47 path=/_1_23
Jun 11 01:11:37 qaa earlyoom[1267]: process 743843 exited after 0.802 seconds

but I don't understand why there were only 13 GB available for user space. This is a machine with 32 GB memory.

A YouTube tab crashed again, with FF 141.0; it was taking more than 3 GB before being killed by earlyoom.

Note: AutoPlay is blocked and the live video wasn't even being played, but the chat was active.

About the consequence of this bug, i.e. other processes killed before the culprit process associated with the tab is killed, see bug 1787638.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: