Stefan Kaltenbrunner <[EMAIL PROTECTED]> writes:
> FWIW - I removed --with-tcl from quagga's configuration about two weeks
> ago and it has not failed(for that reason) again. So the issue most
> definitly looks like plptcl related ...
I poked around a bit in the Tcl sources, and as far as I can tell it
will never call atexit() on a Linux platform. So that theory isn't
right. However, what I found out via strace'ing is that on my own
Linux machine, Tcl launches a second thread as soon as it's loaded.
This thread just does a select() and sits there. I am not certain
but I think it must be the "notifier" facility seen in the Tcl sources.
What seems likely to me is that the "child process" we see in your ps
output is actually this notifier thread (can you confirm that it's a
thread via additional ps arguments?), and that for some reason the
shutdown of the notifier isn't working right, or maybe the notifier
is dying for some reason and then the main thread can't exit because
it expects the notifier to respond.
Can you "strace -f" the Tcl test and see what happens? The
way I did it was
createlang pltcl pl_regression
-- in another window, identify PID of connected backend, then
strace -f -p PID 2>strace.out
psql> \i .../pltcl_setup.sql
psql> \i .../pltcl_queries.sql
One possibility for fixing it is that maybe we should be making an
effort to execute Tcl_Finalize() before exiting the backend. If so,
having pltcl set up an on_proc_exit callback to do it would be the
appropriate thing. This is all speculation though.
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at