Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T8ZAe-0004GZ-IN for pgsql-bugs@postgresql.org; Mon, 03 Sep 2012 16:06:40 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T8ZAd-0005EP-A9 for pgsql-bugs@postgresql.org; Mon, 03 Sep 2012 16:06:39 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id q83G6aWn001195; Mon, 3 Sep 2012 12:06:36 -0400 (EDT) From: Tom Lane To: pgmail@joh.to cc: pgsql-bugs@postgresql.org Subject: Re: BUG #7516: PL/Perl crash In-reply-to: References: Comments: In-reply-to pgmail@joh.to message dated "Mon, 03 Sep 2012 15:23:11 -0000" Date: Mon, 03 Sep 2012 12:06:36 -0400 Message-ID: <1194.1346688396@sss.pgh.pa.us> X-Pg-Spam-Score: -2.1 (--) X-Archive-Number: 201209/8 X-Sequence-Number: 34003 pgmail@joh.to writes: > We had a segmentation fault in PostgreSQL 9.1.5 with PL/PerlU. > ... > It seems to have happened when a PL/PerlU executed a prepared statement > which calls another PL/PerlU function. Hm. Is it possible that the prepared statement recursively called the *same* plperl function? And that somebody did a CREATE OR REPLACE on that function meanwhile? It looks to me like validate_plperl_function() for the inner invocation could pull the rug out from under the outer invocation's prodesc pointer. Although even granting all that, you'd have to be quite unlucky to get a crash right there, because free'ing the prodesc wouldn't ordinarily cause the memory to disappear. This might be the wrong theory. You seem to have debug symbols for that core dump --- can you tell which of the dereferences in line 3373 caused the crash? regards, tom lane