Re: Bus error in pg_logical_slot_get_changes (9.4.7, sparc) - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Bus error in pg_logical_slot_get_changes (9.4.7, sparc)
Date
Msg-id 15413.1460661880@sss.pgh.pa.us
Whole thread Raw
In response to Re: Bus error in pg_logical_slot_get_changes (9.4.7, sparc)  (Andres Freund <andres@anarazel.de>)
List pgsql-bugs
Andres Freund <andres@anarazel.de> writes:
> On 2016-04-14 13:11:43 -0400, Tom Lane wrote:
>> Proposed patch attached, but I'm still wondering why the alignment-picky
>> buildfarm members aren't all failing on this.  It seems to strongly
>> suggest that the regression tests' coverage is lacking here.

> Well, then Christoph's build wouldn't have caught the issue either?
> Coverage isn't perfect, but it's not bad:
> http://coverage.postgresql.org/src/backend/replication/logical/reorderbuffer.c.gcov.html

BTW, so far as that goes, the question is whether we ever come through
here with two tuples of which the first has a t_len that's not aligned
at least on a 4-byte boundary.  gcov can't tell you that.

I put in an Assert and satisfied myself that the current tests do *not*
ever create such a case.  I tried modifying the test by adding updates
that set a trailing text field to different-length strings, and still
couldn't make it happen.  So something is rounding off the tuple length,
though only to sizeof(int) not to maxalign, which is very curious.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Bus error in pg_logical_slot_get_changes (9.4.7, sparc)
Next
From: Andres Freund
Date:
Subject: Re: Bus error in pg_logical_slot_get_changes (9.4.7, sparc)