postgresql/src/pl
Tom Lane 59f23fe8d4 Make plperl safe against functions that are redefined while running.
validate_plperl_function() supposed that it could free an old
plperl_proc_desc struct immediately upon detecting that it was stale.
However, if a plperl function is called recursively, this could result
in deleting the struct out from under an outer invocation, leading to
misbehavior or crashes.  Add a simple reference-count mechanism to
ensure that such structs are freed only when the last reference goes
away.

Per investigation of bug #7516 from Marko Tiikkaja.  I am not certain
that this error explains his report, because he says he didn't have
any recursive calls --- but it's hard to see how else it could have
crashed right there.  In any case, this definitely fixes some problems
in the area.

Back-patch to all active branches.
2012-09-09 20:32:54 -04:00
..
plperl Make plperl safe against functions that are redefined while running. 2012-09-09 20:32:54 -04:00
plpgsql Split tuple struct defs from htup.h to htup_details.h 2012-08-30 16:52:35 -04:00
plpython Adjust PL/Python regression tests some more for Python 3.3. 2012-09-08 17:39:02 -04:00
tcl Split tuple struct defs from htup.h to htup_details.h 2012-08-30 16:52:35 -04:00
Makefile Make distprep and *clean build targets recurse into all subdirectories. 2011-07-03 13:55:12 -04:00