Re: [GENERAL] Hung postmaster (8.3.9) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [GENERAL] Hung postmaster (8.3.9)
Date
Msg-id 2833.1267504621@sss.pgh.pa.us
Whole thread Raw
Responses Re: Hung postmaster (8.3.9)  (Greg Stark <stark@mit.edu>)
List pgsql-hackers
"Ed L." <pgsql@bluepolka.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

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [GENERAL] trouble with to_char('L')
Next
From: Bruce Momjian
Date:
Subject: Re: Re: Hot Standby query cancellation and Streaming Replication integration