unchecked out of memory in postmaster.c

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: unchecked out of memory in postmaster.c
Date: 2009-04-06 23:02:52
Message-ID: 20090406230252.GL4525@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Some time ago I noticed that in postmaster.c there's a corner case which
probably causes postmaster to exit in out-of-memory condition. See
BackendStartup, near the bottom, there's a call to DLNewElem(). The
problem is that this function calls palloc() and thus can elog(ERROR) on
OOM, but postmaster has no way to defend itself from this and would die.

I haven't ever seen postmaster die from this, but I don't think it's a
good idea to let it be like this, given the strict promises we make
about its reliability. Probably a simple PG_TRY block around the
DLNewElem call suffices ...?

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-04-06 23:07:35 Re: unchecked out of memory in postmaster.c
Previous Message Kevin Grittner 2009-04-06 22:29:15 custom tsearch2 parsers