Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TCEQN-00082K-Qs for pgsql-bugs@postgresql.org; Thu, 13 Sep 2012 18:46:03 +0000 Received: from globepointer.com ([213.157.92.217]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TCEQM-0006GR-2K for pgsql-bugs@postgresql.org; Thu, 13 Sep 2012 18:46:03 +0000 Received: from [94.191.163.150] (94.191.163.150.bredband.tre.se [94.191.163.150]) (Authenticated sender: pgmail) by globepointer.com (Postfix) with ESMTP id D7E83BB25; Thu, 13 Sep 2012 21:46:00 +0300 (EEST) Message-ID: <505229E8.9070507@joh.to> Date: Thu, 13 Sep 2012 20:46:00 +0200 From: Marko Tiikkaja User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120824 Thunderbird/15.0 MIME-Version: 1.0 To: Tom Lane CC: pgsql-bugs@postgresql.org Subject: Re: BUG #7516: PL/Perl crash References: <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> In-Reply-To: <17684.1347558484@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201209/124 X-Sequence-Number: 34119 On 13/09/2012 19:48, Tom Lane wrote: > Marko Tiikkaja writes: >> On 9/12/12 1:50 AM, Tom Lane wrote: > Hm, I wonder if it's Ubuntu-specific? What Perl version is that exactly? We've reproduced it on both 5.14.2 and 5.16.1. >> 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. Will look at that tomorrow, thanks. Regards, Marko Tiikkaja