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 1n9wcL-0008Rb-Dq for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Jan 2022 22:06:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n9wcJ-0006qG-Rl for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Jan 2022 22:06:15 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n9wcJ-0006pN-IF for pgsql-hackers@lists.postgresql.org; Tue, 18 Jan 2022 22:06:15 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n9wcH-0006Vp-8y for pgsql-hackers@lists.postgresql.org; Tue, 18 Jan 2022 22:06:14 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 20IM6BKO415091; Tue, 18 Jan 2022 17:06:11 -0500 From: Tom Lane To: Robert Haas cc: PostgreSQL Hackers Subject: Re: pgsql: Modify pg_basebackup to use a new COPY subprotocol for base back In-reply-to: <412464.1642541806@sss.pgh.pa.us> References: <412464.1642541806@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Tue, 18 Jan 2022 16:36:46 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <415089.1642543571.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 18 Jan 2022 17:06:11 -0500 Message-ID: <415090.1642543571@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I wrote: >> Tom, any chance you can get a stack trace? > Hmm, I'd assumed that was just a cosmic ray or something. My mistake: it's failing because of -fsanitize=3Dalignment. Here's the stack trace: * frame #0: 0x000000010885dfd0 postgres`sendFile(sink=3D0x00007fdedf071c= b0, readfilename=3D"./global/4178", tarfilename=3D"global/4178", statbuf=3D= 0x00007ffee77dfaf8, missing_ok=3Dtrue, dboid=3D0, manifest=3D0x00007ffee77= e2780, spcoid=3D0x0000000000000000) at basebackup.c:1552:10 frame #1: 0x000000010885cb7f postgres`sendDir(sink=3D0x00007fdedf071cb= 0, path=3D"./global", basepathlen=3D1, sizeonly=3Dfalse, tablespaces=3D0x0= 0007fdedf072718, sendtblspclinks=3Dtrue, manifest=3D0x00007ffee77e2780, sp= coid=3D0x0000000000000000) at basebackup.c:1354:12 frame #2: 0x000000010885ca6b postgres`sendDir(sink=3D0x00007fdedf071cb= 0, path=3D".", basepathlen=3D1, sizeonly=3Dfalse, tablespaces=3D0x00007fde= df072718, sendtblspclinks=3Dtrue, manifest=3D0x00007ffee77e2780, spcoid=3D= 0x0000000000000000) at basebackup.c:1346:13 frame #3: 0x00000001088595be postgres`perform_base_backup(opt=3D0x0000= 7ffee77e2e68, sink=3D0x00007fdedf071cb0) at basebackup.c:352:5 frame #4: 0x0000000108856b0b postgres`SendBaseBackup(cmd=3D0x00007fded= f05b510) at basebackup.c:932:3 frame #5: 0x00000001088711c8 postgres`exec_replication_command(cmd_str= ing=3D"BASE_BACKUP ( LABEL 'pg_basebackup base backup', PROGRESS, CHECKP= OINT 'fast', MANIFEST 'yes', TARGET 'client')") at walsender.c:1734:4 [o= pt] frame #6: 0x00000001088dd61e postgres`PostgresMain(dbname=3D, username=3D) at postgres.c:4494:12 [opt] It failed at -> 1552 if (!PageIsNew(page) && PageGetLSN= (page) < sink->bbs_state->startptr) and the problem is evidently that the page pointer isn't nicely aligned: (lldb) p page (char *) $4 =3D 0x00007fdeded7e041 "" (I checked the "sink" data structure too for luck, but it seems fine.) I see that thorntail has now also fallen over, presumably for the same reason. regards, tom lane