Segmentation fault with postgres -C external_pid_file

From: Jehan-Guillaume de Rorthais <jgdr(at)dalibo(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Segmentation fault with postgres -C external_pid_file
Date: 2016-06-15 18:40:36
Message-ID: 20160615204036.2d35d86a@firost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-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(at)entry=3,
argv=argv(at)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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message yobas 2016-06-15 19:25:05 BUG #14194: Why do these bases are open to public access?
Previous Message Hans Buschmann 2016-06-15 17:26:00 Re: BUG #14192: pg_dump/pg_restore omit setting search_path in restored db