From: Alvaro Herrera <alvherre@dcc.uchile.cl>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: Hackers <pgsql-hackers@postgresql.org>
Subject: Re: Current CVS tip segfaulting
Date: Sat, 1 May 2004 13:04:35 -0400
Message-ID: <20040501170435.GC2333@dcc.uchile.cl> (raw)
In-Reply-To: <10019.1083382596@sss.pgh.pa.us>
References: <20040423211034.GA15956@dcc.uchile.cl>
<200404232300.i3NN05k14802@candle.pha.pa.us>
<20040424003828.GB5259@dcc.uchile.cl>
<20040424023021.GA30353@dcc.uchile.cl>
<10019.1083382596@sss.pgh.pa.us>
On Fri, Apr 30, 2004 at 11:36:36PM -0400, Tom Lane wrote:
> Alvaro Herrera Munoz <alvherre@dcc.uchile.cl> writes:
> > 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.
>
> > else if (argc - optind == 1)
> > ! dbname = argv[optind];
> > ...
> > else if (argc - optind == 1)
> > ! dbname = pstrdup(argv[optind]);
>
> Surely this is a red herring --- that code path does not even execute
> except in the case of a standalone backend.
Yes, I figured that out later (the normal path uses -p instead). In
fact I then took out the pstrdup() and the fault wasn't happening; so I
recompiled all over again, without the pstrdup and it was back.
I think maybe there's something clobbering argv. I thought about
tracing that with gdb but never got to it. I will do that now and
report back.
--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"El miedo atento y previsor es la madre de la seguridad" (E. Burke)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: alvherre@dcc.uchile.cl, tgl@sss.pgh.pa.us, pgman@candle.pha.pa.us
Subject: Re: Current CVS tip segfaulting
In-Reply-To: <20040501170435.GC2333@dcc.uchile.cl>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox