Re: BUG #14897: Segfault on statitics SQL request

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Dmitry Dolgov <9erthalion6(at)gmail(dot)com>, Vincent Lachenal <vincent(dot)lachenal(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #14897: Segfault on statitics SQL request
Date: 2017-11-11 08:39:11
Message-ID: CAB7nPqR7mWvtnALZF93oez_v03NFCJ8dXP9CNicaUDv3KjDbYw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sat, Nov 11, 2017 at 8:06 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Dmitry Dolgov <9erthalion6(at)gmail(dot)com> writes:
>> Looks like I can reproduce something close to this issue on my Gentoo
>> installation using the provided dataset, but it looks quite weird for me:
>
> Interesting. I wonder whether __int128 has an alignment requirement that
> is more than MAXALIGN. Intel chips generally don't enforce alignment
> requirements, but maybe there's an exception here?
>
> My Fedora box thinks __alignof__(__int128) is 16, which is suspicious,
> but it's not crashing.

My laptop uses Arch, and I can see the crash easily when compiling
with gcc 7.2 which is the one bundled in the core package set:
#0 int8_avg_combine (fcinfo=0x55e290767d50) at numeric.c:4355
#1 0x000055e28e571ae3 in advance_combine_function
(pergroupstate=0x55e290764ac0, pertrans=0x55e290767c28,
aggstate=0x55e290756d78) at nodeAgg.c:1264
#2 combine_aggregates (aggstate=0x55e290756d78, pergroup=<optimized
out>) at nodeAgg.c:1198
#3 0x000055e28e5727ad in agg_retrieve_direct
(aggstate=0x55e290756d78) at nodeAgg.c:2438
#4 ExecAgg (pstate=0x55e290756d78) at nodeAgg.c:2155
#5 0x000055e28e5649da in ExecProcNode (node=0x55e290756d78) at
../../../src/include/executor/executor.h:251
#6 ExecutePlan (execute_once=<optimized out>, dest=0x7ff0cec60d98,
direction=<optimized out>, numberTuples=0, sendTuples=<optimized out>,
operation=CMD_SELECT,
use_parallel_mode=<optimized out>, planstate=0x55e290756d78,
estate=0x55e290756b38) at execMain.c:1720
#7 standard_ExecutorRun (queryDesc=0x55e290756728,
direction=<optimized out>, count=0, execute_once=<optimized out>) at
execMain.c:363
#8 0x000055e28e69166d in PortalRunSelect
(portal=portal(at)entry=0x55e290754718, forward=forward(at)entry=1 '\001',
count=0, count(at)entry=9223372036854775807,
dest=dest(at)entry=0x7ff0cec60d98) at pquery.c:932
#9 0x000055e28e692b4e in PortalRun
(portal=portal(at)entry=0x55e290754718,
count=count(at)entry=9223372036854775807, isTopLevel=isTopLevel(at)entry=1
'\001',
run_once=run_once(at)entry=1 '\001', dest=dest(at)entry=0x7ff0cec60d98,
altdest=altdest(at)entry=0x7ff0cec60d98, completionTag=0x7ffd6d2dfd50 "")
at pquery.c:773
#10 0x000055e28e68e882 in exec_simple_query (
query_string=0x55e290686398 "SELECT\n s.protocol,\n
s.mapper,\n c.method,\n s.nb_threads,\n
avg(c.client_end - c.client_start) / 1000000 AS total,\n
avg(c.server_end - c.server_start) / 1000000"...) at postgres.c:1120
#11 0x000055e28e6907f0 in PostgresMain (argc=<optimized out>,
argv=argv(at)entry=0x55e290698dd8, dbname=<optimized out>,
username=<optimized out>) at postgres.c:4139
#12 0x000055e28e3e531c in BackendRun (port=0x55e290690500) at postmaster.c:4364
#13 BackendStartup (port=0x55e290690500) at postmaster.c:4036
#14 ServerLoop () at postmaster.c:1755
#15 0x000055e28e622fe4 in PostmasterMain (argc=3, argv=0x55e290666760)
at postmaster.c:1363
#16 0x000055e28e3e68e8 in main (argc=3, argv=0x55e290666760) at main.c:228
(gdb) p state1->sumX
$1 = 0x00000000000000000000000000000000
(gdb) p state2->sumX
$2 = 0x0000000000000000000000004c170e30
--
Michael

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2017-11-11 09:11:06 Re: BUG #14866: The generated constraint in the typed table causes the server to crash
Previous Message digoal 2017-11-11 08:34:15 BUG #14899: not null constraint cann't improve the planner