Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f88Vg-0003Lr-Fa for pgsql-bugs@arkaria.postgresql.org; Mon, 16 Apr 2018 18:05:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f88Ve-0003U3-N8 for pgsql-bugs@arkaria.postgresql.org; Mon, 16 Apr 2018 18:05:46 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f88Ve-0003Tu-CK for pgsql-bugs@lists.postgresql.org; Mon, 16 Apr 2018 18:05:46 +0000 Received: from forward3o.cmail.yandex.net ([37.9.109.247]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f88Va-0000mO-GQ for pgsql-bugs@lists.postgresql.org; Mon, 16 Apr 2018 18:05:45 +0000 Received: from mxback4g.mail.yandex.net (mxback4g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:165]) by forward3o.cmail.yandex.net (Yandex) with ESMTP id 70B9320CE8; Mon, 16 Apr 2018 21:05:38 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback4g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id hAQlaJhBh8-5bcaegNu; Mon, 16 Apr 2018 21:05:37 +0300 Received: by web24o.yandex.ru with HTTP; Mon, 16 Apr 2018 21:05:37 +0300 From: Vitaly V. Voronov To: Peter Geoghegan , Alvaro Herrera Cc: Andres Freund , PostgreSQL mailing lists In-Reply-To: References: <20180416174817.3krcrdtfkiwkhj4s@alvherre.pgsql> Subject: Re: BUG #15144: *** glibc detected *** postgres: postgres smsconsole [local] SELECT: double free or corruption (!pre MIME-Version: 1.0 Message-Id: <2139451523901937@web24o.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Mon, 16 Apr 2018 21:05:37 +0300 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello, Peter. Pgpool used only from App side at another server. Zabbix running its queries directly at database server. 16.04.2018, 21:03, "Peter Geoghegan" : > On Mon, Apr 16, 2018 at 10:48 AM, Alvaro Herrera > wrote: >>  and tuplestore_end does this: >>          if (state->myfile) >>                  BufFileClose(state->myfile); >>  without setting anything in state to NULL; so we're relying on the >>  caller fs->tstore to null to avoid repeated tuplestore_end calls. I >>  can't see any way for this to misbehave, but maybe the funcstate appears >>  more than once in the PerFuncState array, and we clean it correctly the >>  first time around and then invoke the tuplestore_end() the second time >>  to the memory that was previously freed? I think this makes no sense >>  unless we share FunctionScanPerFuncState elements -- do we? > > I have no reason to think that we do. Offhand, I find it more likely > that some executor slot that imagines that it owns the tuple frees the > tuple once, which is followed by a call to tuplestore_end() that frees > the same tuple a second time (a double-free). As I mentioned, we've > seen several bugs of that general variety in both tuplestore and > tuplesort in the past. Some of these have been very subtle. > > Note that pgpool is involved here. I don't know much about pgpool, and > maybe that's totally irrelevant. > > -- > Peter Geoghegan