psql Crash in -TIP

Started by Rod Tayloralmost 23 years ago3 messageshackers
Jump to latest
#1Rod Taylor
rbt@rbt.ca

case '/':
if (pset.db)
strncpy(buf, PQdb(pset.db), MAX_PROMPT_SIZE);
break;

In the above code segment from prompt.c (PSQL sources) it appears
PQdb(pset.db) is returning NULL for me.

(gdb) run
Starting program: /usr/home/rbt/work/postgresql/dbdocs/bin/./psql
Welcome to psql 7.4devel, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit

Program received signal SIGSEGV, Segmentation fault.
0x48169d14 in strncpy () from /usr/lib/libc.so.4
(gdb) backtrace
#0 0x48169d14 in strncpy () from /usr/lib/libc.so.4
#1 0x805151a in get_prompt (status=PROMPT_READY) at prompt.c:172
#2 0x804f073 in MainLoop (source=0x4818ddc0) at mainloop.c:178
#3 0x8050c25 in main (argc=1, argv=0xbfbffaa0) at startup.c:301
#4 0x804a43e in _start ()

--
Rod Taylor <rbt@rbt.ca>

PGP Key: http://www.rbt.ca/rbtpub.asc

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Rod Taylor (#1)
Re: psql Crash in -TIP

Rod Taylor <rbt@rbt.ca> writes:

In the above code segment from prompt.c (PSQL sources) it appears
PQdb(pset.db) is returning NULL for me.

Um. I think I know where I broke that ...

regards, tom lane

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Tom Lane (#2)
Re: psql Crash in -TIP

Tom Lane <tgl@sss.pgh.pa.us> writes:

Rod Taylor <rbt@rbt.ca> writes:

In the above code segment from prompt.c (PSQL sources) it appears
PQdb(pset.db) is returning NULL for me.

Um. I think I know where I broke that ...

Fixed now.

regards, tom lane