Re: segfault due to invalid cached plan

From: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
To: Nicolas Thauvin <nicolas(dot)thauvin(at)dalibo(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: segfault due to invalid cached plan
Date: 2018-03-28 14:14:04
Message-ID: 0d337b3b-5161-f00f-4e6d-3fe2fa9b18c6@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

regards

--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dmitry Ivanov 2018-03-28 14:19:27 Re: [HACKERS] GSoC 2017: weekly progress reports (week 6)
Previous Message Dean Rasheed 2018-03-28 14:12:19 Re: [HACKERS] PATCH: multivariate histograms and MCV lists