pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Marko Tiikkaja <pgmail@joh.to>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #7516: PL/Perl crash
Date: Thu, 13 Sep 2012 13:48:04 -0400
Message-ID: <17684.1347558484@sss.pgh.pa.us> (raw)
In-Reply-To: <50506B94.5040003@joh.to>
References: <E1T8YUZ-0006gb-Oz@wrigleys.postgresql.org>
	<1194.1346688396@sss.pgh.pa.us>
	<5047BA9C.2040405@joh.to>
	<16153.1347226320@sss.pgh.pa.us>
	<17785.1347230278@sss.pgh.pa.us>
	<504F8034.20802@joh.to>
	<4011.1347407415@sss.pgh.pa.us>
	<50506B94.5040003@joh.to>

Marko Tiikkaja <pgmail@joh.to> writes:
> On 9/12/12 1:50 AM, Tom Lane wrote:
>> Marko Tiikkaja <pgmail@joh.to> writes:
>>> Joel Jacobson managed to narrow it down to this test case, which crashes
>>> consistently on Ubuntu 12.04 both with and without your patch.  I,
>>> however, wasn't able to reproduce the problem on my OS X Mountain Lion.

>> Doesn't reproduce for me either ...

> Ok, I can reproduce it on my Ubuntu virtual machine.

Hm, I wonder if it's Ubuntu-specific?  What Perl version is that exactly?

> What happens is that free_plperl_function() for some reason gets called 
> with the prodesc of func0003.  Later on, func0003 wants to get rid of 
> his prodesc and I get a crash.  What's weird about this is that 
> current_call_data->prodesc actually points to the correct prodesc (the 
> one of func0005), but still somehow something different is passed to 
> free_plperl_function().

The only theory that comes to mind is that current_call_data is somehow
getting aliased (free'd and realloc'd).  I don't see how that could
happen, but it occurs to me that it's kinda dumb to be palloc'ing it
in the first place.  Its lifetime is exactly that of the call, so it
would be simpler and more foolproof to make it a local variable.

I've pushed a HEAD patch to do that, and I wonder if you could check
whether it changes anything.

			regards, tom lane




view thread (18+ messages)  latest in thread

Message-ID: <17684.1347558484@sss.pgh.pa.us>
Permalink:  ../17684.1347558484@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/17684.1347558484@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgmail@joh.to
  Subject: Re: BUG #7516: PL/Perl crash
  In-Reply-To: <17684.1347558484@sss.pgh.pa.us>
  References: <E1T8YUZ-0006gb-Oz@wrigleys.postgresql.org> <1194.1346688396@sss.pgh.pa.us> <5047BA9C.2040405@joh.to> <16153.1347226320@sss.pgh.pa.us> <17785.1347230278@sss.pgh.pa.us> <504F8034.20802@joh.to> <4011.1347407415@sss.pgh.pa.us> <50506B94.5040003@joh.to> <17684.1347558484@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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