Segfault when running postgres inside kubernetes with huge pages

From: Siegfried Kiermayer <sicaine(at)gmail(dot)com>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Segfault when running postgres inside kubernetes with huge pages
Date: 2023-11-07 17:41:38
Message-ID: CAC-et2dPHZkroNELgfVCS-NE7fD93jQiygoYAOOkmgJ+uc-ARA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

we are using zalando postgres operator and i changed / set huge pages
on kubernetes nodes from something undefined to 1536 (undefined
because i was pretty sure before changing it to 1536 i saw an initial
value of 1024 with 670 in use.

Postgres stoped working after setting it to 1536 and restarting the
node. I was scratching my head why because i did saw huge pages before
and didn't connect it at all.

I found core dumps and this is the output:

Core was generated by `/usr/lib/postgresql/14/bin/postgres -D
/home/postgres/pgdata/pgroot/data --conf'.
Program terminated with signal SIGBUS, Bus error.

warning: Section `.reg-xstate/999' in core file too small.
#0 0x0000558ea5345148 in PGSharedMemoryCreate ()
(gdb) bt
#0 0x0000558ea5345148 in PGSharedMemoryCreate ()
#1 0x0000558ea53c157f in CreateSharedMemoryAndSemaphores ()
#2 0x0000558ea5357240 in PostmasterMain ()
#3 0x0000558ea506777a in main ()

This gave me the first indication that it is related to huge pages
setting on the node itself.

I would go into more detail but honestly I believe this might be easy
to find and I also assume it shouldn't segfault but return an error
message indicating the / a issue.

I'm aware that huge pages and other normal features like swap are not
normal inside kubernetes but fyi in kubernetes 1.28 there will be huge
pages support https://kubernetes.io/docs/tasks/manage-hugepages/scheduling-hugepages/

Thanks,

Sigi

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Sergei Kornilov 2023-11-07 20:23:17 Re:BUG #17552: pg_stat_statements tracks internal FK check queries when COPY used to load data
Previous Message PG Bug reporting form 2023-11-07 17:04:23 BUG #18187: Unexpected error: "variable not found in subplan target lists" triggered by JOIN