pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: hghwng@gmail.com
Subject: BUG #16330: psql accesses null pointer in connect.c:do_connect
Date: Mon, 30 Mar 2020 02:20:48 +0000
Message-ID: <16330-b34835d83619e25d@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      16330
Logged by:          Hugh Wang
Email address:      hghwng@gmail.com
PostgreSQL version: 12.2
Operating system:   Arch Linux
Description:        

If the connection to postmaster is closed, then trying to re-connect to
another one leads to SIGSEGV.

REPRODUCE:
$ psql
-> \conninfo
You are connected to database "hugh" as user "hugh" via socket in
"/run/postgresql" at port "5432".
*shut down server with commands like "systemctl stop postgresql"*
-> \conninfo 
You are currently not connected to a database.
-> \c a b c d
[1]    984978 segmentation fault (core dumped)  psql

ANALYSIS:
PQhost(o_conn) returns NULL, and strcmp(host, NULL) raises SIGSEGV.

SOURCE:
https://github.com/postgres/postgres/blob/master/src/bin/psql/command.c#L3016



view thread (8+ messages)  latest in thread

Message-ID: <16330-b34835d83619e25d@postgresql.org>
Permalink:  ../16330-b34835d83619e25d@postgresql.org/
Also on:    postgresql.org/message-id/16330-b34835d83619e25d@postgresql.org

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, hghwng@gmail.com
  Subject: Re: BUG #16330: psql accesses null pointer in connect.c:do_connect
  In-Reply-To: <16330-b34835d83619e25d@postgresql.org>

* 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