Re: weird buildfarm failures on arm/mipsel and --with-tcl - Mailing list pgsql-hackers

From Tom Lane
Subject Re: weird buildfarm failures on arm/mipsel and --with-tcl
Date
Msg-id 22232.1170018418@sss.pgh.pa.us
Whole thread Raw
In response to Re: weird buildfarm failures on arm/mipsel and --with-tcl  (Stefan Kaltenbrunner <stefan@kaltenbrunner.cc>)
Responses Re: weird buildfarm failures on arm/mipsel and --with-tcl  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Stefan Kaltenbrunner <stefan@kaltenbrunner.cc> 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
createdb pl_regressioncreatelang pltcl pl_regressionpsql pl_regression

-- in another window, identify PID of connected backend, thenstrace -f -p PID 2>strace.out
psql> \i .../pltcl_setup.sqlpsql> \i .../pltcl_queries.sqlpsql> \q

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


pgsql-hackers by date:

Previous
From: Richard Troy
Date:
Subject: Re: DROP FUNCTION failure: cache lookup failed for relation
Next
From: Peter Eisentraut
Date:
Subject: Re: docbook question: how to center cell in tables ?