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

From Tom Lane
Subject Re: [BUGS] BUG #14897: Segfault on statitics SQL request
Date
Msg-id 23171.1510637495@sss.pgh.pa.us
Whole thread Raw
In response to Re: [BUGS] BUG #14897: Segfault on statitics SQL request  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: [BUGS] BUG #14897: Segfault on statitics SQL request  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-bugs
Michael Paquier <michael.paquier@gmail.com> writes:
> On Tue, Nov 14, 2017 at 12:31 PM, Tom Lane <tgl@sss.pgh.pa.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


pgsql-bugs by date:

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