Re: BUG #14932: SELECT DISTINCT val FROM table gets stuck in an infinite loop

From: "Todd A(dot) Cook" <tcook(at)blackducksoftware(dot)com>
To: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, <pgsql-bugs(at)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: BUG #14932: SELECT DISTINCT val FROM table gets stuck in an infinite loop
Date: 2018-01-08 17:09:56
Message-ID: 55d69e3f-f074-7838-153c-4d1539fe5802@blackducksoftware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 11/27/17 15:59, Todd A. Cook wrote:
> On 11/27/17 14:17, Tomas Vondra wrote:
>> Hi,
>>
>> On 11/27/2017 07:57 PM, tcook(at)blackducksoftware(dot)com wrote:
>>> The following bug has been logged on the website:
>>>
>>> Bug reference:      14932
>>> Logged by:          Todd Cook
>>> Email address:      tcook(at)blackducksoftware(dot)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.

Is this issue likely to be addressed in 10.2?

FWIW, we try to avoid running with local patches, but we are unable to move
past 9.6 without a fix...

-- todd

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Thomas Kellerer 2018-01-08 21:16:57 Re: BUG #15000: Cache lookup failure
Previous Message Tom Lane 2018-01-08 16:04:56 Re: BUG #15000: Cache lookup failure