-
-
Notifications
You must be signed in to change notification settings - Fork 249
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
hugetlb cgroup controller does not set rsvd
, leading to segfaults in postgres + initdb
#769
Comments
Your system is running cgroup1? (you can show |
cgroup2 Edit: from $ mount | grep cgroup
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime) |
Cool, thanks. I'll try to look into this one tomorrow or Friday, looks pretty easy to sort out based on the runc change. |
Got the issue reproduced, I'll try a quick fix now but this may get postponed for a week or so as I'm about to leave on a trip :) |
Closes lxc#769 Signed-off-by: Stéphane Graber <[email protected]>
Thanks for the fast turnaround, I appreciate it. |
Closes #769 Signed-off-by: Stéphane Graber <[email protected]>
Required information
Archlinux
Linux <snip> 6.8.1-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 16 Mar 2024 17:15:35 +0000 x86_64 GNU/Linux
Incus Info
Issue description
While attempting to get hugepages working for an unprivileged container postgres database, I encountered repeated segfaults during the
initdb
sequence.This was somewhat confusing to me, because by default postgres/initdb will attempt to use hugepages, but gracefully fallback to normal memory if unavailable,
so clearly, postgres had been sufficiently induced to believe that hugepages did exist, but when it went to use them the host kernel killed the process.
Sometime later this evening I think I have it figured out.
At the end of the repro, you'll be greeted with an error like:
Googling around this error brings up lots of related issues, particularly around Kubernetes deployments.
However, eventually you'll find opencontainers/runtime-spec#1050 which explains the problem:
Which was fixed/added to runc in opencontainers/runc#4073.
I'm not sure how exactly this translates to incus's codebase, but from what little digging I've done around the hugetlb controller,
I can find no mention of setting
hugetlb.<pagesize>.rsvd
cgroups, only the olderhugetlb.<pagesize>.limit_in_bytes
.Steps to reproduce
Information to attach
pg_createcluster log
Side note, congrats on the first stable release of incus. I was very happy to see the project back in the hands of linuxcontainers after the Canonical announcement.
The text was updated successfully, but these errors were encountered: