Re: [BUGS] BUG #14897: Segfault on statitics SQL request - Mailing list pgsql-bugs

From Andres Freund
Subject Re: [BUGS] BUG #14897: Segfault on statitics SQL request
Date
Msg-id 20171111174512.ikd3zrx2i5ssxpww@alap3.anarazel.de
Whole thread Raw
In response to Re: [BUGS] BUG #14897: Segfault on statitics SQL request  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [BUGS] BUG #14897: Segfault on statitics SQL request  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On 2017-11-11 12:41:40 -0500, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> > That's using SSE, which requires 16byte alignment IIRC.  I think we need
> > a function that properly allocate int128 vars with the right alignment -
> > don't think we want to go for full 16byte alignment for everything.
> 
> Yeah, changing MAXALIGN is out of the question.  I'm thinking about
> another flag bit for MemoryContextAllocExtended.  Do we need to think
> about other use-cases besides int128?  Should we just force 16-byte
> alignment on all architectures, or does it need to be platform-specific?

I'm not sure we want to
a) Rely on one alignment being enough for everybody.
b) Additionally burden already hot code paths with a growing number of  alignment flag tests, and the necessary math.

How about a MemoryContextAllocAligned(context, size, alignto, flags)
that passes on most flags but adds the necessary overhead to size, and
padds the result appropriately?

Greetings,

Andres Freund


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: [BUGS] BUG #14897: Segfault on statitics SQL request
Next
From: Tom Lane
Date:
Subject: Re: [BUGS] BUG #14897: Segfault on statitics SQL request