Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jNNxj-0004Gr-M2 for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Apr 2020 21:46:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jNNxi-0002Oy-Hr for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Apr 2020 21:46:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jNNxi-0002Oc-7e for pgsql-hackers@lists.postgresql.org; Sat, 11 Apr 2020 21:46:50 +0000 Received: from mail-qt1-x832.google.com ([2607:f8b0:4864:20::832]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jNNxe-0002ry-Il for pgsql-hackers@postgresql.org; Sat, 11 Apr 2020 21:46:49 +0000 Received: by mail-qt1-x832.google.com with SMTP id i19so1428868qtp.13 for ; Sat, 11 Apr 2020 14:46:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-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=FTDhwiOk5cWH6ERBaxfpTcdQEa7319YvO0Q3VjJYQOY=; b=t/4S1CpoLqojupWh6TEgy2NxkEZGsPoLCl0NlM/1Sm0YBHAOSsgRHfPSuga5jcC3eP G4v1nnPV9PxRqBtI5kBsT+b+Sw+uuX+dxabrfUbVnASuhUi9bM5ZdBWrqaMS9PlcuTVN iqCTXMU6x19Q21OveW4CVweNPPxKotkVVMmjqBAcQQ1eUCFAoMa7RQAIKN9jh6GCcvX0 I1w61qFDwwUg7PICUlhqRWZQK4YrtzMx2IUxxYjT895Vh1MYQvyBEui3K+65l0FchHGA yK7VAqVSUlL0hHnESrHui3Vrl14NJk1L2ARIEC6LvkY/gnDyA98QdVeZ7HJyOyisdesE cQSQ== 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=FTDhwiOk5cWH6ERBaxfpTcdQEa7319YvO0Q3VjJYQOY=; b=tF491ZYGeSgcO3/xUeZ7r8VP86bxRHhlD5hv00mLc2f09deRZ7ZQLNPlbtTlQg7/gn QiuFTL6jLEeNsaLPgXEGZ+xffeSYggFt7CNM/b9ABkR+vjF9b+ytdZ3HpztZ901qQp8c c04YjLtB1rNojYNO0opSm0MqMaoKSK655YyvhZpQp/sbvNTkD4Eg24XlrX68q0f8ZtnK hTyJTnRk2085/woz1bwtaZfkkWWzPIimbw0rbaOcTffTBMYkxZVTETc64LyTGI+mi+a3 8GLTRv2qRkgAnD+l6S2gcnD4sxbjXhw/py7hZ33nIZP0By0LIzlTSx6Kx8ZHp/DpLd/7 bZ3g== X-Gm-Message-State: AGi0PubelsZ0qHVuI0qZA9hpH0wCxNjv3kTLU6iYVfZt3NXc+NUU3oKH XyePzzTAvQA7VGVCbqnr0IiwdQ== X-Google-Smtp-Source: APiQypIYg/1pDOeX3ECtcR/lQUxwzUm2aTJIyTCaHmoPuDWP2nUwjOYeWpK5IcT2/l8trcDQoIlD8w== X-Received: by 2002:ac8:1302:: with SMTP id e2mr5128368qtj.47.1586641603706; Sat, 11 Apr 2020 14:46:43 -0700 (PDT) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id v20sm4679025qth.10.2020.04.11.14.46.41 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 11 Apr 2020 14:46:42 -0700 (PDT) Received: by pryzbyj (Postfix, from userid 1000) id 38744800AE5; Sat, 11 Apr 2020 16:46:39 -0500 (CDT) Date: Sat, 11 Apr 2020 16:46:39 -0500 From: Justin Pryzby To: Tomas Vondra Cc: James Coleman , pgsql-hackers@postgresql.org Subject: Re: sqlsmith crash incremental sort Message-ID: <20200411214639.GK2228@telsasoft.com> References: <20200411191952.GA30754@telsasoft.com> <20200411202639.2o7quia37zd6ypw7@development> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200411202639.2o7quia37zd6ypw7@development> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Adding -hackers, originally forgotten. On Sat, Apr 11, 2020 at 10:26:39PM +0200, Tomas Vondra wrote: > Thanks! I'll investigate. > > On Sat, Apr 11, 2020 at 02:19:52PM -0500, Justin Pryzby wrote: > > frequent crash looks like: > > > > #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51 > > #1 0x00007fb0a0cda801 in __GI_abort () at abort.c:79 > > #2 0x00007fb0a21ec425 in ExceptionalCondition (conditionName=conditionName@entry=0x7fb0a233a2ed "relid > 0", errorType=errorType@entry=0x7fb0a224701d "FailedAssertion", > > fileName=fileName@entry=0x7fb0a2340ce8 "relnode.c", lineNumber=lineNumber@entry=379) at assert.c:67 > > #3 0x00007fb0a2010d3a in find_base_rel (root=root@entry=0x7fb0a2de2d00, relid=) at relnode.c:379 > > #4 0x00007fb0a2199666 in examine_variable (root=root@entry=0x7fb0a2de2d00, node=node@entry=0x7fb0a2e65eb8, varRelid=varRelid@entry=0, vardata=vardata@entry=0x7ffe7b549e60) at selfuncs.c:4600 > > #5 0x00007fb0a219e2ed in estimate_num_groups (root=root@entry=0x7fb0a2de2d00, groupExprs=0x7fb0a2e69118, input_rows=input_rows@entry=2, pgset=pgset@entry=0x0) at selfuncs.c:3279 > > #6 0x00007fb0a1fc198b in cost_incremental_sort (path=path@entry=0x7fb0a2e69080, root=root@entry=0x7fb0a2de2d00, pathkeys=pathkeys@entry=0x7fb0a2e68b28, presorted_keys=presorted_keys@entry=3, > > input_startup_cost=103.73424154497742, input_total_cost=, input_tuples=2, width=480, comparison_cost=comparison_cost@entry=0, sort_mem=4096, limit_tuples=-1) at costsize.c:1832 > > #7 0x00007fb0a2007f63 in create_incremental_sort_path (root=root@entry=0x7fb0a2de2d00, rel=rel@entry=0x7fb0a2e67a38, subpath=subpath@entry=0x7fb0a2e681a0, pathkeys=0x7fb0a2e68b28, > > presorted_keys=3, limit_tuples=limit_tuples@entry=-1) at pathnode.c:2793 > > #8 0x00007fb0a1fe97cb in create_ordered_paths (limit_tuples=-1, target_parallel_safe=true, target=0x7fb0a2e65568, input_rel=, root=0x7fb0a2de2d00) at planner.c:5029 > > #9 grouping_planner (root=root@entry=0x7fb0a2de2d00, inheritance_update=inheritance_update@entry=false, tuple_fraction=, tuple_fraction@entry=0) at planner.c:2254 > > #10 0x00007fb0a1fecd5c in subquery_planner (glob=, parse=parse@entry=0x7fb0a2db7840, parent_root=parent_root@entry=0x7fb0a2dad650, hasRecursion=hasRecursion@entry=false, > > tuple_fraction=0) at planner.c:1015 > > #11 0x00007fb0a1fbc286 in set_subquery_pathlist (rte=, rti=, rel=0x7fb0a2db3598, root=0x7fb0a2dad650) at allpaths.c:2303 > > #12 set_rel_size (root=root@entry=0x7fb0a2dad650, rel=rel@entry=0x7fb0a2db1670, rti=rti@entry=2, rte=) at allpaths.c:422 > > #13 0x00007fb0a1fbecad in set_base_rel_sizes (root=) at allpaths.c:323 > > #14 make_one_rel (root=root@entry=0x7fb0a2dad650, joinlist=joinlist@entry=0x7fb0a2db76b8) at allpaths.c:185 > > #15 0x00007fb0a1fe4a2b in query_planner (root=root@entry=0x7fb0a2dad650, qp_callback=qp_callback@entry=0x7fb0a1fe52c0 , qp_extra=qp_extra@entry=0x7ffe7b54a510) > > at planmain.c:269 > > #16 0x00007fb0a1fea0b8 in grouping_planner (root=root@entry=0x7fb0a2dad650, inheritance_update=inheritance_update@entry=false, tuple_fraction=, tuple_fraction@entry=0) > > at planner.c:2058 > > #17 0x00007fb0a1fecd5c in subquery_planner (glob=glob@entry=0x7fb0a2dab480, parse=parse@entry=0x7fb0a2d48410, parent_root=parent_root@entry=0x0, hasRecursion=hasRecursion@entry=false, > > tuple_fraction=tuple_fraction@entry=0) at planner.c:1015 > > #18 0x00007fb0a1fee1df in standard_planner (parse=0x7fb0a2d48410, query_string=, cursorOptions=256, boundParams=) at planner.c:405 > > > > Minimal query like: > > > > explain SELECT * FROM information_schema.transforms AS ref_1 RIGHT JOIN (SELECT 1 FROM pg_catalog.pg_namespace TABLESAMPLE SYSTEM (7.2))AS sample_2 ON (ref_1.specific_name is NULL); > > > > -- > > Justin