Re: segfault due to invalid cached plan - Mailing list pgsql-hackers

From Tomas Vondra
Subject Re: segfault due to invalid cached plan
Date
Msg-id 0d337b3b-5161-f00f-4e6d-3fe2fa9b18c6@2ndquadrant.com
Whole thread Raw
In response to segfault due to invalid cached plan  (Nicolas Thauvin <nicolas.thauvin@dalibo.com>)
Responses Re: segfault due to invalid cached plan  (Nicolas Thauvin <nicolas.thauvin@dalibo.com>)
List 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


pgsql-hackers by date:

Previous
From: Dean Rasheed
Date:
Subject: Re: [HACKERS] PATCH: multivariate histograms and MCV lists
Next
From: Dmitry Ivanov
Date:
Subject: Re: [HACKERS] GSoC 2017: weekly progress reports (week 6)