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 1oW6D3-0002do-Bx for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Sep 2022 01:20:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oW6D2-0000Ji-6X for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Sep 2022 01:20:00 +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 1oW6D1-0000JZ-B5 for pgsql-hackers@lists.postgresql.org; Thu, 08 Sep 2022 01:19:59 +0000 Received: from smtp-fw-80007.amazon.com ([99.78.197.218]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oW6Cy-0006d6-Mc for pgsql-hackers@lists.postgresql.org; Thu, 08 Sep 2022 01:19:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1662599997; x=1694135997; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to; bh=9138AGavhmKNpfTNyLAVCh311FoAUbxySnIHUjx9hZs=; b=u6+173RA+9zA5pz88j6iPhm9iBa09TrPE683G+8z2iSqn2P5QXwbJRqB prCiSqI/B3Y43U0UvFfx4TsLHUsAF9b4CgH7OjdFYh3A6xNXRiDW+lE6Z hr8h11VwNpd3T0ri79ncTHSOEaAHRD2fCbQZ7/lMHLVZXadjushrvaUlu 0=; X-IronPort-AV: E=Sophos;i="5.93,298,1654560000"; d="scan'208,217";a="127863082" Received: from pdx4-co-svc-p1-lb2-vlan3.amazon.com (HELO email-inbound-relay-iad-1e-b69ea591.us-east-1.amazon.com) ([10.25.36.214]) by smtp-border-fw-80007.pdx80.corp.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Sep 2022 01:19:54 +0000 Received: from EX13MTAUWC002.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan2.iad.amazon.com [10.40.163.34]) by email-inbound-relay-iad-1e-b69ea591.us-east-1.amazon.com (Postfix) with ESMTPS id 57667C08ED; Thu, 8 Sep 2022 01:19:52 +0000 (UTC) Received: from EX19D018UWC004.ant.amazon.com (10.13.138.168) by EX13MTAUWC002.ant.amazon.com (10.43.162.240) with Microsoft SMTP Server (TLS) id 15.0.1497.38; Thu, 8 Sep 2022 01:19:44 +0000 Received: from [10.111.245.225] (10.43.160.137) by EX19D018UWC004.ant.amazon.com (10.13.138.168) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1118.12; Thu, 8 Sep 2022 01:19:43 +0000 Content-Type: multipart/alternative; boundary="------------OMpKYrzhxJJrh9bJ3kd6NLKf" Message-ID: <9aee54f2-5cc1-5b64-1f73-6961932e7bd2@amazon.com> Date: Wed, 7 Sep 2022 18:19:42 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH] Query Jumbling for CALL and SET utility statements To: "Drouvot, Bertrand" CC: PostgreSQL Hackers , Pavel Stehule , Andres Freund , "Imseih (AWS), Sami" References: <36e5bffe-e989-194f-85c8-06e7bc88e6f7@amazon.com> <20220831160839.wseeotr7rckucpmv@awork3.anarazel.de> <46ca04f9-1e37-c862-9a28-c5dffaee412f@amazon.com> <20220831190604.l2luuhj3xkau7dvk@awork3.anarazel.de> <09c04aba-7f12-e524-20f7-3f92c1479fdf@amazon.com> Content-Language: en-US From: Jeremy Schneider In-Reply-To: <09c04aba-7f12-e524-20f7-3f92c1479fdf@amazon.com> X-Originating-IP: [10.43.160.137] X-ClientProxiedBy: EX13D31UWC002.ant.amazon.com (10.43.162.220) To EX19D018UWC004.ant.amazon.com (10.13.138.168) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --------------OMpKYrzhxJJrh9bJ3kd6NLKf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit On 9/2/22 2:06 AM, Drouvot, Bertrand wrote: > v3 including this change is attached. FYI: "reset all" core dumps with v3 I didn't fully debug yet, but here's the backtrace on my 14.4 build with the patch [postgres@ip-172-31-44-176 data]$ gdb /usr/local/pgsql-14.4/bin/postgres core.27217 ... Core was generated by `postgres: postgres postgres [local] RESET                                '. Program terminated with signal 11, Segmentation fault. #0  0x00007f7776ae4821 in __strlen_sse2_pminub () from /lib64/libc.so.6 ... (gdb) bt #0  0x00007f7776ae4821 in __strlen_sse2_pminub () from /lib64/libc.so.6 #1  0x00000000008e061c in JumbleExpr (jstate=0x1cf7f80, node=) at queryjumble.c:400 #2  0x00000000008dfdd8 in JumbleQueryInternal (jstate=0x1cf7f80, query=0x1cf7e70) at queryjumble.c:247 #3  0x00000000008e0b4b in JumbleQuery (query=query@entry=0x1cf7e70, querytext=querytext@entry=0x1cf72f8 "reset all;") at queryjumble.c:127 #4  0x000000000056ba4b in parse_analyze (parseTree=0x1cf7ce0, sourceText=0x1cf72f8 "reset all;", paramTypes=0x0, numParams=, queryEnv=0x0) at analyze.c:130 #5  0x000000000079df63 in pg_analyze_and_rewrite (parsetree=parsetree@entry=0x1cf7ce0, query_string=query_string@entry=0x1cf72f8 "reset all;",     paramTypes=paramTypes@entry=0x0, numParams=numParams@entry=0, queryEnv=queryEnv@entry=0x0) at postgres.c:657 #6  0x000000000079e472 in exec_simple_query (query_string=0x1cf72f8 "reset all;") at postgres.c:1130 #7  0x000000000079f9d3 in PostgresMain (argc=argc@entry=1, argv=argv@entry=0x7ffd0c341f80, dbname=0x1d44948 "postgres", username=) at postgres.c:4496 #8  0x000000000048c9f3 in BackendRun (port=, port=) at postmaster.c:4530 #9  BackendStartup (port=0x1d3bdd0) at postmaster.c:4252 #10 ServerLoop () at postmaster.c:1745 #11 0x0000000000721332 in PostmasterMain (argc=argc@entry=5, argv=argv@entry=0x1cf1e10) at postmaster.c:1417 #12 0x000000000048da6e in main (argc=5, argv=0x1cf1e10) at main.c:209 -- Jeremy Schneider Database Engineer Amazon Web Services --------------OMpKYrzhxJJrh9bJ3kd6NLKf Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: 8bit
On 9/2/22 2:06 AM, Drouvot, Bertrand wrote:
v3 including this change is attached.

FYI: "reset all" core dumps with v3

I didn't fully debug yet, but here's the backtrace on my 14.4 build with the patch

[postgres@ip-172-31-44-176 data]$ gdb /usr/local/pgsql-14.4/bin/postgres core.27217
...
Core was generated by `postgres: postgres postgres [local] RESET                                '.
Program terminated with signal 11, Segmentation fault.
#0  0x00007f7776ae4821 in __strlen_sse2_pminub () from /lib64/libc.so.6
...
(gdb) bt
#0  0x00007f7776ae4821 in __strlen_sse2_pminub () from /lib64/libc.so.6
#1  0x00000000008e061c in JumbleExpr (jstate=0x1cf7f80, node=<optimized out>) at queryjumble.c:400
#2  0x00000000008dfdd8 in JumbleQueryInternal (jstate=0x1cf7f80, query=0x1cf7e70) at queryjumble.c:247
#3  0x00000000008e0b4b in JumbleQuery (query=query@entry=0x1cf7e70, querytext=querytext@entry=0x1cf72f8 "reset all;") at queryjumble.c:127
#4  0x000000000056ba4b in parse_analyze (parseTree=0x1cf7ce0, sourceText=0x1cf72f8 "reset all;", paramTypes=0x0, numParams=<optimized out>, queryEnv=0x0) at analyze.c:130
#5  0x000000000079df63 in pg_analyze_and_rewrite (parsetree=parsetree@entry=0x1cf7ce0, query_string=query_string@entry=0x1cf72f8 "reset all;",
    paramTypes=paramTypes@entry=0x0, numParams=numParams@entry=0, queryEnv=queryEnv@entry=0x0) at postgres.c:657
#6  0x000000000079e472 in exec_simple_query (query_string=0x1cf72f8 "reset all;") at postgres.c:1130
#7  0x000000000079f9d3 in PostgresMain (argc=argc@entry=1, argv=argv@entry=0x7ffd0c341f80, dbname=0x1d44948 "postgres", username=<optimized out>) at postgres.c:4496
#8  0x000000000048c9f3 in BackendRun (port=<optimized out>, port=<optimized out>) at postmaster.c:4530
#9  BackendStartup (port=0x1d3bdd0) at postmaster.c:4252
#10 ServerLoop () at postmaster.c:1745
#11 0x0000000000721332 in PostmasterMain (argc=argc@entry=5, argv=argv@entry=0x1cf1e10) at postmaster.c:1417
#12 0x000000000048da6e in main (argc=5, argv=0x1cf1e10) at main.c:209



-- 
Jeremy Schneider
Database Engineer
Amazon Web Services
--------------OMpKYrzhxJJrh9bJ3kd6NLKf--