FAQ
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

Search Discussions

  • Tom Lane at May 2, 2003 at 3:53 am

    Rod Taylor 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
  • Tom Lane at May 5, 2003 at 1:03 am

    Tom Lane 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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-hackers @
categoriespostgresql
postedMay 2, '03 at 2:47a
activeMay 5, '03 at 1:03a
posts3
users2
websitepostgresql.org...
irc#postgresql

2 users in discussion

Tom Lane: 2 posts Rod Taylor: 1 post

People

Translate

site design / logo © 2021 Grokbase