Re: Allocations in critical section (was Re: WAL format and API changes (9.5)) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Allocations in critical section (was Re: WAL format and API changes (9.5))
Date
Msg-id 5381.1396619798@sss.pgh.pa.us
Whole thread Raw
In response to Allocations in critical section (was Re: WAL format and API changes (9.5))  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Responses Re: Allocations in critical section (was Re: WAL format and API changes (9.5))  (Heikki Linnakangas <hlinnakangas@vmware.com>)
List pgsql-hackers
Heikki Linnakangas <hlinnakangas@vmware.com> writes:
> Ok, I fixed the issues that the assertion fixed. I also committed a 
> patch to add the assertion itself; let's see if the buildfarm finds more 
> cases that violate the rule.

> It ignores the checkpointer, because it's known to violate the rule,

... uh, isn't that a bug to be fixed?

> and 
> allocations in ErrorContext, which is used during error recovery, e.g if 
> you indeed PANIC while in a critical section for some other reason.

Yeah, I realized we'd have to do something about elog's own allocations.
Not sure if a blanket exemption for ErrorContext is the best way.  I'd
been thinking of having a way to turn off the complaint once processing
of an elog(PANIC) has started.

> I didn't backpatch this.

Agreed.

BTW, I'm pretty sure you added some redundant assertions in mcxt.c.
eg, palloc does not need its own copy.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Securing "make check" (CVE-2014-0067)
Next
From: Andres Freund
Date:
Subject: Re: GiST support for inet datatypes