Re: Hung postmaster (8.3.9)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Ed L(dot)" <pgsql(at)bluepolka(dot)net>
Cc: pgsql-general(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Hung postmaster (8.3.9)
Date: 2010-03-02 04:37:01
Message-ID: 2833.1267504621@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

"Ed L." <pgsql(at)bluepolka(dot)net> writes:
> On Monday 01 March 2010 @ 17:57, Tom Lane wrote:
>> BTW, there seems to be some other contributing factor here
>> besides the weird username, because I don't see any looping
>> when I try CREATE USER "@". What's your platform exactly,
>> and what type of filesystem is $PGDATA on?

> This is CentOS 5.2, Linux 2.6.18-92.1.22.el5 #1 SMP x86_64
> GNU/Linux.

Ah. I can reproduce it on my Fedora box. The infinite loop is because
feof never returns 1 when reading from a directory. I think this is a
glibc bug and have filed it accordingly:
https://bugzilla.redhat.com/show_bug.cgi?id=569697
but IME the glibc boys can be pretty stubborn about acknowledging that
corner cases in their code are actually bugs. We shall see.

In the meantime, it seems like we ought to take two defensive steps:
prevent a quoted @ from being considered as an include introducer,
and prevent @ with no additional text from being considered as an
inclusion reference no matter what. What the current code is doing
is seeing "@" as an include file reference with empty include name,
and by the time canonicalize_file is done with it this ends up as
a reference to the $PGDATA/global directory itself. Which Fedora
allows us to open and read, but it reads as an infinite sequence
of EOF characters because feof never succeeds.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian von Bidder 2010-03-02 07:49:13 Re: Optimizer: ranges and partial indices? Or use partitioning?
Previous Message Bruce Momjian 2010-03-02 03:36:44 Re: [GENERAL] trouble with to_char('L')

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2010-03-02 04:54:04 Re: Re: Hot Standby query cancellation and Streaming Replication integration
Previous Message Bruce Momjian 2010-03-02 03:36:44 Re: [GENERAL] trouble with to_char('L')