Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id F260163407F for ; Sat, 23 Jan 2010 02:50:24 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 26710-03 for ; Sat, 23 Jan 2010 06:50:14 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 75454634046 for ; Sat, 23 Jan 2010 02:50:14 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o0N6oCVa002073; Sat, 23 Jan 2010 01:50:12 -0500 (EST) To: Kyle Bateman cc: pgsql-sql@postgresql.org Subject: Re: clock command regression in pltcl? In-reply-to: <1720.1264227988@sss.pgh.pa.us> References: <4B5A7E04.8030905@actarg.com> <1720.1264227988@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Sat, 23 Jan 2010 01:26:28 -0500" Date: Sat, 23 Jan 2010 01:50:12 -0500 Message-ID: <2072.1264229412@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201001/44 X-Sequence-Number: 33580 I wrote: > I am not sure if this is a bug or an intentional change on their part. > Apparently "clock" was completely rewritten in 8.5, with a lot more > features, which could mean it's not safe anymore. But I don't see > any explicit acknowledgement in the release notes that it's now > considered unsafe. Oh, this is interesting: tclInterp.c's SlaveCreate() has a special purpose hack now: /* * The [clock] command presents a safe API, but uses unsafe features in * its implementation. This means it has to be implemented in safe interps * as an alias to a version in the (trusted) master. */ if (safe) { Tcl_Obj *clockObj; int status; TclNewLiteralStringObj(clockObj, "clock"); Tcl_IncrRefCount(clockObj); status = AliasCreate(interp, slaveInterp, masterInterp, clockObj, clockObj, 0, NULL); Tcl_DecrRefCount(clockObj); if (status != TCL_OK) { goto error2; } } So apparently it's still *supposed* to work, but there's something about the way we are using tcl that makes it not work. Any tcl experts in the house? regards, tom lane