pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Todd A. Cook <tcook@blackducksoftware.com>
To: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #14932: SELECT DISTINCT val FROM table gets stuck in an infinite loop
Date: Mon, 27 Nov 2017 15:59:37 -0500
Message-ID: <7a22f496-92b5-d199-984e-183965918304@blackducksoftware.com> (raw)
In-Reply-To: <fd924fd9-8f27-d945-04a9-57b503896107@2ndquadrant.com>
References: <20171127185700.1470.20362@wrigleys.postgresql.org>
	<fd924fd9-8f27-d945-04a9-57b503896107@2ndquadrant.com>

On 11/27/17 14:17, Tomas Vondra wrote:
> Hi,
> 
> On 11/27/2017 07:57 PM, tcook@blackducksoftware.com wrote:
>> The following bug has been logged on the website:
>>
>> Bug reference:      14932
>> Logged by:          Todd Cook
>> Email address:      tcook@blackducksoftware.com
>> PostgreSQL version: 10.1
>> Operating system:   CentOS Linux release 7.4.1708 (Core)
>> Description:
>>
>> It hangs on a table with 167834 rows, though it works fine with only 167833
>> rows.  When it hangs, CTRL-C does not interrupt it, and the backend has to
>> be killed to stop it.
>>
> 
> Can you share the query and data, so that we can reproduce the issue?
> 
> Based on the stack traces this smells like a bug in the simplehash,
> introduced in PostgreSQL 10. Perhaps somewhere in tuplehash_grow(),
> which gets triggered for 167834 rows (but not for 167833).

I've attached a reproducer using real data.  (FWIW, I wasn't able to reproduce with
fake data made with generate_series().)

Also, I forgot to mention that this problem is not present in 9.6 or 9.5.

-- todd

Attachments:

  reproducer.pgsql (text/plain, 3.3M) download

view thread (70+ messages)  latest in thread

Message-ID: <7a22f496-92b5-d199-984e-183965918304@blackducksoftware.com>
Permalink:  ../7a22f496-92b5-d199-984e-183965918304@blackducksoftware.com/
Also on:    postgresql.org/message-id/7a22f496-92b5-d199-984e-183965918304@blackducksoftware.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tcook@blackducksoftware.com, tomas.vondra@2ndquadrant.com
  Subject: Re: BUG #14932: SELECT DISTINCT val FROM table gets stuck in an infinite loop
  In-Reply-To: <7a22f496-92b5-d199-984e-183965918304@blackducksoftware.com>

* 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