Re: [BUGS] BUG #14897: Segfault on statitics SQL request
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dmitry Dolgov <9erthalion6@gmail.com>
Cc: Andres Freund <andres@anarazel.de>,
Peter Eisentraut <peter.eisentraut@2ndquadrant.com>,
Michael Paquier <michael.paquier@gmail.com>,
Vincent Lachenal <vincent.lachenal@gmail.com>,
PostgreSQL mailing lists <pgsql-bugs@postgresql.org>
Date: 2017-11-14T03:31:23Z
Lists: pgsql-bugs
Attachments
- int128-hack.patch (text/x-diff) patch
I wrote: > So what I am now thinking is that the only practical answer is to stop > gcc from believing that it is safe to use 16-aligned instructions on > int128's. (Some reading on the net suggests that the actual performance > penalty for that is minimal anyway on modern Intel chips.) Concretely, the attached patch fixes it for me. I've verified by examining the assembly code that this stops gcc from using movdqa or movaps in numeric.c, except for one place where it apparently can prove that it's dealing with a sufficiently-aligned local variable. As I said before, I don't like moving the int128 typedefs into a section where they don't belong, but that's just cosmetic --- this is good enough for testing. BTW, for me, gcc only seems to want to generate 16-aligned instructions in functions used for parallel aggregation. That may explain why we've not seen a report before: the vulnerable code exists in 9.6, but it's not used by default, since parallelization isn't on by default. regards, tom lane
Commits
-
Prevent int128 from requiring more than MAXALIGN alignment.
- d4e38489f98a 9.5.11 landed
- 619a8c47da72 10.2 landed
- 4a15f87d2277 9.6.7 landed
- 7518049980be 11.0 landed
-
Rearrange c.h to create a "compiler characteristics" section.
- cfc157078f2e 9.5.11 landed
- a8910506757c 10.2 landed
- 6c35b3aa465e 9.6.7 landed
- 91aec93e6089 11.0 landed