Fix misaligned access of ItemPointerData on ARM - Mailing list pgsql-hackers

From Piotr Stefaniak
Subject Fix misaligned access of ItemPointerData on ARM
Date
Msg-id BLU436-SMTP793374CDF35019C01D7FF3F2C10@phx.gbl
Whole thread Raw
Responses Re: Fix misaligned access of ItemPointerData on ARM  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hello,

Currently there is only one struct that gets packed (via the
__attribute__ keyword that a few compilers support) and it is packed
only on ARM machines -- in order to force it to be exactly 6 bytes long.

But due to how ExecRowMark struct is laid out in memory, the packed
struct ItemPointerData begins at an uneven offset, leading to misaligned
access whenever BlockIdData is set by ItemPointerSetInvalid() (and
likely in some other places, too).

The attached patch is my attempt at fixing that by adding the aligned
attribute (the struct will remain packed).

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: GROUPING
Next
From: Feng Tian
Date:
Subject: Re: Float/Double cast to int