Re: MemoryContextSwitchTo (Re: [GENERAL] Autovacuum daemon terminated by signal 11) - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: MemoryContextSwitchTo (Re: [GENERAL] Autovacuum daemon terminated by signal 11)
Date
Msg-id 20090120122330.GB3940@alvh.no-ip.org
Whole thread Raw
In response to Re: MemoryContextSwitchTo (Re: [GENERAL] Autovacuum daemon terminated by signal 11)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> Alvaro Herrera <alvherre@commandprompt.com> writes:

> > But freed memory is clobbered, so if we were to have an assert that
> > checks the node tag, it should show up.  In fact, we do have such an
> > assert, but only for compilers other than GCC, because the inline
> > version of palloc() cannot have it for lack of infrastructure.
> 
> Well, but production installations don't have either memory clobbering
> or Asserts, so fooling with that wouldn't have helped anyway.  I suspect
> what really happened here is that the bug was created by some late
> change during 8.1 development, and nobody ever exercised the
> anti-wraparound code path after that in an assert-enabled build :-(
> In a non-assert build there's a fairly good chance that it'd still
> work because the context header would still be there undamaged.

Well, my builds are all assert-enabled, and I still wasn't able to make
it crash in any way (the new context being allocated in the same
position as the old one is the only explanation I have, but I did not
investigate whether that's what happening).  Maybe Greg Stark's idea of
offsetting pointers returned by palloc could have helped to find the
problem from the outset.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Visibility map and freezing
Next
From: "Greg Stark"
Date:
Subject: Re: is 8.4 array_agg() supposed to work with array values?