pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
To: pgsql-bugs@postgresql.org
Subject: Segmentation fault with postgres -C external_pid_file
Date: Wed, 15 Jun 2016 20:40:36 +0200
Message-ID: <20160615204036.2d35d86a@firost> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Hello,

I just found that the following command always produce a segmentation fault
when external_pid_file is kept commented:

  $ postgres -C external_pid_file
  Segmentation fault (core dumped)


Here is the full backtrace from the core file using 9.5.3:

  (gdb) bt full
  #0  strlen () at ../sysdeps/x86_64/strlen.S:106
  No locals.
  #1  0x00007fe0f397e99c in _IO_puts (str=0x0) at ioputs.c:36
        result = -1
        len = <optimized out>
  #2  0x0000000000643dc6 in PostmasterMain (argc=argc@entry=3,
  argv=argv@entry=0x297c170) at postmaster.c:827
        opt = <optimized out>
        status = <optimized out>
        userDoption = 0x0
        listen_addr_saved = 0 '\000'
        i = <optimized out>
        output_config_variable = 0x2997c90 "external_pid_file"
        __func__ = "PostmasterMain"
  #3  0x000000000046a377 in main (argc=3, argv=0x297c170) at main.c:228
  No locals.


This has been tested only with 9.5 and 9.4.

The following simple patch seems to fix this bug:

  diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
  index f249b390..0362555 100644
  --- a/src/backend/utils/misc/guc.c
  +++ b/src/backend/utils/misc/guc.c
  @@ -3269,7 +3269,7 @@ static struct config_string ConfigureNamesString[] =
                          GUC_SUPERUSER_ONLY
                  },
                  &external_pid_file,
  -               NULL,
  +               "",
                  check_canonical_path, NULL, NULL
          },


Regards,
-- 
Jehan-Guillaume de Rorthais
Dalibo


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (4+ messages)  latest in thread

Message-ID: <20160615204036.2d35d86a@firost>
Permalink:  ../20160615204036.2d35d86a@firost/
Also on:    postgresql.org/message-id/20160615204036.2d35d86a@firost

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: jgdr@dalibo.com
  Subject: Re: Segmentation fault with postgres -C external_pid_file
  In-Reply-To: <20160615204036.2d35d86a@firost>
  References: <20160615204036.2d35d86a@firost>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox