Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 38B50133655C for ; Thu, 25 Nov 2010 11:46:17 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 78669-02 for ; Thu, 25 Nov 2010 15:46:12 +0000 (UTC) X-Greylist: delayed 00:08:00.683774 by SQLgrey-1.7.6 Received: from www.frey.de (www.frey.de [217.89.116.44]) by mail.postgresql.org (Postfix) with ESMTP id CC6B9133616B for ; Thu, 25 Nov 2010 11:46:09 -0400 (AST) Received: by www.frey.de (Postfix, from userid 65534) id 38C655822EE; Thu, 25 Nov 2010 16:38:04 +0100 (CET) Received: from localhost.localnet (p5DDB3A06.dip.t-dialin.net [93.219.58.6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by www.frey.de (Postfix) with ESMTPSA id B0B425821F4; Thu, 25 Nov 2010 16:38:02 +0100 (CET) From: Helmar Spangenberg Organization: Frey ADV GmbH To: Heikki Linnakangas Subject: Re: BUG #5769: Problem with SPI_getvalue Date: Thu, 25 Nov 2010 16:38:02 +0100 User-Agent: KMail/1.12.4 (Linux/2.6.31.14-0.4-desktop; KDE/4.3.5; x86_64; ; ) Cc: pgsql-bugs@postgresql.org References: <201011251145.oAPBjweK020676@wwwmaster.postgresql.org> <4CEE7C87.50909@enterprisedb.com> In-Reply-To: <4CEE7C87.50909@enterprisedb.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201011251638.02062.hspangenberg@frey.de> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201011/164 X-Sequence-Number: 28744 You are right. In my case I obviously had corrupted the heap somewhere else - now it works as expected. Thanks for your quick answer, Helmar Am Donnerstag, 25. November 2010 16:11:03 schrieb Heikki Linnakangas: > On 25.11.2010 13:45, Helmar Spangenberg wrote: > > Bug reference: 5769 > > Logged by: Helmar Spangenberg > > Email address: hspangenberg@frey.de > > PostgreSQL version: 9.0.1 > > Operating system: Linux > > Description: Problem with SPI_getvalue > > Details: > > > > Referring to the manual, I can pfree the result returned by SPI_getvalue. > > However the backend crashes as soon as I use pfree. > > > > No example uses pfree. Could it be possible, there is a bug in the > > documentation? > > The return value of SPI_getvalue is certainly palloc()'d, so pfree()ing > it should not crash. Perhaps you are trying to pfree() it after the > whole memory context has already been destroyed. Or perhaps SPI_getvalue > returned a NULL and you're trying to pfree() that. Can't say without > more details. >