Обсуждение: postgres server crash with "Segmentation fault"
Hi team,
We are using PG16.9 in Patroni Postgres setup in production. Last night we have face an issue where postgres server got crash with “Segmentation fault” on table with auto vacuum task. Interestingly in standby node while we perform vacuum on same table standby node was also got crash. The table was not able to get query on the table as while executing select statement also crash the database.
we have observed few error prior to crash for same table. (Table name and function details change for purpose)
"ERROR : Error occurred at function get_details page 117 of relation ""impacted_table"" should be empty but is not"
During the same time the other table also getting below error. However once the database restart, we were not getting any issue for table oid= 1108029
“ERROR : Error occurred at function get_details unexpected data beyond EOF in block 16276 of relation base/33195/1108029"
At last it got failed as follows
2025-10-15 02:50:52.428 [432443]LOG: terminating any other active server processes"
2025-10-15 02:50:52.428 [432443]DETAIL: Failed process was running: autovacuum: VACUUM ANALYZE schema.impacted_table"
2025-10-15 02:50:52.428 [432443]LOG: server process (PID 390906) was terminated by signal 11: Segmentation fault"
2025-10-15 02:50:55.475 [432443]LOG: all server processes terminated; reinitializing"
2025-10-15 02:51:32.575 [432443]LOG: received immediate shutdown request"
2025-10-15 02:51:32.629 [432443]LOG: database system is shut down"
The function which was executing having truncate table and insert/update statement executing on this table. As this is normally functionality but we are suspecting it during the execution runtime it corrupt the shared memory and data inflight which got replicated to Replica node/DR site and corrupt the same table.
We had to drop the table “impacted_table” from database once the database is up.
however we are not able to identify exact root cause behind “segmentation fault” error for this table and need expert advice to find the root case and also need suggestions to prevention steps.
Thanks & Regards,
-------------------------
Ishan Joshi
The information transmitted herein is intended only for the person or entity to which it is addressed and may contain confidential, proprietary and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.

Willian Colognesi | Principal Engineer
willian.colognesi@platformscience.com
R. Adhemar Pereira de Barros, 1500, 14° floor, Londrina/PR | Brazil
Hi team,
We are using PG16.9 in Patroni Postgres setup in production. Last night we have face an issue where postgres server got crash with “Segmentation fault” on table with auto vacuum task. Interestingly in standby node while we perform vacuum on same table standby node was also got crash. The table was not able to get query on the table as while executing select statement also crash the database.
we have observed few error prior to crash for same table. (Table name and function details change for purpose)
"ERROR : Error occurred at function get_details page 117 of relation ""impacted_table"" should be empty but is not"
During the same time the other table also getting below error. However once the database restart, we were not getting any issue for table oid= 1108029
“ERROR : Error occurred at function get_details unexpected data beyond EOF in block 16276 of relation base/33195/1108029"
At last it got failed as follows
2025-10-15 02:50:52.428 [432443]LOG: terminating any other active server processes"2025-10-15 02:50:52.428 [432443]DETAIL: Failed process was running: autovacuum: VACUUM ANALYZE schema.impacted_table"
2025-10-15 02:50:52.428 [432443]LOG: server process (PID 390906) was terminated by signal 11: Segmentation fault"
2025-10-15 02:50:55.475 [432443]LOG: all server processes terminated; reinitializing"
2025-10-15 02:51:32.575 [432443]LOG: received immediate shutdown request"
2025-10-15 02:51:32.629 [432443]LOG: database system is shut down"
The function which was executing having truncate table and insert/update statement executing on this table. As this is normally functionality but we are suspecting it during the execution runtime it corrupt the shared memory and data inflight which got replicated to Replica node/DR site and corrupt the same table.
We had to drop the table “impacted_table” from database once the database is up.
however we are not able to identify exact root cause behind “segmentation fault” error for this table and need expert advice to find the root case and also need suggestions to prevention steps.
Thanks & Regards,
-------------------------
Ishan Joshi
The information transmitted herein is intended only for the person or entity to which it is addressed and may contain confidential, proprietary and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
On Thu, 2025-10-16 at 11:07 +0000, Ishan Arunkumar Joshi wrote: > We are using PG16.9 in Patroni Postgres setup in production. Last night we have face > an issue [various data corruption errors] > > We had to drop the table “impacted_table” from database once the database is up. > > however we are not able to identify exact root cause behind “segmentation fault” > error for this table and need expert advice to find the root case and also need > suggestions to prevention steps. By dropping the table, you have probably destroyed the evidence needed for that. If you have a file system backup of the corrupted state, an expert might be able to identify probable causes. One prevention step would have been to run the latest minor release (currently 16.10). Other than that, make sure that you have a good backup that is occasionally tested and make sure that the backup is monitored (I have seen cases where the backup was a daily pg_dump, and only when the corruption surfaced, people realized that the pg_dump had been failing for the exact same reason...). Yours, Laurenz Albe
Hi Willian,
Thanks for the response. Yes I found the thread where it suggesting to disable JIT. However it is not I am not sure how JIT impact to resolve it. I assume the last occurrence on thread mentioned that even after stopping the JIT segmentation fault was happened. So I believe it is not a root cause and solution.
Thanks & Regards,
-------------------------
Ishan Joshi
From: Willian Colognesi <willian.colognesi@platformscience.com>
Sent: Friday, October 17, 2025 6:23 AM
To: Ishan Arunkumar Joshi <ishan.joshi@netcracker.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: postgres server crash with "Segmentation fault"
[External Email]
Not sure if it's the same problem but I saw segmentation faults in the past when jit was enabled in postgres. After disabled it never happened again.

Willian Colognesi | Principal Engineer
willian.colognesi@platformscience.com
R. Adhemar Pereira de Barros, 1500, 14° floor, Londrina/PR | Brazil
On Thu, Oct 16, 2025, 18:54 Ishan Arunkumar Joshi <ishan.joshi@netcracker.com> wrote:
Hi team,
We are using PG16.9 in Patroni Postgres setup in production. Last night we have face an issue where postgres server got crash with “Segmentation fault” on table with auto vacuum task. Interestingly in standby node while we perform vacuum on same table standby node was also got crash. The table was not able to get query on the table as while executing select statement also crash the database.
we have observed few error prior to crash for same table. (Table name and function details change for purpose)
"ERROR : Error occurred at function get_details page 117 of relation ""impacted_table"" should be empty but is not"
During the same time the other table also getting below error. However once the database restart, we were not getting any issue for table oid= 1108029
“ERROR : Error occurred at function get_details unexpected data beyond EOF in block 16276 of relation base/33195/1108029"
At last it got failed as follows
2025-10-15 02:50:52.428 [432443]LOG: terminating any other active server processes"2025-10-15 02:50:52.428 [432443]DETAIL: Failed process was running: autovacuum: VACUUM ANALYZE schema.impacted_table"
2025-10-15 02:50:52.428 [432443]LOG: server process (PID 390906) was terminated by signal 11: Segmentation fault"
2025-10-15 02:50:55.475 [432443]LOG: all server processes terminated; reinitializing"
2025-10-15 02:51:32.575 [432443]LOG: received immediate shutdown request"
2025-10-15 02:51:32.629 [432443]LOG: database system is shut down"
The function which was executing having truncate table and insert/update statement executing on this table. As this is normally functionality but we are suspecting it during the execution runtime it corrupt the shared memory and data inflight which got replicated to Replica node/DR site and corrupt the same table.
We had to drop the table “impacted_table” from database once the database is up.
however we are not able to identify exact root cause behind “segmentation fault” error for this table and need expert advice to find the root case and also need suggestions to prevention steps.
Thanks & Regards,
-------------------------
Ishan Joshi
The information transmitted herein is intended only for the person or entity to which it is addressed and may contain confidential, proprietary and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
The information transmitted herein is intended only for the person or entity to which it is addressed and may contain confidential, proprietary and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
Hi Laurenz, >By dropping the table, you have probably destroyed the evidence needed for that. >If you have a file system backup of the corrupted state, an expert might be able to identify probable causes. >One prevention step would have been to run the latest minor release (currently 16.10). >Other than that, make sure that you have a good backup that is occasionally tested and make sure that the backup is monitored(I have seen cases >where the backup was a daily pg_dump, and only when the corruption surfaced, people realizedthat the pg_dump had been failing for the exact same >reason...). Thanks for your reply We are using pgbackrest backup and incremental backup was taken it before. We have very large database (>25TB) and currentlywe do not have another server having same capacity to restore. However I am suspecting the corruption on the tablewas happen during some operation happening runtime which triggers the autovacuum and because the corruption happen alreadyright before the restart, when autovacuum got lock to execute, it is getting segmentation fault and restart the postgresservice. I tried to execute select query on that same table but it failed with same error and hence I did not take risk of executingpg_dump as it may restart db server and impact the production and because it is temp table populating for some process,we took decision to drop the table and recreate. We are still clueless how the table got corrupted and segmentation fault occurs. I gone through old thread where it suggest to disable JIT but the same solution not worked hence I am not considering itas root cause and solution. Thanks & Regards, ------------------------- Ishan Joshi -----Original Message----- From: Laurenz Albe <laurenz.albe@cybertec.at> Sent: Friday, October 17, 2025 12:20 PM To: Ishan Arunkumar Joshi <ishan.joshi@netcracker.com>; pgsql-admin@postgresql.org Subject: Re: postgres server crash with "Segmentation fault" [External Email] ________________________________ On Thu, 2025-10-16 at 11:07 +0000, Ishan Arunkumar Joshi wrote: > We are using PG16.9 in Patroni Postgres setup in production. Last > night we have face an issue [various data corruption errors] > > We had to drop the table “impacted_table” from database once the database is up. > > however we are not able to identify exact root cause behind “segmentation fault” > error for this table and need expert advice to find the root case and > also need suggestions to prevention steps. By dropping the table, you have probably destroyed the evidence needed for that. If you have a file system backup of the corrupted state, an expert might be able to identify probable causes. One prevention step would have been to run the latest minor release (currently 16.10). Other than that, make sure that you have a good backup that is occasionally tested and make sure that the backup is monitored(I have seen cases where the backup was a daily pg_dump, and only when the corruption surfaced, people realizedthat the pg_dump had been failing for the exact same reason...). Yours, Laurenz Albe ________________________________ The information transmitted herein is intended only for the person or entity to which it is addressed and may contain confidential,proprietary and/or privileged material. Any review, retransmission, dissemination or other use of, or takingof any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.If you received this in error, please contact the sender and delete the material from any computer.
Hi Team, Do we have any more suggestions or way forward for further investigation. Please suggest the same. Thanks & Regards, ------------------------- Ishan Joshi -----Original Message----- From: Ishan Arunkumar Joshi Sent: Friday, October 17, 2025 4:45 PM To: 'Laurenz Albe' <laurenz.albe@cybertec.at>; pgsql-admin@postgresql.org Subject: RE: postgres server crash with "Segmentation fault" Hi Laurenz, >By dropping the table, you have probably destroyed the evidence needed for that. >If you have a file system backup of the corrupted state, an expert might be able to identify probable causes. >One prevention step would have been to run the latest minor release (currently 16.10). >Other than that, make sure that you have a good backup that is occasionally tested and make sure that the backup is monitored(I have seen cases >where the backup was a daily pg_dump, and only when the corruption surfaced, people realizedthat the pg_dump had been failing for the exact same >reason...). Thanks for your reply We are using pgbackrest backup and incremental backup was taken it before. We have very large database (>25TB) and currentlywe do not have another server having same capacity to restore. However I am suspecting the corruption on the tablewas happen during some operation happening runtime which triggers the autovacuum and because the corruption happen alreadyright before the restart, when autovacuum got lock to execute, it is getting segmentation fault and restart the postgresservice. I tried to execute select query on that same table but it failed with same error and hence I did not take risk of executingpg_dump as it may restart db server and impact the production and because it is temp table populating for some process,we took decision to drop the table and recreate. We are still clueless how the table got corrupted and segmentation fault occurs. I gone through old thread where it suggest to disable JIT but the same solution not worked hence I am not considering itas root cause and solution. Thanks & Regards, ------------------------- Ishan Joshi -----Original Message----- From: Laurenz Albe <laurenz.albe@cybertec.at> Sent: Friday, October 17, 2025 12:20 PM To: Ishan Arunkumar Joshi <ishan.joshi@netcracker.com>; pgsql-admin@postgresql.org Subject: Re: postgres server crash with "Segmentation fault" [External Email] ________________________________ On Thu, 2025-10-16 at 11:07 +0000, Ishan Arunkumar Joshi wrote: > We are using PG16.9 in Patroni Postgres setup in production. Last > night we have face an issue [various data corruption errors] > > We had to drop the table “impacted_table” from database once the database is up. > > however we are not able to identify exact root cause behind “segmentation fault” > error for this table and need expert advice to find the root case and > also need suggestions to prevention steps. By dropping the table, you have probably destroyed the evidence needed for that. If you have a file system backup of the corrupted state, an expert might be able to identify probable causes. One prevention step would have been to run the latest minor release (currently 16.10). Other than that, make sure that you have a good backup that is occasionally tested and make sure that the backup is monitored(I have seen cases where the backup was a daily pg_dump, and only when the corruption surfaced, people realizedthat the pg_dump had been failing for the exact same reason...). Yours, Laurenz Albe ________________________________ The information transmitted herein is intended only for the person or entity to which it is addressed and may contain confidential,proprietary and/or privileged material. Any review, retransmission, dissemination or other use of, or takingof any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.If you received this in error, please contact the sender and delete the material from any computer.