unchecked out of memory in postmaster.c - Mailing list pgsql-hackers

From Alvaro Herrera
Subject unchecked out of memory in postmaster.c
Date
Msg-id 20090406230252.GL4525@alvh.no-ip.org
Whole thread Raw
Responses Re: unchecked out of memory in postmaster.c  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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.


pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: custom tsearch2 parsers
Next
From: Tom Lane
Date:
Subject: Re: unchecked out of memory in postmaster.c