Re: SerializeParamList vs machines with strict alignment

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, hlinnaka <hlinnaka(at)iki(dot)fi>
Subject: Re: SerializeParamList vs machines with strict alignment
Date: 2018-10-01 20:49:07
Message-ID: 28627.1538426947@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> The attached revised patch contains a test case that demonstrably triggers
> the problem on gaur's host. Oddly, I do not get a crash either on a PPC
> Mac or a Raspberry Pi 3 running Raspbian. I'm not very sure why; I traced
> through things with gdb and it's definitely calling EA_flatten_into with
> an odd address and a non-flattened input. I guess both of those platforms
> have kernel handlers for misaligned accesses? But the Raspbian box ought
> to be nearly the same as chipmunk, which is where we saw the problem to
> begin with, so I'm a bit confused.

Ah: a bit of googling later, the mystery is solved. PPC does have support
for unaligned 32-bit accesses, which is as much as EA_flatten_into needs.
(It's 64-bit operations where you might have a problem.) My info was
also out of date about ARM: more recent processors, at least, can also
do unaligned 32-bit accesses. chipmunk either has a pretty old processor
or it is configured to disable unaligned access.

Apparently the only somewhat-modern architecture that is resolutely
unaligned-unfriendly is MIPS.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2018-10-01 20:58:21 Re: Odd 9.4, 9.3 buildfarm failure on s390x
Previous Message Andrew Dunstan 2018-10-01 20:43:37 Re: buildfarm and git pull