Re: segfault due to invalid cached plan

From: Nicolas Thauvin <nicolas(dot)thauvin(at)dalibo(dot)com>
To: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: segfault due to invalid cached plan
Date: 2018-03-28 14:54:48
Message-ID: 20180328165448.74cc5287@dalibo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 28 Mar 2018 16:14:04 +0200
Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com> wrote:

> On 03/28/2018 03:54 PM, Nicolas Thauvin wrote:
> > Hello,
> >
> > A customer sent us a core dump of the crash of the background
> > worker of the powa extension, running on 9.6.8 along side with
> > cstore_fdw.
> >
> > The background worker loops on a plpgsql function, which then
> > execute another plpgsql function that issues the query "TRUNCATE
> > powa_statements_history_current".
> >
> > Here is the backtrace :
> >
> > ...
> >
> > The core shows that ProcessUtility hook of cstore_fdw produces a
> > segfault when trying to copy the relation list of the truncate
> > statement plan.
> >
> > In frame 2:
> > (gdb) p *((TruncateStmt *)parseTree)
> > $26 = {type = T_TruncateStmt, relations = 0x2f106a8, restart_seqs =
> > 0 '\000', behavior = DROP_RESTRICT} (gdb) p *(((TruncateStmt
> > *)parseTree)->relations) $27 = {type = 49574520, length = 0, head =
> > 0x0, tail = 0x2faaab8}
> >
> > With this invalid list, standard_ProcessUtility would not have
> > failed but the relation would not have been truncated.
> >
> > ...
> >
> > Could you please give me some pointers to further investigate this
> > crash?
> >
>
> Sounds like a bug in CStoreProcessUtility, which is part of
> cstore_fdw, not PostgreSQL. So I guess the right place to report the
> issue is
>
> https://github.com/citusdata/cstore_fdw
>
>

Having a second look at the code of cstore_fdw, it modifies the data.
I'll investigate more on this code.

Thank you
--
Nicolas Thauvin
+33 (0)1 84 16 92 09
http://dalibo.com - http://dalibo.org

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Anastasia Lubennikova 2018-03-28 14:59:31 Re: WIP: Covering + unique indexes.
Previous Message Tomas Vondra 2018-03-28 14:50:41 Re: [HACKERS] PATCH: multivariate histograms and MCV lists