BUG #16330: psql accesses null pointer in connect.c:do_connect

Поиск
Список
Период
Сортировка
От PG Bug reporting form
Тема BUG #16330: psql accesses null pointer in connect.c:do_connect
Дата
Msg-id 16330-b34835d83619e25d@postgresql.org
обсуждение исходный текст
Ответы Re: BUG #16330: psql accesses null pointer in connect.c:do_connect  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-bugs
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


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

Предыдущее
От: Hugh Wang
Дата:
Сообщение: Re: BUG #16321: Memory leaks in PostmasterMain
Следующее
От: Alexander Lakhin
Дата:
Сообщение: Re: BUG #16329: Valgrind detects an invalid read when building a gistindex with buffering