coreos/rpm-ostree

Handle non-exit for initramfs process

Opened this issue · 1 comments

I got this in a 1G qemu run with rpm-ostree initramfs --enable:

Dec 19 19:52:23 cosa-devsh kernel: Out of memory: Killed process 23338 (zstd) total-vm:1452752kB, anon-rss:270208kB, file-rss:224kB, shmem-rss:0kB, UID:0 pgtables:696kB oom_score_adj:0
Dec 19 19:51:15 cosa-devsh systemd[1]: rpm-ostreed.service: A process of this unit has been killed by the OOM killer.
Dec 19 19:51:15 cosa-devsh systemd[1]: Created slice system-systemd\x2dcoredump.slice - Slice /system/systemd-coredump.
Dec 19 19:51:15 cosa-devsh rpm-ostree[1954]: g_subprocess_get_exit_status: assertion 'WIFEXITED (subprocess->status)' failed

There's two bugs here. First, that's pretty crazy that zstd somehow blows through all that memory...doesn't look like compression is tunable for memory limits?

But then the second bug here is we have a daemon crash because the process dies from a signal, and we're not correctly checking https://developer-old.gnome.org/gio/stable/GSubprocess.html#g-subprocess-get-if-exited before g_subprocess_get_exit_status.

This would be fixed by using https://gitlab.gnome.org/GNOME/glib/-/blob/main/glib/gspawn.c#L1037 but we can't do that because it's in 2.70 and c9s has 2.68. But we can open-code it in the places we call it.