X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 561ECD1EBD3 for ; Sat, 1 May 2004 14:04:52 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 39974-07 for ; Sat, 1 May 2004 14:04:32 -0300 (ADT) Received: from 216.155.88.75.dsl.surnet.cl (200.85.202.253.DSL.surnet.cl [200.85.202.253]) by svr1.postgresql.org (Postfix) with ESMTP id ADEE7D1EBBC for ; Sat, 1 May 2004 14:04:31 -0300 (ADT) Received: by 216.155.88.75.dsl.surnet.cl (Postfix, from userid 500) id AA180CF79; Sat, 1 May 2004 13:04:35 -0400 (CLT) Date: Sat, 1 May 2004 13:04:35 -0400 From: Alvaro Herrera To: Tom Lane Cc: Bruce Momjian , Hackers Subject: Re: Current CVS tip segfaulting Message-ID: <20040501170435.GC2333@dcc.uchile.cl> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <10019.1083382596@sss.pgh.pa.us> User-Agent: Mutt/1.5.5.1i X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=2.6 tagged_above=0.0 required=5.0 tests=RCVD_IN_DYNABLOCK, RCVD_IN_SORBS X-Spam-Level: ** X-Archive-Number: 200405/16 X-Sequence-Number: 53094 On Fri, Apr 30, 2004 at 11:36:36PM -0400, Tom Lane wrote: > Alvaro Herrera Munoz 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 () "El miedo atento y previsor es la madre de la seguridad" (E. Burke)