Re: SerializedSnapshotData alignment

From: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Rahila Syed <rahilasyed90(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: SerializedSnapshotData alignment
Date: 2017-02-27 02:08:35
Message-ID: CAEepm=0EejF1m+cybaf8YD=ae+y-NE9r54_9=q5gTyLJpiVcjQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Feb 27, 2017 at 2:18 PM, Noah Misch <noah(at)leadboat(dot)com> wrote:
> I wondered the same thing; if nothing else, why don't protosciurus and
> castoroides fail the same way? They do use older compilers, "Sun C 5.10
> SunOS_sparc 2009/06/03" and gcc 3.4.3. I have "Sun C 5.12 SunOS_sparc
> 2011/11/16" and gcc 4.9.2, both of which are alignment-sensitive in several
> configurations, according to the attached test program. However, in a 32-bit
> build with this Sun C, I don't get alignment-related bus errors. (Those
> animals build 64-bit, so this isn't the full story.)

It's been a while but I seem to recall that Sun C defaulted to a
-xmemalign setting that tolerated misaligned reads in 32 bit builds,
but used a different default on 64 bit builds. "Solaris Application
Programming" 5.8.5 seems to confirm this: "For 32-bit applications,
since Sun Studio 9, the default is for the compiler to assume 8-byte
alignment and to trap and correct any misaligned data accesses. For
64-bit applications, the compiler assumes 8-byte alignment, but the
application will SIGBUS on a misaligned access."

Yet castoroides seems to be building with -m64, so that's not the
explanation. Could it be correctly aligned by coincidence?

--
Thomas Munro
http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2017-02-27 02:28:08 Re: timeouts in PostgresNode::psql
Previous Message Michael Paquier 2017-02-27 01:43:39 Re: IF (NOT) EXISTS in psql-completion