pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christoph Berg <christoph.berg@credativ.de>
To: Andres Freund <andres@anarazel.de>
Cc: PostgreSQL Bugs <pgsql-bugs@postgresql.org>
Subject: Re: Bus error in pg_logical_slot_get_changes (9.4.7, sparc)
Date: Wed, 13 Apr 2016 23:11:52 +0200
Message-ID: <20160413211152.GA21711@msg.credativ.de> (raw)
In-Reply-To: <20160413161906.aykti6iwdc7zv7l6@alap3.anarazel.de>
References: <20160413094117.GC21485@msg.credativ.de>
	<20160413161906.aykti6iwdc7zv7l6@alap3.anarazel.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Re: Andres Freund 2016-04-13 <20160413161906.aykti6iwdc7zv7l6@alap3.anarazel.de>
> > 2327                                    Size            tuplelen = ((HeapTuple) data)->t_len;
> 
> Hrmpf, I guess this is an alignment issue. We should probably replace
> that ->t_len lookup with a memcpy. IIRC it's not entirely trivial to
> access porter boxes anymore - could you perhaps just replace those two
> t_len lookups with a memcpy (i.e. memcpy(&tuplelen, &(HeapTuple)
> data)->t_len, sizeof(uint32))?

That fixed the contrib/test_decoding checks, thanks.
Will do another full build over night to double check.

Mit freundlichen Grüßen,
Christoph Berg
-- 
Senior Berater, Tel.: +49 (0)21 61 / 46 43-187
credativ GmbH, HRB Mönchengladbach 12080, USt-ID-Nummer: DE204566209
Hohenzollernstr. 133, 41061 Mönchengladbach
Geschäftsführung: Dr. Michael Meskes, Jörg Folz, Sascha Heuer
pgp fingerprint: 5C48 FE61 57F4 9179 5970  87C6 4C5A 6BAB 12D2 A7AE

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Attachments:

pglogical-alignment (text/plain, 869B) download --- a/src/backend/replication/logical/reorderbuffer.c +++ b/src/backend/replication/logical/reorderbuffer.c @@ -2303,7 +2303,8 @@ ReorderBufferRestoreChange(ReorderBuffer case REORDER_BUFFER_CHANGE_DELETE: if (change->data.tp.oldtuple) { - Size tuplelen = ((HeapTuple) data)->t_len; + Size tuplelen; + memcpy(&tuplelen, &((HeapTuple) data)->t_len, sizeof(uint32)); change->data.tp.oldtuple = ReorderBufferGetTupleBuf(rb, tuplelen - offsetof(HeapTupleHeaderData, t_bits)); @@ -2324,7 +2325,8 @@ ReorderBufferRestoreChange(ReorderBuffer if (change->data.tp.newtuple) { - Size tuplelen = ((HeapTuple) data)->t_len; + Size tuplelen; + memcpy(&tuplelen, &((HeapTuple) data)->t_len, sizeof(uint32)); change->data.tp.newtuple = ReorderBufferGetTupleBuf(rb, tuplelen - offsetof(HeapTupleHeaderData, t_bits));

view thread (15+ messages)  latest in thread

Message-ID: <20160413211152.GA21711@msg.credativ.de>
Permalink:  ../20160413211152.GA21711@msg.credativ.de/
Also on:    postgresql.org/message-id/20160413211152.GA21711@msg.credativ.de

 · 

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-bugs@postgresql.org
  Cc: christoph.berg@credativ.de, andres@anarazel.de
  Subject: Re: Bus error in pg_logical_slot_get_changes (9.4.7, sparc)
  In-Reply-To: <20160413211152.GA21711@msg.credativ.de>
  References: <20160413094117.GC21485@msg.credativ.de> <20160413161906.aykti6iwdc7zv7l6@alap3.anarazel.de> <20160413211152.GA21711@msg.credativ.de>

* 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