Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hlK6V-0005r8-I0 for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Jul 2019 21:26:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hlK6U-0003DF-EP for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Jul 2019 21:26:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hlK6T-00031C-Tv for pgsql-hackers@lists.postgresql.org; Wed, 10 Jul 2019 21:26:18 +0000 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hlK6Q-0000jz-K1 for pgsql-hackers@lists.postgresql.org; Wed, 10 Jul 2019 21:26:17 +0000 Received: by mail-wm1-x341.google.com with SMTP id p74so3671223wme.4 for ; Wed, 10 Jul 2019 14:26:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=VuWIpkH7/j8P8E5rq6JSxYc2jbrXikG/RynfEofZp5k=; b=xC0BuR7HlC4gC1lMFvNO5xlU8/oV7VeczT3nXUxpVnlMZSQ0rS+U7mfNkEMqfnqc2H 2nSQ01ziYusHDhdvxrii2EVl7yIRKao36Y+3hZdEFw7QCfoH5RuDdIgNjecId1zRd5XN KXzAz1Wi+tk1DxZ55BgfCINwkWu5pCoOscKHT8T6LlZ83smK7OLSmhlRz0PDnhHlHj/1 GYansvB7AMJCfXeZX5j4NPUTchIS1XXIqWbQBElvTxwDu429UOSIxPjkZwK+5ygYFUla Oc9zhMM4FAHvrV/hmzwa/0D2oXmQOXWgW4Vlv2jJ2bZsuNrE6aBm+n294FKjWo1Sc2LT lEAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=VuWIpkH7/j8P8E5rq6JSxYc2jbrXikG/RynfEofZp5k=; b=ZCOTRP0y6azViYaefxCEuHSZAbXe2lUdCQ5ot4sfvOZBxx+zomJUynEormjIFA5poo cHB3yoCbXIph41VbplkChaoSrUIGMJd3DJRyONWx67obhUbBAKLipAFVi3gY0gukH8sQ Cxem9hH4f//K0F/5oSnCrGtNPUETVQ0F9JJqnPlHu5j4doCCRnJuavQ9Q5NwGDd+ybQN xT3VDINoVb1Ua4ZMQpnmkE9b/7D4gJkjjGQZXse5ecHU1N0QNeVTX8mTrzE2DX6j6wvP o4Rgl6CyVTc7YhkQfiL912GJVZgQOZhfcnu2gHCmyq53PGtAXyhatRmrtqz6tlNJiZgV 8Edw== X-Gm-Message-State: APjAAAUdi1IET4FEW06mkASX55E1Suoa8qesih0Rhhr/7QdBvCK578ox WUDEzZETBglxkyxSt7qopoMcouGomXM= X-Google-Smtp-Source: APXvYqzsuzjMYShulxdlT1u51yJuTqC3MTYEKC8rA7Ek94m6DXyMQEIBWw37sopfopWvnV+83+zp+g== X-Received: by 2002:a1c:ca06:: with SMTP id a6mr6943678wmg.48.1562793972067; Wed, 10 Jul 2019 14:26:12 -0700 (PDT) Received: from localhost (ip-86-49-253-160.net.upcbroadband.cz. [86.49.253.160]) by smtp.gmail.com with ESMTPSA id m24sm1910698wmi.39.2019.07.10.14.26.11 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 10 Jul 2019 14:26:11 -0700 (PDT) Date: Wed, 10 Jul 2019 23:26:09 +0200 From: Tomas Vondra To: Tom Lane Cc: Andreas Seltenreich , pgsql-hackers@lists.postgresql.org, Tomas Vondra Subject: Re: [sqlsmith] Crash in mcv_get_match_bitmap Message-ID: <20190710212609.5mrl7hltbozoxpq7@development> References: <8736jdhbhc.fsf@ansel.ydns.eu> <15097.1562792274@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <15097.1562792274@sss.pgh.pa.us> User-Agent: NeoMutt/20180716-1444-295967-dirty List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, Jul 10, 2019 at 04:57:54PM -0400, Tom Lane wrote: >Andreas Seltenreich writes: >> running sqlsmith on the regression database of REL_12_STABLE at >> ff597b656f yielded a crash in mcv_get_match_bitmap. I can reproduce it >> with the following query on the regression database: >> select filler1 from mcv_lists where a is not null and (select 42) <= c; > >Seems to be the same problem I just complained of in the other >thread: mcv_get_match_bitmap has an untenable assumption that >"is a pseudoconstant" means "is a Const". > Yeah, that's a bug. Will fix (not sure how yet). BTW which other thread? I don't see any other threads mentioning this function. >I notice it's also assuming that the Const must be non-null. >It's not really easy to crash it that way, because if you just >write "null <= c" that'll get reduced to constant-NULL earlier. >But I bet there's a way. > Hmmm, I did not think of that. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services