core dumps generated in archive / restore commands etc - Mailing list pgsql-hackers

From Andres Freund
Subject core dumps generated in archive / restore commands etc
Date
Msg-id 20221206215806.ka2sq3x7ukipgryy@awork3.anarazel.de
Whole thread Raw
List pgsql-hackers
Hi,

Occasionally I see core dumps for sh, cp etc when running the tests. I think
this is mainly due to immediate shutdowns / crashes signalling the entire
process group with SIGQUIT. If a sh/cp/... is running as part of an
archive/restore command when the signal arrives, we'll trigger a coredump,
because those tools won't have a SIGQUIT handler.

ISTM that postmaster's signal_child() shouldn't send SIGQUIT to the process
group in the #ifdef HAVE_SETSID section. We've already signalled the backend
with SIGQUIT, so we could change the signal we send to the whole process group
to one that doesn't trigger core dumps by default. SIGTERM seems like it would
be the right choice.

The one non-trivial aspect of this is that that signal will also be delivered
to the group leader. It's possible that that could lead to some minor test
behaviour issues, because the output could change if e.g. SIGTERM is received
/ processed first.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: New strategies for freezing, advancing relfrozenxid early
Next
From: Pavel Borisov
Date:
Subject: Re: Allow placeholders in ALTER ROLE w/o superuser