pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #5769: Problem with SPI_getvalue
4+ messages / 3 participants
[nested] [flat]

* BUG #5769: Problem with SPI_getvalue
@ 2010-11-25 11:45 Helmar Spangenberg <hspangenberg@frey.de>
  2010-11-25 15:11 ` Re: BUG #5769: Problem with SPI_getvalue Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
  2010-11-25 16:20 ` Re: BUG #5769: Problem with SPI_getvalue Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 2 replies; 4+ messages in thread

From: Helmar Spangenberg @ 2010-11-25 11:45 UTC (permalink / raw)
  To: pgsql-bugs


The following bug has been logged online:

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?

Thanks,
Helmar



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #5769: Problem with SPI_getvalue
  2010-11-25 11:45 BUG #5769: Problem with SPI_getvalue Helmar Spangenberg <hspangenberg@frey.de>
@ 2010-11-25 15:11 ` Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
  2010-11-25 15:38   ` Re: BUG #5769: Problem with SPI_getvalue Helmar Spangenberg <hspangenberg@frey.de>
  1 sibling, 1 reply; 4+ messages in thread

From: Heikki Linnakangas @ 2010-11-25 15:11 UTC (permalink / raw)
  To: Helmar Spangenberg <hspangenberg@frey.de>; +Cc: pgsql-bugs

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.

-- 
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #5769: Problem with SPI_getvalue
  2010-11-25 11:45 BUG #5769: Problem with SPI_getvalue Helmar Spangenberg <hspangenberg@frey.de>
  2010-11-25 15:11 ` Re: BUG #5769: Problem with SPI_getvalue Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
@ 2010-11-25 15:38   ` Helmar Spangenberg <hspangenberg@frey.de>
  0 siblings, 0 replies; 4+ messages in thread

From: Helmar Spangenberg @ 2010-11-25 15:38 UTC (permalink / raw)
  To: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>; +Cc: pgsql-bugs

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.
> 




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #5769: Problem with SPI_getvalue
  2010-11-25 11:45 BUG #5769: Problem with SPI_getvalue Helmar Spangenberg <hspangenberg@frey.de>
@ 2010-11-25 16:20 ` Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 4+ messages in thread

From: Tom Lane @ 2010-11-25 16:20 UTC (permalink / raw)
  To: Helmar Spangenberg <hspangenberg@frey.de>; +Cc: pgsql-bugs

"Helmar Spangenberg" <hspangenberg@frey.de> writes:
> Referring to the manual, I can pfree the result returned by SPI_getvalue.

Well, the result is the output of a datatype output function.  I think
that's palloc'd by all standard datatypes, but maybe you're working with
a custom datatype that tries to return a constant string?

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2010-11-25 16:20 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-11-25 11:45 BUG #5769: Problem with SPI_getvalue Helmar Spangenberg <hspangenberg@frey.de>
2010-11-25 15:11 ` Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
2010-11-25 15:38   ` Helmar Spangenberg <hspangenberg@frey.de>
2010-11-25 16:20 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox