On Fri, January 9, 2015 20:15, David Fetter wrote:
> [psql_fix_uri_service_003.patch]

Applies on master; the feature (switching services) works well but a \c without 
any parameters produces a segfault:

(centos 6.6, 4.9.2, 64-bit)


$ echo -en "$PGSERVICEFILE\n$PGSERVICE\n$PGPORT\n"
/home/aardvark/.pg_service
service_pola
6968

$ psql
Timing is on.
psql (9.5devel_service_pola_20150109_2340_ac7009abd228)
Type "help" for help.

testdb=# \c service=HEAD
You are now connected to database "testdb" as user "aardvark" via socket in 
"/tmp" at port "6545".
testdb=# \c service=service_pola
You are now connected to database "testdb" as user "aardvark" via socket in 
"/tmp" at port "6968".
testdb=# \c
Segmentation fault (core dumped)


or, under gdb:


(gdb) run
Starting program: 
/home/aardvark/pg_stuff/pg_installations/pgsql.service_pola/bin/psql
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Timing is on.
psql (9.5devel_service_pola_20150109_2340_ac7009abd228)
Type "help" for help.

testdb=# \c

Program received signal SIGSEGV, Segmentation fault.
0x000000000040b1f5 in uri_prefix_length (connstr=0x0) at common.c:1785
1785            if (strncmp(connstr, uri_designator,
(gdb) bt
#0  0x000000000040b1f5 in uri_prefix_length (connstr=0x0) at common.c:1785
#1  recognized_connection_string (connstr=connstr@entry=0x0) at common.c:1805
#2  0x0000000000406592 in do_connect (port=0x676960 "6968", host=0x676940 
"/tmp", user=0x676900 "aardvark", dbname=0x0) at
command.c:1643
#3  exec_command (query_buf=0x678150, scan_state=0x677fc0, cmd=0x68f730 "c") at 
command.c:247
#4  HandleSlashCmds (scan_state=scan_state@entry=0x677fc0, query_buf=0x678150) 
at command.c:112
#5  0x0000000000411283 in MainLoop (source=0x32d4b8e6c0 <_IO_2_1_stdin_>) at 
mainloop.c:335
#6  0x0000000000413b4e in main (argc=<optimized out>, argv=0x7fffffffd9f8) at 
startup.c:340
(gdb)

I hope that helps to pinpoint the problem.


thanks,


Erik Rijkers
















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

Reply via email to