pg_upgrade segfaults when given an invalid PGSERVICE value

From: Steve Singer <ssinger(at)ca(dot)afilias(dot)info>
To: PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: pg_upgrade segfaults when given an invalid PGSERVICE value
Date: 2013-03-18 16:08:09
Message-ID: 51473BE9.9020600@ca.afilias.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

If you try running pg_upgrade with the PGSERVICE environment variable
set to some invalid/non-existent service pg_upgrade segfaults

Program received signal SIGSEGV, Segmentation fault.
0x000000000040bdd1 in check_pghost_envvar () at server.c:304
304 for (option = start; option->keyword != NULL; option++)
(gdb) p start
$5 = (PQconninfoOption *) 0x0

PQconndefaults can return NULL if it has issues.

The attached patch prints a minimally useful error message. I don't a
good way of getting a more useful error message out of PQconndefaults()

I checked this against master but it was reported to me as a issue in 9.2

Steve

Attachment Content-Type Size
pg_upgrade_pgservice.diff text/x-patch 807 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2013-03-18 16:46:43 Re: Materialized view assertion failure in HEAD
Previous Message Pavel Stehule 2013-03-18 15:25:37 Re: Improving avg performance for numeric