Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c9ZD4-0001qB-La for pgsql-bugs@arkaria.postgresql.org; Wed, 23 Nov 2016 15:11:42 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1c9ZD3-0003Ew-IH for pgsql-bugs@arkaria.postgresql.org; Wed, 23 Nov 2016 15:11:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c9ZD3-0003Em-5F for pgsql-bugs@postgresql.org; Wed, 23 Nov 2016 15:11:41 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c9ZCz-0001PA-Is for pgsql-bugs@postgresql.org; Wed, 23 Nov 2016 15:11:40 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id uANFBYNh027010; Wed, 23 Nov 2016 10:11:34 -0500 From: Tom Lane To: Jean-Francois Gauthier cc: pgsql-bugs@postgresql.org Subject: Re: Backend receive buffer get corrupted with string: NOTICE: table "cleanup_keys" does not exist, skipping In-reply-to: References: Comments: In-reply-to Jean-Francois Gauthier message dated "Tue, 22 Nov 2016 22:52:10 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <27008.1479913894.1@sss.pgh.pa.us> Date: Wed, 23 Nov 2016 10:11:34 -0500 Message-ID: <27009.1479913894@sss.pgh.pa.us> X-Pg-Spam-Score: -4.8 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Jean-Francois Gauthier writes: > I have an application (multi thread) that send a lot of query on multiple > connections to postgres executable backend using libpq client library. One > connection per thread. > Since the problem is very hard to reproduce, I cannot give you a sample sql > file to reproduce it because it will require multiple sql files to run in > parallel. > The symptom is: I get the following error message: *invalid frontend > message type 78* > *Please, don't stop reading here and tell me I have a memory corruption in > my application. It is not the case. I did my home work !* Unfortunately, that's exactly the conclusion anyone would draw here. libpq does not contain any threading support per se: if you use it in a multithreaded application, it's on you to ensure that each PGconn object is accessed by only one thread at a time. These symptoms are completely consistent with the idea that you messed that up somewhere. It's a bit of a leap of logic to guess that the problem is triggered by notice-message handling, but if you are installing a custom message processor, that's where I'd look first, for sure. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs