BUG #17370: shmem lost on segfault

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: rekgrpth(at)gmail(dot)com
Subject: BUG #17370: shmem lost on segfault
Date: 2022-01-19 03:05:56
Message-ID: 17370-a42a313cf1589256@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 17370
Logged by: RekGRpth
Email address: rekgrpth(at)gmail(dot)com
PostgreSQL version: 14.1
Operating system: docker alpine
Description:

In developing my https://github.com/RekGRpth/pg_task I found strange
behavior of shared memory segment.
I setup shared memory segment and give it to background worker, which I
start with default restart interval.
See
https://github.com/RekGRpth/pg_task/blob/d951723b6e556479f9a3fa960a6b3d1fb8f52164/conf.c#L67-L134
And everything works fine, even if background worker exits on error (if for
example I drop needed table task), then it restarts and can access to shared
memory segment.
See
https://github.com/RekGRpth/pg_task/blob/d951723b6e556479f9a3fa960a6b3d1fb8f52164/work.c#L742
But if third other process terminates by segmentation fault, my background
worker restarts fine but can not access to shared memory segment.
dsm_attach returns NULL
What I need to do to solve this problem?

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Julien Rouhaud 2022-01-19 09:28:28 Re: BUG #17370: shmem lost on segfault
Previous Message Tom Lane 2022-01-18 18:20:31 Re: BUG #17369: tmp files didn't deleted after oom killer killed process