Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aSCK0-0000Ie-B7 for pgsql-bugs@arkaria.postgresql.org; Sat, 06 Feb 2016 23:31:20 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aSCJy-0003Ib-T9 for pgsql-bugs@arkaria.postgresql.org; Sat, 06 Feb 2016 23:31:18 +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) (envelope-from ) id 1aSCJM-0002c2-JV for pgsql-bugs@postgresql.org; Sat, 06 Feb 2016 23:30:40 +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) (envelope-from ) id 1aSCJF-0005eo-1N for pgsql-bugs@postgresql.org; Sat, 06 Feb 2016 23:30: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 u16NUKSD031290; Sat, 6 Feb 2016 18:30:20 -0500 From: Tom Lane To: Pavel Stehule cc: Andres Freund , Dmitriy Sarafannikov , pgsql-bugs Subject: Re: Re[2]: [BUGS] Segfault in MemoryContextAlloc In-reply-to: References: <1453890275.241158212@f404.i.mail.ru> <20160127103533.GA17919@awork2.anarazel.de> <1453891638.831641165@f352.i.mail.ru> <8F98BBF2-97FA-42D5-BD47-2EA050657773@anarazel.de> Comments: In-reply-to Pavel Stehule message dated "Wed, 27 Jan 2016 13:36:21 +0100" Date: Sat, 06 Feb 2016 18:30:20 -0500 Message-ID: <31289.1454801420@sss.pgh.pa.us> X-Pg-Spam-Score: -2.3 (--) 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 Pavel Stehule writes: > 2016-01-27 13:26 GMT+01:00 Andres Freund : >> What exactly does your extension do? And where did you add that null check? > this extension does some log preprocessing for syslog > extension and fix attached That extension is broken on its face. You cannot have an emit_log_hook that does catalog access, because elog() can be called outside a transaction or in an already-failed transaction. Whatever band-aids you put around that will just be band-aids that will fail regularly. You need to move the catalog lookup someplace else. (Actually, I wonder why you're doing a catalog lookup at all ... wouldn't it be sufficient to do a DirectFunctionCall to inet_out?) I doubt this has much to do with the OP's issue. 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