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 1qoizS-002ala-1L for pgsql-hackers@arkaria.postgresql.org; Fri, 06 Oct 2023 11:27:30 +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 1qoizP-00601v-CQ for pgsql-hackers@arkaria.postgresql.org; Fri, 06 Oct 2023 11:27:28 +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 1qoizP-00601l-1C for pgsql-hackers@lists.postgresql.org; Fri, 06 Oct 2023 11:27:28 +0000 Received: from mail-oi1-x235.google.com ([2607:f8b0:4864:20::235]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qoizN-000ItF-7L for pgsql-hackers@postgresql.org; Fri, 06 Oct 2023 11:27:26 +0000 Received: by mail-oi1-x235.google.com with SMTP id 5614622812f47-3af609c5736so1224632b6e.3 for ; Fri, 06 Oct 2023 04:27:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696591644; x=1697196444; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=x1XoIlGl6ZAetjZi/y6jaiPWxHaJ+h0g+TtrwzhMeHo=; b=OyUO79iOAvH/fPiauHte3HHxqFjjjUTeKbD+BR6n9ThI1gj8tvlGF7b1/VsbDcEmfD e6UlFY0YpWX0ezA4h4x+OG/wfmMNjJgFMEbxGGJmeZaFq10f6aq8wfK1niL9B4BQIVRz SVbbZr6NzMVCeg+6Wdj7Pf0vtvvGoX4MEBevcD53bukKHrkyzJ3jG38Ir7l8xspHoq+Z 5UAD/DjORLwHjec7cZ1UnplrGyyF47X5AldTsmeBbXJ+lorNipt8wwJ+H8O+HezzGZwM W0TnCZQkxXIcBKBUcyy6FjA0iMaZsTkBnZFXAqk3G1MrlCRqr9jNZwpvlHR0zR9CoA4W NL8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696591644; x=1697196444; h=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=x1XoIlGl6ZAetjZi/y6jaiPWxHaJ+h0g+TtrwzhMeHo=; b=LEBP+S2Z4TWYocSA59cAP/b8TJSN2/IstSx4RtVlgi0FaRNWBUoR/Mv9Jo9zdNiu2v 1n9DTFpAzENTviD1UC8hSVCx771mfX+JVF02E9p+9T8JqUZzhkenu+1Numl5ai/yEfFg 8jtNFUCgHME8ZwZtjfJVk1MB81KpWf27JmU3l3OXafPtNUMPssIWTQ3RQxn4mLzJEjjX bdHSK9hw37AYTzHv+febRnw7SyG0qLLpLL48U+DgcNTnenBY05szE+kLypgcY3AChVAD muWeLSWmXGDVJqXbv6YVSX0GTLjd0pNO8ox9S9bYfV6VKs35U1N0xcn7tl5y0X4rxc5s 1qFw== X-Gm-Message-State: AOJu0Yy6gvuz/Hvp7qu/8bAMqBbQ6L1LaHCDt5MmGyMbj+WlpVOyBnLT R79eAmaaljeEYQ8+aLN+FE4edLPUHa1I52T5SgY= X-Google-Smtp-Source: AGHT+IFig3x42aVQw5ZsmCd0+OilGgRZnHLONcTfgGM9pJEGbEoXSMlIDdWzy+1++RK9+kEGgosBF+lVLucMO06mAH8= X-Received: by 2002:a05:6358:93a5:b0:143:9763:e6 with SMTP id h37-20020a05635893a500b00143976300e6mr7268088rwb.0.1696591644252; Fri, 06 Oct 2023 04:27:24 -0700 (PDT) MIME-Version: 1.0 References: <202310061001.ndbl6o4dl3zh@alvherre.pgsql> In-Reply-To: <202310061001.ndbl6o4dl3zh@alvherre.pgsql> From: Amit Langote Date: Fri, 6 Oct 2023 20:27:12 +0900 Message-ID: Subject: Re: remaining sql/json patches To: Alvaro Herrera Cc: Andrew Dunstan , Erik Rijkers , PostgreSQL-development , jian he Content-Type: multipart/alternative; boundary="00000000000048dd0306070a8609" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000048dd0306070a8609 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Oct 6, 2023 at 19:01 Alvaro Herrera wrote= : > On 2023-Oct-06, Amit Langote wrote: > > > 2. Assignment of op->d.iocoerce.escontext needed to be changed like thi= s: > > > > v_params[4] =3D > l_ptr_const(op->d.iocoerce.escontext, > > - > > l_ptr(StructErrorSaveContext)); > > + l_ptr(StructNode)); > > Oh, so you had to go back to using StructNode in order to get this > fixed? That's weird. Is it just because InputFunctionCallSafe is > defined to take fmNodePtr? (I still fail to see that a pointer to > ErrorSaveContext would differ in any material way from a pointer to > Node). The difference matters to LLVM=E2=80=99s type system, which considers Node = to be a type with 1 sub-type (struct member) and ErrorSaveContext with 4 sub-types. It doesn=E2=80=99t seem to understand that both share the first member. Another think I thought was weird is that it would only crash in LLVM5 > debug and not the other LLVM-enabled animals, but looking closer at the > buildfarm results, I think that may have been only because you reverted > too quickly, and phycodorus and petalura didn't actually run with > 7fbc75b26ed8 before you reverted it. Dragonet did make a run with it, > but it's marked as "LLVM optimized" instead of "LLVM debug". I suppose > that must be making a difference. AFAICS, only assert-enabled LLVM builds crash. > --00000000000048dd0306070a8609 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, Oct 6, 2023 at 19:01 Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
<= div class=3D"gmail_quote">
On 2023-Oct-06, Ami= t Langote wrote:

> 2. Assignment of op->d.iocoerce.escontext needed to be changed like= this:
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0v_params[4] =3D l_ptr_const(op->d.iocoerce.escontext= ,
> -
> l_ptr(StructErrorSaveContext));
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0l_ptr(StructNode));

Oh, so you had to go back to using StructNode in order to get this
fixed?=C2=A0 That's weird.=C2=A0 Is it just because InputFunctionCallSa= fe is
defined to take fmNodePtr?=C2=A0 (I still fail to see that a pointer to
ErrorSaveContext would differ in any material way from a pointer to
Node).

The differ= ence matters to LLVM=E2=80=99s type system, which considers Node to be a ty= pe with 1 sub-type (struct member) and ErrorSaveContext with 4 sub-types. I= t doesn=E2=80=99t seem to understand that both share the first member.


Another think I thought was weird is that it would only crash in LLVM5
debug and not the other LLVM-enabled animals, but looking closer at the
buildfarm results, I think that may have been only because you reverted
too quickly, and phycodorus and petalura didn't actually run with
7fbc75b26ed8 before you reverted it.=C2=A0 Dragonet did make a run with it,=
but it's marked as "LLVM optimized" instead of "LLVM deb= ug".=C2=A0 I suppose
that must be making a difference.

<= div dir=3D"auto">AFAICS, only assert-enabled LLVM builds crash.
--00000000000048dd0306070a8609--