Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kxwVM-0004zK-M8 for pgsql-general@arkaria.postgresql.org; Fri, 08 Jan 2021 18:28:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kxwVK-0001fW-SU for pgsql-general@arkaria.postgresql.org; Fri, 08 Jan 2021 18:28:54 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kxwVK-0001fP-Kl for pgsql-general@lists.postgresql.org; Fri, 08 Jan 2021 18:28:54 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kxwVE-0000Zc-4U for pgsql-general@postgresql.org; Fri, 08 Jan 2021 18:28:53 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 108ISjdM326716; Fri, 8 Jan 2021 13:28:45 -0500 From: Tom Lane To: Pavel Stehule cc: Jack Orenstein , "pgsql-general@postgresql.org >> PG-General Mailing List" Subject: Re: Finding memory corruption in an extension In-reply-to: References: Comments: In-reply-to Pavel Stehule message dated "Fri, 08 Jan 2021 18:53:52 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <326714.1610130525.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Fri, 08 Jan 2021 13:28:45 -0500 Message-ID: <326715.1610130525@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Pavel Stehule writes: > pá 8. 1. 2021 v 18:48 odesílatel Jack Orenstein napsal: >> I'm interested in advice on how to go about hunting down my problem. >> Something along the lines of a debugging malloc, or valgrind, for Postgres. > The basic feature is using postgres compiled with --enable-cassert flag. It > does lot of checks of memory corruptions Yeah, you should absolutely use --enable-cassert when working on C code. If you need valgrind, there's advice about how to run it at https://wiki.postgresql.org/wiki/Valgrind regards, tom lane