Fix alignment of GIN in-line posting lists stored in entry tuples.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 23 Jan 2014 20:58:12 +0000 (22:58 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 23 Jan 2014 20:58:12 +0000 (22:58 +0200)
The Sparc machines in the buildfarm are crashing because of misaligned
access to posting lists stored in entry tuples.

I accidentally removed a critical SHORTALIGN() from ginFormTuple, as part
of the packed posting lists patch. Perhaps I thought it was unnecessary,
because the index_form_tuple() call above the SHORTALIGN already aligned
the size, missing the fact that the null-category byte makes it misaligned
again (I think the SHORTALIGN is indeed unnecessary if there's no null-
category byte, but let's just play it safe...)

src/backend/access/gin/ginentrypage.c

index 6f4e727b3e96c8d6d7463fc3558549a5335f1b7a..d5aa243a65931cca905a3b6ced1ea56d1198f41e 100644 (file)
@@ -87,6 +87,8 @@ GinFormTuple(GinState *ginstate,
        newsize = Max(newsize, minsize);
    }
 
+   newsize = SHORTALIGN(newsize);
+
    GinSetPostingOffset(itup, newsize);
    GinSetNPosting(itup, nipd);