Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fy3Qo-0003sc-3r for pgsql-bugs@arkaria.postgresql.org; Thu, 06 Sep 2018 23:11:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fy3Ql-0003UP-Ve for pgsql-bugs@arkaria.postgresql.org; Thu, 06 Sep 2018 23:11:19 +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 1fy2lf-00012c-ER for pgsql-bugs@lists.postgresql.org; Thu, 06 Sep 2018 22:28:51 +0000 Received: from smtp-out-2.mxes.net ([67.222.241.118]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fy2lc-0005tG-GS for pgsql-bugs@lists.postgresql.org; Thu, 06 Sep 2018 22:28:49 +0000 Received: from Customer-MUA (mua.mxes.net [10.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTPSA id 53C012755C; Thu, 6 Sep 2018 18:28:45 -0400 (EDT) Received: from jeremyevans.local (battleground.jeremyevans.local [10.187.8.1]) by battleground.jeremyevans.local (OpenSMTPD) with ESMTPS id 449c5f10 (TLSv1.2:ECDHE-RSA-CHACHA20-POLY1305:256:NO); Thu, 6 Sep 2018 15:28:44 -0700 (PDT) Date: Thu, 6 Sep 2018 15:28:43 -0700 From: Jeremy Evans To: Michael Paquier Cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15367: Crash in pg_fe_scram_free when using foreign tables Message-ID: <20180906222843.GF17425@jeremyevans.local> References: <153626613985.23143.4743626885618266803@wrigleys.postgresql.org> <20180906215836.GP2726@paquier.xyz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180906215836.GP2726@paquier.xyz> User-Agent: Mutt/1.10.1 (2018-07-13) X-Sent-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 09/06 02:58, Michael Paquier wrote: > On Thu, Sep 06, 2018 at 08:35:39PM +0000, PG Bug reporting form wrote: > > If necessary I can build a debug version of PostgreSQL and try using that in > > production so I can get a better backtrace if it crashes again. However, > > considering that the crash is rare in my environment, it's unlikely I will > > be able to produce a better backtrace for the error quickly. > > That would be nice. From what I can see this would be a race condition, > which is not obvious by looking at the code. Testing with a two-node > deployment where the first node has a foreign table which connects to a > second node, using SCRAM authentication, holding the physical table, > then doing many foreign scans across many clients don't show any > problem. Did libpq complain at some point in the session where the > crash happened about any error? The PostgreSQL logfile only shows: postgres(64978) in free(): bogus pointer (double free?) 0x4a115aec398 2018-09-06 12:01:52.202 PDT [45953] LOG: server process (PID 64978) was terminated by signal 6: Abort trap 2018-09-06 12:01:52.202 PDT [45953] DETAIL: Failed process was running: ... 2018-09-06 12:01:52.202 PDT [45953] LOG: terminating any other active server processes If there is another place I should look, please let me know. The log files of the client process don't show anything during the crash, probably because the client libpq connection was just dropped when the server process crashed. After the crash, other client libpq connections show the following, which is probably expected: WARNING: terminating connection because of crash of another server process DETAIL: The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory. HINT: In a moment you should be able to reconnect to the database and repeat your command. I'll try to install a version with debug symbols on September 14, and if it crashes again I'll respond with a more complete and accurate backtrace. Thanks, Jeremy