Re: Requesting external_pid_file with postgres -C when not initialized lead to coredump

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Requesting external_pid_file with postgres -C when not initialized lead to coredump
Дата
Msg-id 20160621170227.GA89350@alvherre.pgsql
обсуждение исходный текст
Ответ на Requesting external_pid_file with postgres -C when not initialized lead to coredump  (alain radix <alain.radix@gmail.com>)
Ответы Re: Requesting external_pid_file with postgres -C when not initialized lead to coredump  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-hackers
alain radix wrote:
> Hi,
> 
> I faced a coredump when reading the value of the parameter
> "external_pid_file" when it was not initialized in postgresql.conf
> This came from the value not being specified to be initialized to en empty
> string in guc.c in the ConfigureNamesString array.
> the behavior can easily been tested with the following commands :
> initdb test
> postgres -D test -C external_pid_file
> 
> I faced the problem with version 9.3, 9.5 and 9.6 beta 1
> This seems to come from a long time ago.
> 
> I wrote a patch ( with help from Stéphane Schildknecht ) to correct the
> problem with a proper initialization.

This was fixed six days ago in a slightly different manner:

commit 0b0baf26211a98a8593279fa24635bc4dd9ac99d
Author:     Tom Lane <tgl@sss.pgh.pa.us>
AuthorDate: Thu Jun 16 12:17:03 2016 -0400
CommitDate: Thu Jun 16 12:17:38 2016 -0400
   Avoid crash in "postgres -C guc" for a GUC with a null string value.      Emit "(null)" instead, which was the
behaviorall along on platforms   that don't crash, eg OS X.  Per report from Jehan-Guillaume de Rorthais.   Back-patch
to9.2 where -C option was introduced.      Michael Paquier      Report: <20160615204036.2d35d86a@firost>
 


> The patch also removed a useless initialization of cluster_name to save a
> little memory.

Yeah, we could do away with that I suppose.


> So, here is my first patch for PostgreSQL.

Looking forward to further ones,

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: MultiXactId error after upgrade to 9.3.4
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Reviewing freeze map code