Re: MemoryContextSwitchTo (Re: [GENERAL] Autovacuum daemon terminated by signal 11)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: MemoryContextSwitchTo (Re: [GENERAL] Autovacuum daemon terminated by signal 11)
Date: 2009-01-17 16:35:18
Message-ID: 12906.1232210118@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Simon Riggs <simon(at)2ndQuadrant(dot)com> writes:
> Can we add something to memory contexts to make this fail every time?

No, not really. AFAICS the reason for Alvaro not seeing it must be that
on his machine the new transaction happens to allocate its
TopTransactionContext control block right in the same place where the
old one was.

We could have a debugging mode in which pfree'd space is never recycled
for reuse (just filled with 0xdeadbeef or whatever and left to sit).
But it would not be practical for anything except short debugging
sessions. In fact, for a case like this, only *very* short debugging
sessions, because you couldn't even recycle after transaction commit.
So the chance of finding problems in seldom-exercised code paths, as
this one is, would be pretty small anyway.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Simon Riggs 2009-01-17 17:01:28 Re: MemoryContextSwitchTo (Re: [GENERAL] Autovacuum daemon terminated by signal 11)
Previous Message Tom Lane 2009-01-17 15:49:54 Re: Autovacuum daemon terminated by signal 11

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2009-01-17 17:01:28 Re: MemoryContextSwitchTo (Re: [GENERAL] Autovacuum daemon terminated by signal 11)
Previous Message Brendan Jurd 2009-01-17 16:25:45 Re: pg_dump versus views and opclasses