pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix memory corruption/crash in ANALYZE.
Date: Tue, 18 Jun 2019 22:55:37 +0000
Message-ID: <E1hdN0r-0004xr-Vr@gemulon.postgresql.org> (raw)

Fix memory corruption/crash in ANALYZE.

This fixes an embarrassing oversight I (Andres) made in 737a292b,
namely missing two place where liverows/deadrows were used when
converting those variables to pointers, leading to incrementing the
pointer, rather than the value.

It's not that actually that easy to trigger a crash: One needs tuples
deleted by the current transaction, followed by a tuple deleted in
another session, all in one page. Which is presumably why this hasn't
been noticed before.

Reported-By: Steve Singer
Author: Steve Singer
Discussion: https://postgr.es/m/c7988239-d42c-ddc4-41db-171b23b35e4f@ssinger.info

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/23224563d97913aa824d04c498d59ad4d85fda38

Modified Files
--------------
src/backend/access/heap/heapam_handler.c |  4 ++--
src/test/regress/expected/vacuum.out     | 12 ++++++++++++
src/test/regress/sql/vacuum.sql          | 13 +++++++++++++
3 files changed, 27 insertions(+), 2 deletions(-)



Message-ID: <E1hdN0r-0004xr-Vr@gemulon.postgresql.org>
Permalink:  ../E1hdN0r-0004xr-Vr@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1hdN0r-0004xr-Vr@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: andres@anarazel.de
  Subject: Re: pgsql: Fix memory corruption/crash in ANALYZE.
  In-Reply-To: <E1hdN0r-0004xr-Vr@gemulon.postgresql.org>
  References: <E1hdN0r-0004xr-Vr@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox