Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g758C-0005fB-RY for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Oct 2018 20:49:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g758B-0005pp-6g for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Oct 2018 20:49:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g758A-0005pi-Vf for pgsql-hackers@lists.postgresql.org; Mon, 01 Oct 2018 20:49:27 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g7585-0000Vc-F0 for pgsql-hackers@lists.postgresql.org; Mon, 01 Oct 2018 20:49:26 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w91Kn7Wq028628; Mon, 1 Oct 2018 16:49:07 -0400 From: Tom Lane To: Amit Kapila cc: PostgreSQL Hackers , hlinnaka Subject: Re: SerializeParamList vs machines with strict alignment In-reply-to: <27748.1538425312@sss.pgh.pa.us> References: <11629.1536550032@sss.pgh.pa.us> <8352.1536586500@sss.pgh.pa.us> <27748.1538425312@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Mon, 01 Oct 2018 16:21:52 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <28626.1538426947.1@sss.pgh.pa.us> Date: Mon, 01 Oct 2018 16:49:07 -0400 Message-ID: <28627.1538426947@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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