Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rUhWP-00CYVS-OC for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Jan 2024 06:23:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rUhWM-002lq8-NG for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Jan 2024 06:22:58 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rUhWM-002lpz-BS for pgsql-hackers@lists.postgresql.org; Tue, 30 Jan 2024 06:22:58 +0000 Received: from mail-vs1-xe2e.google.com ([2607:f8b0:4864:20::e2e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rUhWJ-0046Bw-Nu for pgsql-hackers@postgresql.org; Tue, 30 Jan 2024 06:22:57 +0000 Received: by mail-vs1-xe2e.google.com with SMTP id ada2fe7eead31-46b1419ad06so2155401137.1 for ; Mon, 29 Jan 2024 22:22:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706595775; x=1707200575; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=CSZjviP95ESAvSx8SrSSOiOL5rB5N1AbZuRJD8UL2c8=; b=KhqxtYYDABA1cfVK1JbwIH4Nay8soiRpr11ADYSWrmuopC021RJZNGnPO4kqectP1k j0ys5PMauHcwfOFXkx8odncoU8wo/ViQv/89wyJVl+4yjZ0dvhdHpBYCxBnnBgxXNeIq cuobIY+9PbLIx8KFuz6/jzeFtcw8lab0OKJpXnxWsY1hzAI7DgIc5yOSCL7ONwCAygfk laOnJkhRAOLCQZtQCbIOp0DtZBuHyNVuvHnIi1EdphSedhXYCJWR6OXcJcLVJWDNlnwj qFx3iWmdqCCMXcFwsHazmnV89VSd3lxz8NdicdKHHZvK/wZDCiqJ0s+JQdk2AIWvEiJ4 BJvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706595775; x=1707200575; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CSZjviP95ESAvSx8SrSSOiOL5rB5N1AbZuRJD8UL2c8=; b=ViMwWU6I6hdhHe03MELUgtddyuxl2q6xRMCkvs/259QqiuC3nX4C50zv40clXOFZxt C5Jue4E41x/qJPxwP85hJSPh2FuEUd4LZqKAmH7NFahyOHVLc+sgipPrpuXj+edobhd1 oR3Yiwvj18iA8Awcp3x9C8b24ckwU/oQEv3BuJKlC9+M6Fvx7N7Tmkmk35H/Xx7wcVFY h8IM9lQKRevp2VlMuJS40rUmU+1ZK7S2NbXLHlicw+6HZzrHv7b7/gQlzMNYbdVQ7n5S RnKo/58luXW6/Ylaro9gjvJOdyueG/U4Z0OMpZtubJQ50d8HW+pI4TJGSa6q3jCKfkH2 zrJA== X-Gm-Message-State: AOJu0YyZ1/aMh6mIuOsZlgKHdnqKAgARjzA110ELniKG3QQ/56XQElrY +aL/8+XQuib37u1suhsr4hOuk8+boCYJnpd3Mg2OzVBSwQLaw1i6l4GsdmImR/4vxxGPQ2TvGWJ CY1LB53EHegJMhTLhRcu1rSI4jqA= X-Google-Smtp-Source: AGHT+IG7ilt1BCiIXe7qQ+6idd526DsYMSCeibrP+VQ52OewvQtJWalkjIK0KrxZ8O6OfP6dHu9us7AYBCJopQcKwz0= X-Received: by 2002:a67:f947:0:b0:46b:1be1:bc62 with SMTP id u7-20020a67f947000000b0046b1be1bc62mr177108vsq.25.1706595774764; Mon, 29 Jan 2024 22:22:54 -0800 (PST) MIME-Version: 1.0 References: <20230829112028.qhzse7chs3swqwqh@alvherre.pgsql> <60beec03-f14c-ea46-8e5f-f68773ce83f9@eisentraut.org> <12e27bdb-1a3d-450f-923b-c36feea24f01@eisentraut.org> In-Reply-To: From: Ashutosh Bapat Date: Tue, 30 Jan 2024 11:52:43 +0530 Message-ID: Subject: Re: tablecmds.c/MergeAttributes() cleanup To: Alexander Lakhin Cc: Peter Eisentraut , pgsql-hackers , Alvaro Herrera Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Alexander, On Sun, Jan 28, 2024 at 1:30=E2=80=AFPM Alexander Lakhin wrote: > > Hello Peter, > > 26.01.2024 16:42, Peter Eisentraut wrote: > > > > I have committed all this. These are great improvements. > > > > Please look at the segmentation fault triggered by the following query si= nce > 4d969b2f8: > CREATE TABLE t1(a text COMPRESSION pglz); > CREATE TABLE t2(a text); > CREATE TABLE t3() INHERITS(t1, t2); > NOTICE: merging multiple inherited definitions of column "a" > server closed the connection unexpectedly > This probably means the server terminated abnormally > before or while processing the request. > > Core was generated by `postgres: law regression [local] CREATE TABLE = '. > Program terminated with signal SIGSEGV, Segmentation fault. > > (gdb) bt > #0 __strcmp_avx2 () at ../sysdeps/x86_64/multiarch/strcmp-avx2.S:116 > #1 0x00005606fbcc9d52 in MergeAttributes (columns=3D0x0, supers=3Dsupers= @entry=3D0x5606fe293d30, relpersistence=3D112 'p', > is_partition=3Dfalse, supconstr=3Dsupconstr@entry=3D0x7fff4046d410, supno= tnulls=3Dsupnotnulls@entry=3D0x7fff4046d418) > at tablecmds.c:2811 > #2 0x00005606fbccd764 in DefineRelation (stmt=3Dstmt@entry=3D0x5606fe26a= 130, relkind=3Drelkind@entry=3D114 'r', ownerId=3D10, > ownerId@entry=3D0, typaddress=3Dtypaddress@entry=3D0x0, > queryString=3DqueryString@entry=3D0x5606fe2695c0 "CREATE TABLE t3() = INHERITS(t1, t2);") at tablecmds.c:885 This bug existed even before the refactoring.Happens because strcmp() is called on NULL input (t2's compression is NULL). I already have a fix for this and will be posting it in [1]. [1] https://www.postgresql.org/message-id/flat/24656cec-d6ef-4d15-8b5b-e8df= c9c833a7%40eisentraut.org --=20 Best Wishes, Ashutosh Bapat