Re: Tuple sort is broken. It crashes on simple test.

From: Peter Geoghegan <pg(at)heroku(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Mithun Cy <mithun(dot)cy(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Subject: Re: Tuple sort is broken. It crashes on simple test.
Date: 2017-01-16 18:24:20
Message-ID: CAM3SWZRtYCAEyyT9am4Te_CaizmHfPehzyRnEsjdc55zzQCBDQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-hackers

On Mon, Jan 16, 2017 at 3:48 AM, Michael Paquier
<michael(dot)paquier(at)gmail(dot)com> wrote:
> Indeed. It crashes for me immediately by adding an ORDER BY:
> select count(distinct t) from seq_tab order by 1;

The problem was that one particular call to the macro
RELEASE_SLAB_SLOT() happened to lack a test-for-NULL-argument needed
by pass-by-value datum cases. The other two RELEASE_SLAB_SLOT() calls
already have such a check.

Attached patch fixes the bug.

--
Peter Geoghegan

Attachment Content-Type Size
0001-Fix-NULL-pointer-dereference-in-tuplesort.c.patch text/x-patch 1.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2017-01-16 18:38:23 Re: Tuple sort is broken. It crashes on simple test.
Previous Message Magnus Hagander 2017-01-16 17:21:50 Re: pg_basebackups and slots