Re: [ADMIN] Can't connect to my postgresql

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Daniel Rubio <drubior(at)tinet(dot)org>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, pgsql-bugs(at)postgreSQL(dot)org
Subject: Re: [ADMIN] Can't connect to my postgresql
Date: 2003-03-31 21:43:44
Message-ID: 25447.1049147024@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-bugs

Daniel Rubio <drubior(at)tinet(dot)org> 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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Kris 2003-03-31 22:08:26 Speed & Memory Management
Previous Message Dmitry Morozovsky 2003-03-31 21:11:31 Re: pgAdmin II questions

Browse pgsql-bugs by date

  From Date Subject
Next Message pgsql-bugs 2003-04-01 01:27:21 Bug #929: Client connection to postgresql hangs indefinitely (under possibly pathological scenarios)
Previous Message Oliver Elphick 2003-03-31 19:56:38 Re: can you solve my problem