Re: Current CVS tip segfaulting

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Alvaro Herrera Munoz <alvherre(at)dcc(dot)uchile(dot)cl>
Cc: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Current CVS tip segfaulting
Date: 2004-04-24 03:02:55
Message-ID: 200404240302.i3O32tn08743@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


FYI, I just tried:

$ psql lkjasdf
psql: FATAL: database "lkjasdf" does not exist
(2) cat /u/pg/server.log
LOG: database system was shut down at 2004-04-23 15:23:20 EDT
LOG: checkpoint record is at 0/9DCCCC
LOG: redo record is at 0/9DCCCC; undo record is at 0/0; shutdown TRUE
LOG: next transaction ID: 457; next OID: 17208
LOG: database system is ready
FATAL: database "lkjasdf" does not exist

That looks OK to me on BSD/OS.

I can put a copy of CVS head on my ftp site for testing if you wish.

---------------------------------------------------------------------------

Alvaro Herrera Munoz wrote:
> On Fri, Apr 23, 2004 at 08:38:29PM -0400, Alvaro Herrera Munoz wrote:
> > On Fri, Apr 23, 2004 at 07:00:05PM -0400, Bruce Momjian wrote:
> > >
> > > Please recompile with debug symbols and report back the stack trace.
> > > See the faq on running debug.
> >
> > No, I already did that (all my builds are like that anyway and I read
> > stack traces more frequently than I'd like). The "can't read pathname"
> > message I don't understand, but I had never seen it.
>
> strace'ing the postmaster suggested me that the dbname string in
> utils/init/postinit.c, the InitPostgres function, is the culprit.
> In fact, if I apply the following patch to tcop/postgres.c the
> whole thing stops happening. I don't know if this is the correct
> fix, but it may suggest something. Maybe it's a problem with my
> platform's argv handling (Mandrakelinux 10, kernel 2.6.3, glibc 2.3.3).
>
> Index: postgres.c
> ===================================================================
> RCS file: /home/alvherre/cvs/pgsql-server/src/backend/tcop/postgres.c,v
> retrieving revision 1.400
> diff -c -r1.400 postgres.c
> *** postgres.c 19 Apr 2004 17:42:58 -0000 1.400
> --- postgres.c 24 Apr 2004 02:20:47 -0000
> ***************
> *** 2686,2692 ****
> errhint("Try \"%s --help\" for more information.", argv[0])));
> }
> else if (argc - optind == 1)
> ! dbname = argv[optind];
> else if ((dbname = username) == NULL)
> {
> ereport(FATAL,
> --- 2648,2654 ----
> errhint("Try \"%s --help\" for more information.", argv[0])));
> }
> else if (argc - optind == 1)
> ! dbname = pstrdup(argv[optind]);
> else if ((dbname = username) == NULL)
> {
> ereport(FATAL,
>
> --
> Alvaro Herrera (<alvherre[(at)]dcc(dot)uchile(dot)cl>)
> "Et put se mouve" (Galileo Galilei)
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc G. Fournier 2004-04-24 03:11:36 Re: contrib vs. gborg/pgfoundry for replication solutions
Previous Message Bruce Momjian 2004-04-24 02:57:05 Re: Current CVS tip segfaulting