Re: POC: GUC option for skipping shared buffers in core dumps - Mailing list pgsql-hackers

From Andres Freund
Subject Re: POC: GUC option for skipping shared buffers in core dumps
Date
Msg-id 20200210210331.hhdqrhk4ontzaxhg@alap3.anarazel.de
Whole thread Raw
In response to Re: POC: GUC option for skipping shared buffers in core dumps  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: POC: GUC option for skipping shared buffers in core dumps
List pgsql-hackers
Hi,

On 2020-02-10 17:31:47 -0300, Alvaro Herrera wrote:
> Yeah.  Maybe we should file bug reports against downstream packages to
> include a corefilter tweak.

Hm, I'm not sure that's a reasonable way to scale things. Nor am I
really sure that's the right granularity.


> My development helper script uses this
> 
> runpg_corefilter() {
>     pid=$(head -1 $PGDATADIR/postmaster.pid)
>     if [ ! -z "$pid" ]; then
>         echo 0x01 > /proc/$pid/coredump_filter 
>     fi
> }
> 
> I don't know how easy is it to teach systemd to do this on its service
> files.

Well, you could just make it part of the command that starts the
server. Not aware of anything else.


> FWIW I've heard that some people like to have shmem in core files to
> improve debuggability, but it's *very* infrequent.

Oh, I pretty regularly want that. If you're debugging anthying that
includes locks, page accesses, etc, it's pretty hard to succeed without?


> But maybe we should have a way to disable the corefiltering.

There should, imo. That's why I was wondering about making this a GUC
(presumably suset).

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: POC: GUC option for skipping shared buffers in core dumps
Next
From: Alvaro Herrera
Date:
Subject: Re: POC: GUC option for skipping shared buffers in core dumps