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

From Alvaro Herrera
Subject Re: unchecked out of memory in postmaster.c
Date
Msg-id 20090407023111.GQ4525@alvh.no-ip.org
Whole thread Raw
In response to Re: unchecked out of memory in postmaster.c  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: unchecked out of memory in postmaster.c  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: unchecked out of memory in postmaster.c  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> Alvaro Herrera <alvherre@commandprompt.com> writes:
> > Tom Lane wrote:
> >> I guess I need to point out that those ereport calls already pose a far
> >> more substantial risk of palloc failure than the DLNewElem represents.
>
> > Hmm, do they?  I mean, don't they use ErrorContext, which is supposed to
> > be preallocated?
>
> Well, we'd like to think that they pose an insignificant risk, but it's
> hard to credit that DLNewElem isn't insignificant as well.

Yeah, actually as I said earlier, I haven't ever seen this.

> If you're really intent on doing something about this, my inclination
> would be to get rid of the dependence on DLNewElem altogether.  Add
> a Dlelem field to the Backend struct and use DLInitElem (compare
> the way catcache uses that module).

Hmm, yeah, I had seen that code.  So it looks like this instead.

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

Attachment

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: more on out-of-memory
Next
From: Tom Lane
Date:
Subject: Re: more on out-of-memory