Re: [BUGS] BUG #14897: Segfault on statitics SQL request

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Dmitry Dolgov <9erthalion6(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Vincent Lachenal <vincent(dot)lachenal(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: [BUGS] BUG #14897: Segfault on statitics SQL request
Date: 2017-11-14 05:31:35
Message-ID: 23171.1510637495@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Michael Paquier <michael(dot)paquier(at)gmail(dot)com> writes:
> On Tue, Nov 14, 2017 at 12:31 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> 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.

> I am not seeing any difference in the assembly code generated by gcc
> -S with and without your patch. Perhaps I am missing something? What
> are you actually seeing?

Hm, double-check your procedure. I get this:

$ diff numeric.s.std numeric.s.patch
2746c2746
< movaps %xmm0, (%r14)
---
> movups %xmm0, (%r14)
13948,13951c13948,13951
< movdqa 16(%rbp), %xmm0
< movaps %xmm0, 16(%rax)
< movdqa 32(%rbp), %xmm0
< movaps %xmm0, 32(%rax)
---
> movdqu 16(%rbp), %xmm0
> movups %xmm0, 16(%rax)
> movdqu 32(%rbp), %xmm0
> movups %xmm0, 32(%rax)
14434,14435c14434,14435
< movdqa 16(%rbp), %xmm0
< movaps %xmm0, 16(%rax)
---
> movdqu 16(%rbp), %xmm0
> movups %xmm0, 16(%rax)

(If using -g, there are a bunch more diffs in the debug tables.)

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2017-11-14 06:16:34 Re: [BUGS] BUG #14897: Segfault on statitics SQL request
Previous Message Michael Paquier 2017-11-14 05:20:25 Re: [BUGS] BUG #14897: Segfault on statitics SQL request