pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: pgsql: Modify pg_basebackup to use a new COPY subprotocol for base back
Date: Tue, 18 Jan 2022 17:06:11 -0500
Message-ID: <415090.1642543571@sss.pgh.pa.us> (raw)
In-Reply-To: <412464.1642541806@sss.pgh.pa.us>
References: <E1n9tZJ-00058I-Nd@gemulon.postgresql.org>
	<CA+TgmoYx5=1A2K9JYV-9zdhyokU4KKTyNQ9q7CiXrX=YBBMWVw@mail.gmail.com>
	<412464.1642541806@sss.pgh.pa.us>

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=alignment.

Here's the stack trace:

  * frame #0: 0x000000010885dfd0 postgres`sendFile(sink=0x00007fdedf071cb0, readfilename="./global/4178", tarfilename="global/4178", statbuf=0x00007ffee77dfaf8, missing_ok=true, dboid=0, manifest=0x00007ffee77e2780, spcoid=0x0000000000000000) at basebackup.c:1552:10
    frame #1: 0x000000010885cb7f postgres`sendDir(sink=0x00007fdedf071cb0, path="./global", basepathlen=1, sizeonly=false, tablespaces=0x00007fdedf072718, sendtblspclinks=true, manifest=0x00007ffee77e2780, spcoid=0x0000000000000000) at basebackup.c:1354:12
    frame #2: 0x000000010885ca6b postgres`sendDir(sink=0x00007fdedf071cb0, path=".", basepathlen=1, sizeonly=false, tablespaces=0x00007fdedf072718, sendtblspclinks=true, manifest=0x00007ffee77e2780, spcoid=0x0000000000000000) at basebackup.c:1346:13
    frame #3: 0x00000001088595be postgres`perform_base_backup(opt=0x00007ffee77e2e68, sink=0x00007fdedf071cb0) at basebackup.c:352:5
    frame #4: 0x0000000108856b0b postgres`SendBaseBackup(cmd=0x00007fdedf05b510) at basebackup.c:932:3
    frame #5: 0x00000001088711c8 postgres`exec_replication_command(cmd_string="BASE_BACKUP ( LABEL 'pg_basebackup base backup',  PROGRESS,  CHECKPOINT 'fast',  MANIFEST 'yes',  TARGET 'client')") at walsender.c:1734:4 [opt]
    frame #6: 0x00000001088dd61e postgres`PostgresMain(dbname=<unavailable>, username=<unavailable>) 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 = 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





view thread (11+ messages)  latest in thread

Message-ID: <415090.1642543571@sss.pgh.pa.us>
Permalink:  ../415090.1642543571@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/415090.1642543571@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: pgsql: Modify pg_basebackup to use a new COPY subprotocol for base back
  In-Reply-To: <415090.1642543571@sss.pgh.pa.us>
  References: <E1n9tZJ-00058I-Nd@gemulon.postgresql.org> <CA+TgmoYx5=1A2K9JYV-9zdhyokU4KKTyNQ9q7CiXrX=YBBMWVw@mail.gmail.com> <412464.1642541806@sss.pgh.pa.us> <415090.1642543571@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox