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.96) (envelope-from ) id 1x6tD3-000VL2-2B for pgsql-hackers@arkaria.postgresql.org; Wed, 16 Sep 2026 17:14:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1x6tD2-008lVI-0F for pgsql-hackers@arkaria.postgresql.org; Wed, 16 Sep 2026 17:14:12 +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.96) (envelope-from ) id 1x6tD1-008lVA-22 for pgsql-hackers@lists.postgresql.org; Wed, 16 Sep 2026 17:14:11 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1x6tCz-00000000QYI-2Wth for pgsql-hackers@lists.postgresql.org; Wed, 16 Sep 2026 17:14:10 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 68GHE6Ro506530; Wed, 16 Sep 2026 13:14:06 -0400 From: Tom Lane To: Daniel Gustafsson cc: Masao Fujii , PostgreSQL Hackers Subject: Re: pgsql: Revert online data checksum transitions In-reply-to: <217BB68C-9A50-4FA0-B096-818FAC61D85E@yesql.se> References: <1EEAFCFB-15DB-4EC1-BD49-964C799A01B2@yesql.se> <501934.1789573768@sss.pgh.pa.us> <217BB68C-9A50-4FA0-B096-818FAC61D85E@yesql.se> Comments: In-reply-to Daniel Gustafsson message dated "Wed, 16 Sep 2026 17:50:59 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <506528.1789578846.1@sss.pgh.pa.us> Date: Wed, 16 Sep 2026 13:14:06 -0400 Message-ID: <506529.1789578846@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Daniel Gustafsson writes: >> On 16 Sep 2026, at 17:49, Tom Lane wrote: >> I can poke into it on longfin's host if that would help. > That would be great, thanks. What seems to be happening is (1) pg_control_checkpoint()'s local values[] and nulls[] arrays are now of length 19. (2) But the tupdesc that get_call_result_type() builds from the pg_proc entry still has 20 columns. (3) Therefore, heap_form_tuple sees a wrong value for the 19th column (which does no great damage, since it's still a pass-by-value type) and then fetches complete garbage from values[19] and nulls[19]. Depending on the stack layout and the phase of the moon, nulls[19] might read as zero or it might not. Either case is fine so long as heap_compute_data_size and heap_fill_tuple/fill_val interpret it the same way. However, what I'm seeing as I trace through the crash on longfin is that nulls[19] has a value that's not either 0 or 1 (not too surprising), and somehow heap_compute_data_size is interpreting that as "true" while fill_val is reading it as "false". According to my understanding of the C standard, fill_val is in the wrong here. I looked at the generated assembly code and could not spot exactly what the problem is; it seems to be testing the byte value with .loc 0 301 7 is_stmt 1 ## heaptuple.c:301:7 testb %al, %al je LBB3_6 which certainly looks like it ought to treat all nonzero values alike. Anyway this seems to be a code generation quirk of certain versions of clang. It's probably not worth chasing further. regards, tom lane