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 1r1uCd-00EDmq-NT for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Nov 2023 20:03:35 +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 1r1uCb-008Gr0-JE for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Nov 2023 20:03:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1uCb-008Gqo-9T for pgsql-hackers@lists.postgresql.org; Sat, 11 Nov 2023 20:03:33 +0000 Received: from feynman.df7cb.de ([195.49.152.168]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1uCW-005wdt-Eh for pgsql-hackers@lists.postgresql.org; Sat, 11 Nov 2023 20:03:31 +0000 Received: from msg.df7cb.de (unknown [IPv6:2a02:908:1482:3660:2ae7:2867:64d8:87dc]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by feynman.df7cb.de (Postfix) with ESMTPSA id 4SSRTC5z45z3FDS; Sat, 11 Nov 2023 21:03:27 +0100 (CET) Date: Sat, 11 Nov 2023 21:03:27 +0100 From: Christoph Berg To: Thomas Munro Cc: pgsql-hackers@lists.postgresql.org, Michael Paquier Subject: Re: pgsql: Don't trust unvalidated xl_tot_len. Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk That's a lot of questions :). Let me try: > In your chroot after it fails, can you please find xlog_internal.h > somewhere under tmp_install and tell us the full path, and can you ./build/tmp_install/usr/include/postgresql/13/server/access/xlog_internal.h ./src/include/access/xlog_internal.h > find pg_config (however many of them there might be, I'm a little > confused on where and when Debian creates extra versioned variants) That's only after testing and `make install`: https://salsa.debian.org/postgresql/postgresql-common/-/blob/master/server/postgresql.mk#L219-225 > and tell us the full path, ./build/tmp_install/usr/lib/postgresql/13/bin/pg_config ./build/src/bin/pg_config/pg_config > and also what --includedir-server prints, $ ./build/tmp_install/usr/lib/postgresql/13/bin/pg_config --includedir-server /usr/include/postgresql/13/server > and can you also find regress_log_039_end_of_wal and confirm that it > contains a complaint about being unable to open a file, not a > complaint about being unable to execute pg_config? $ cat ./build/src/test/recovery/tmp_check/log/regress_log_039_end_of_wal No such file or directory at /home/myon/projects/postgresql/debian/13/build/../src/test/perl/TestLib.pm line 655. The 13-bullseye version of the package still has the "don't relocate me" patch: https://salsa.debian.org/postgresql/postgresql/-/blob/13-bullseye/debian/patches/50-per-version-dirs.patch?ref_type=heads The PGBINDIR mangling is exactly what is breaking the use case now. The commit that removed that bit in the 15 branch explains why it was there: https://salsa.debian.org/postgresql/postgresql/-/commit/a249c75e86fe8733b11c47630e4931c5c196e8da I can (and should) do the change also in the other branches, but from the 2022 discussion, I had the impression there were more reasons to prefer static paths instead of calling pg_config from tmp_install. After all, this seems to be the only 2nd case of actually calling pg_config from tests if I'm grepping for the right things - the other is check_pg_config() called from test/ssl/t/002_scram.pl. (I wonder why that's not failing as well.) Christoph