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 1nA06u-000277-RE for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Jan 2022 01:50:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nA06t-0002wu-Mu for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Jan 2022 01:50:03 +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 1nA06t-0002wl-DI for pgsql-hackers@lists.postgresql.org; Wed, 19 Jan 2022 01:50:03 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nA06r-00047X-7h for pgsql-hackers@lists.postgresql.org; Wed, 19 Jan 2022 01:50:03 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id E6C28320208C; Tue, 18 Jan 2022 20:49:58 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 18 Jan 2022 20:49:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=e8AV1Ppucm+GLtmjxNSasTQoVZO jig0IBq9RstPKz/0=; b=AWLETwFLYc3gJRvIpplPR+Rl5KPP28g2nXen2dejrC7 iaPbSzT2/h2YZgha4ugjnZ+v05nGj6v+Q97MyQqhv5f6JbRTMLapUL3dey1DxGde ONH7x5bfqLi6UW44kK6cSqJY7zJn8x8IXK8nxkh0wbsxCJf0ZnYQxq2PQ88ZkWPY b0cAXVkJg7XEzpe57NvE9Vvkh8glJGQMA7lLn204w6On3oyy1KRsKHOWtlbLCcbn sIOHy+oDdva9WVROsZTOBl2KsyaBp2iT0avAb3M8pAGO6nI2RWhtdwkofMObjllW 0areAFVv6HFOntKlOy6WGx8UhPmMZ8VlTW6hAasSaZw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=e8AV1P pucm+GLtmjxNSasTQoVZOjig0IBq9RstPKz/0=; b=DG/rUNUiWXAgA7+RdJT464 bS4EijQk5mtf54XAFZVpFE4Oi6cpHib7TXiHWE2OL0yr1fquY51fEEspXtNJp2hv IzT621yaiWjZONaddI/EW91I2U3DbJGF/elEmEgF4j3L24I6zoqO/3atU3oh6Wb4 Fe/eR8g73HZ8pSSMGivSCbDToXAOgiqWnpmWHMa4uN9dc2M2Lx3AQueOEiDq0JSs dq8eAQp/v50bZ5zykbe31i75JQrvtlsWJb4y7dFeuIQDDlH5A8iukF0m5UG8nwBP 0cnUtqnERYwqGK9pIoFAv4WdZ8slgxsl84o5igqfmWw5zBwI1ptflLRpRrR+QWEA == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudeggdefkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughrvghs ucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrfgrth htvghrnhepudekhfekleeugeevteehleffffejgeelueduleeffeeutdelffeujeffhfeu ffdunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hnughrvghssegrnhgrrhgriigvlhdruggv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 18 Jan 2022 20:49:58 -0500 (EST) Date: Tue, 18 Jan 2022 17:49:57 -0800 From: Andres Freund To: Tom Lane Cc: Robert Haas , PostgreSQL Hackers Subject: Re: pgsql: Modify pg_basebackup to use a new COPY subprotocol for base back Message-ID: <20220119014957.vfc4s74oy6rrdimu@alap3.anarazel.de> References: <415517.1642543920@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <415517.1642543920@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2022-01-18 17:12:00 -0500, Tom Lane wrote: > Robert Haas writes: > > Unfortunately, I can't reproduce this locally, even with COPT=-Wall > > -Werror -fno-omit-frame-pointer -fsanitize-trap=alignment > > -Wno-deprecated-declarations -DWRITE_READ_PARSE_PLAN_TREES > > -DSTRESS_SORT_INT_MIN -DENFORCE_REGRESSION_TEST_NAME_RESTRICTIONS. > > Now that I re-read what you did, I believe you need both of > > -fsanitize=alignment -fsanitize-trap=alignment > > to enable those traps to happen. That seems to be the case with > Apple's clang, anyway. FWIW, I can reproduce it on linux, but only if I -fno-sanitize-recover instead of -fsanitize-trap=alignment. That then also produces a nicer explanation of the problem: /home/andres/src/postgresql/src/backend/replication/basebackup.c:1552:10: runtime error: member access within misaligned address 0x000002b9ce09 for type 'PageHeaderData' (aka 'struct PageHeaderData'), which requires 4 byte alignment 0x000002b9ce09: note: pointer points here 00 00 00 64 00 00 00 00 c8 ad 0c 01 c5 1b 00 00 48 00 f0 1f f0 1f 04 20 00 00 00 00 62 31 05 00 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /home/andres/src/postgresql/src/backend/replication/basebackup.c:1552:10 in 2022-01-18 17:36:17.746 PST [1448756] LOG: server process (PID 1448774) exited with exit code 1 2022-01-18 17:36:17.746 PST [1448756] DETAIL: Failed process was running: BASE_BACKUP ( LABEL 'pg_basebackup base backup', PROGRESS, CHECKPOINT 'fast', MANIFEST 'yes', TARGET 'client') The problem originates in bbsink_copystream_begin_backup()... Greetings, Andres Freund