X-Original-To: pgsql-bugs@postgreSQL.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 78290475CEE for ; Mon, 31 Mar 2003 16:43:53 -0500 (EST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 854B0475FFF for ; Mon, 31 Mar 2003 16:43:48 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h2VLhj2L025448; Mon, 31 Mar 2003 16:43:45 -0500 (EST) To: Daniel Rubio Cc: Bruce Momjian , pgsql-bugs@postgreSQL.org Subject: Re: [ADMIN] Can't connect to my postgresql In-reply-to: <3E815B7B.5000401@tinet.org> References: <3E8061A0.5010805@tinet.org> <28425.1048603338@sss.pgh.pa.us> <3E815B7B.5000401@tinet.org> Comments: In-reply-to Daniel Rubio message dated "Wed, 26 Mar 2003 08:49:15 +0100" Date: Mon, 31 Mar 2003 16:43:44 -0500 Message-ID: <25447.1049147024@sss.pgh.pa.us> From: Tom Lane X-Spam-Status: No, hits=-32.5 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REFERENCES,REPLY_WITH_QUOTES autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200303/208 X-Sequence-Number: 5768 Daniel Rubio writes: > Yes, there's a core in the data directory, here is the stack trace: > bash-2.03# pstack /apps/pgsql-7.3.2/data/core > core '/apps/pgsql-7.3.2/data/core' of 6308: > /apps/pgsql-7.3.2/bin/postmaster -D /apps/pgsql-7.3.2/da > 00123e24 user_group_bsearch_cmp (33d689, 0, ffffffff, 0, 0, 0) + 10 > fef36048 bsearch (8, fffffffc, 0, 4, 0, 123e14) + 4c > 00123ecc get_user_line (33d689, a, 1, 2, 0, 8000) + 30 > 00122ccc md5_crypt_verify (33d558, 33d689, 32a188, 318249, 2b4198, > 2d0ea3) + 2c After staring at the code for awhile, the only scenario I can construct goes like this: 1. You had a $PGDATA/global/pg_pwd file when you started the postmaster. 2. For some reason, the file disappeared or became unreadable. 3. At the next SIGHUP, load_user() would delete user_lines and then exit, leaving user_sorted pointing at pfree'd memory. 4. The above crash is then exactly what one would expect. load_user and load_group are clearly buggy in that they don't take care to keep the data structures in sync after an open failure --- but I'm having a hard time concocting a reason why pg_pwd would disappear like that. Ideas anyone? regards, tom lane