Re: BUG #14997: Get segmentation fault on select sum(bigint_field) - Mailing list pgsql-bugs

From David Rowley
Subject Re: BUG #14997: Get segmentation fault on select sum(bigint_field)
Date
Msg-id CAKJS1f8QV1x44exD-GBH=uVQsYLFdeBahy--5Apv7DWAUJWLjA@mail.gmail.com
Whole thread Raw
In response to BUG #14997: Get segmentation fault on select sum(bigint_field)  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #14997: Get segmentation fault on select sum(bigint_field)
List pgsql-bugs
Sergey,

On 4 January 2018 at 01:16, PG Bug reporting form
<noreply@postgresql.org> wrote:
> Program received signal SIGSEGV, Segmentation fault.
> int8_avg_combine (fcinfo=0x55bec3fdbc28) at
> ./build/../src/backend/utils/adt/numeric.c:4285

Thanks for reporting this.

Can I ask, did you build from source?

I can recreate this using:

create table i8 (a bigint);
insert into i8 select generate_Series(1,10000000);
select sum(a) from i8;

But I only get the crash when building with gcc 7.2. I've not tried
other gcc versions, but It works just fine with clang 4.0

The crash occurs at:

state1->sumX = state2->sumX;

sumX is an int128 type, and both state1 and state2 are non-NULL. It's
quite late here, but at first look, this appears to be a gcc bug.

Can you confirm your compiler version?

-- 
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #14997: Get segmentation fault on select sum(bigint_field)
Next
From: David Rowley
Date:
Subject: Re: BUG #14997: Get segmentation fault on select sum(bigint_field)