Re: weird buildfarm failures on arm/mipsel and --with-tcl

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: weird buildfarm failures on arm/mipsel and --with-tcl
Date: 2007-01-28 21:06:58
Message-ID: 22232.1170018418@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)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_regression
createlang pltcl pl_regression
psql 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
psql> \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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2007-01-28 21:22:12 Re: docbook question: how to center cell in tables ?
Previous Message Richard Troy 2007-01-28 20:44:46 Re: DROP FUNCTION failure: cache lookup failed for relation