Repair oversights in the mechanism used to store compiled plpgsql functions.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 30 Jan 2007 22:05:20 +0000 (22:05 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 30 Jan 2007 22:05:20 +0000 (22:05 +0000)
commit64f69d1fc71edbb8476eeb0ecb41bb1242dae63b
tree44ae4b8bd81ddf031e296ff7b597bbbb9f661efd
parent037cbd21d01942d828f58adb1211f14cab2712c7
Repair oversights in the mechanism used to store compiled plpgsql functions.
The original coding failed (tried to access deallocated memory) if there were
two active call sites (fn_extra pointers) for the same function and the
function definition was updated.  Also, if an update of a recursive function
was detected upon nested entry to the function, the existing compiled version
was summarily deallocated, resulting in crash upon return to the outer
instance.  Problem observed while studying a bug report from Sergiy
Vyshnevetskiy.

Bug does not exist before 8.1 since older versions just leaked the memory of
obsoleted compiled functions, rather than trying to reclaim it.
src/pl/plpgsql/src/pl_comp.c
src/pl/plpgsql/src/pl_handler.c
src/pl/plpgsql/src/plpgsql.h