Re: Requesting external_pid_file with postgres -C when not initialized lead to coredump - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Requesting external_pid_file with postgres -C when not initialized lead to coredump
Date
Msg-id 31275.1466609099@sss.pgh.pa.us
Whole thread Raw
In response to Re: Requesting external_pid_file with postgres -C when not initialized lead to coredump  (alain radix <alain.radix@gmail.com>)
Responses Re: Requesting external_pid_file with postgres -C when not initialized lead to coredump  (alain radix <alain.radix@gmail.com>)
List pgsql-hackers
alain radix <alain.radix@gmail.com> writes:
> Here is a new patch with postmaster.c modification so that it check about a
> empty string instead of a null pointer.

Why should we adopt this, when there is already a better (more complete)
fix in git?

I'm not sold on the wisdom of modifying the semantics of
external_pid_file, which is what this patch effectively does.  I don't
know if anything outside our core code looks at that variable, but if
anything does, this would create issues for it.

I'm even less sold on the wisdom of changing every other GUC that
has a null bootstrap default, which is what we would also have to do
in order to avoid the identical misbehavior for other -C cases.

> The meaning is no more to avoid a core dump as you've done a change for
> that but to have the same result with postgres -C as with a request to
> pg_settings, an empty string when the parameter is not set.

Well, maybe we should make -C print an empty string not "(nil)" for
such cases.  You're right that we don't make a distinction between
NULL and "" in other code paths that display a string GUC, so doing
so here is a bit inconsistent.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Hash Indexes
Next
From: Rui Hai Jiang
Date:
Subject: how is the WAL receiver process stopped and restarted when the network connection is broken and then restored?