Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJOuM-0005TG-Fj for pgsql-bugs@arkaria.postgresql.org; Mon, 27 Nov 2017 19:17:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJOuM-0004hQ-1G for pgsql-bugs@arkaria.postgresql.org; Mon, 27 Nov 2017 19:17:34 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eJOuL-0004hF-KT for pgsql-bugs@lists.postgresql.org; Mon, 27 Nov 2017 19:17:33 +0000 Received: from mail-wr0-x232.google.com ([2a00:1450:400c:c0c::232]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eJOuI-0006ri-F0 for pgsql-bugs@postgresql.org; Mon, 27 Nov 2017 19:17:32 +0000 Received: by mail-wr0-x232.google.com with SMTP id z75so26157944wrc.5 for ; Mon, 27 Nov 2017 11:17:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=MkqkoADOzQpZre6OgaJYZxL64vwHik9vxCAyIgX+Utk=; b=pe3/69+Ucv3KQWRzLgDzmebuiqXiKW/4N+Z7NwUHG8kg5T265ILL8mrGwRt4XdTSTP 7zGihRvsBvwpdWrZP6ZFF4rrLwantIQyqLJp7ezH8RRi3wUQ45i+Pvjh3gWP+b41Ety/ 43Opmk5xrnDKOFcAmx3vcjHMXZBo93j6j1JfGWnvxlDyg6H0tjDLsF2LAe6igQF1k+cv clWNBrdekBGFJhtT0s9vf0mmzJ2bE3U9pG5n8hfrdAqYmtGDKJgohKLyVPwl7j2C2Uf0 J1driCaXUn5U+YB8kRfgZoPqw0iKd2ziwPVUCv3k5T4XC1WxliubNV3RmfiRusPpUsq3 wIFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=MkqkoADOzQpZre6OgaJYZxL64vwHik9vxCAyIgX+Utk=; b=JT+oKWHnbd8Ad6dqyTtVWoauVNilcts0jcQozHfMCHjopAFg/ItNt3RwbBJ+gvNC7o YMvEbiOND8qEv7XDDWHm9XYmJfF4kSBz+9/dFAoZIW5fMaA24fAlcKgEiVqfJSzVigfR plE43QYKNl6k2Xf2v1hWJdURpuykTn7IB+rYvB1XdGpMBRCsAz4EvEe/GwSGutRLR4s+ aDpECmBeojwC+VbK1EbCUM39t77c3qcBm88DfAHoWewXC0XsAlf7b9gx4BM8z9F1P1lq qz9Uup53zGaucmvOEqQ2cVGgF0Qz1BvtNH/ptGIWjEQ8MNETCTNZD+fsDVxYh3Ug9wpv YKow== X-Gm-Message-State: AJaThX5ZxQuhEp3aGn0y9vnYParnZIJ4fXHXGrvn6uRn0fQv0ZIbxjKj MlOvt8jbh6uT3/emg9tPJa3HLmwiUzV403B344oHJk6bWH/QqyVZRNPPEkAKzhjqPgZSt17Hh/E eKxz+sPGVECM0nVkB0uJipsDHuL5hphRW4SSncRneeeNg10Pass4TkBCy8X8pOVNT77q6a4uWgT CSCDpR X-Google-Smtp-Source: AGs4zMapfFszaCVfnEhJrrnyAxUujETlr430PPWlaP0yUObYwkFI0F2mt5+7/042oSnbfVw5SFfALQ== X-Received: by 10.223.182.19 with SMTP id f19mr30951973wre.81.1511810248523; Mon, 27 Nov 2017 11:17:28 -0800 (PST) Received: from [10.137.2.19] (ip-78-102-97-226.net.upcbroadband.cz. [78.102.97.226]) by smtp.gmail.com with ESMTPSA id 138sm17393256wmf.21.2017.11.27.11.17.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Nov 2017 11:17:27 -0800 (PST) Subject: Re: BUG #14932: SELECT DISTINCT val FROM table gets stuck in an infinite loop To: tcook@blackducksoftware.com, pgsql-bugs@postgresql.org References: <20171127185700.1470.20362@wrigleys.postgresql.org> From: Tomas Vondra Message-ID: Date: Mon, 27 Nov 2017 20:17:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20171127185700.1470.20362@wrigleys.postgresql.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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). regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services