Re: [sqlsmith] Crash in gather_readnext

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Andreas Seltenreich <seltenreich(at)gmx(dot)de>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [sqlsmith] Crash in gather_readnext
Date: 2016-12-05 21:01:02
Message-ID: CA+TgmobhrM52B2rLV2Mr+ASNbkSN6OocAX8e8mPdiNQjDDE8+A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Dec 5, 2016 at 3:07 PM, Andreas Seltenreich <seltenreich(at)gmx(dot)de> wrote:
> on master as of a0ae54d, there's a 1 in 10e6 chance sqlsmith catches
> gather_readnext reading beyond the gatherstate->readers array with
> readers[gatherstate->readnext]. Sample backtrace below.
>
> As readnext is never explicitly initialized, I think what happens is
> that a rescan gets less workers than the initial scan, and the dangling
> readnext points outside the array. I'm no longer seeing these crashes
> when explicitly initializing readnext to 0 like in the attached patch.

Thanks, great catch! Committed and back-patched to 9.6.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Haribabu Kommi 2016-12-05 21:11:37 Re: Indirect indexes
Previous Message Pantelis Theodosiou 2016-12-05 20:59:19 Re: missing optimization - column <> column