From rivetxtaylor@example.net Fri May 01 16:08:08 2009 Return-Path: <rivetxtaylor@example.net> Delivered-To: xtaylor@example.net Received: (qmail 32965 invoked from network); 1 May 2009 16:08:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 May 2009 16:08:08 -0000 Received: (qmail 88091 invoked by uid 500); 1 May 2009 16:08:08 -0000 Delivered-To: xtaylor@example.net Received: (qmail 88059 invoked by uid 500); 1 May 2009 16:08:08 -0000 Mailing-List: contact xtaylor@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:xtaylor@example.net> List-Unsubscribe: <mailto:xtaylor@example.net> List-Post: <mailto:xtaylor@example.net> List-Id: <rivet-dev.tcl.apache.org> Delivered-To: mailing list xtaylor@example.net Received: (qmail 88051 invoked by uid 99); 1 May 2009 16:08:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2009 16:08:07 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of xtaylor@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO yw-out-2324.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2009 16:07:59 +0000 Received: by yw-out-2324.google.com with SMTP id 3so1410597ywj.63 for <xtaylor@example.net>; Fri, 01 May 2009 09:07:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:cc:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=KeF6p7lBNSmw1XeVLpmhIR3J58WokiG1X4HlUBr4IQU=; b=Q5NC18etpX4cahaDcmq0pyA6g55Zb0srH8VA4TOJWpqdgORs2phDkK9KwhNqM7AEEN bC0M8nT3lArPOMSUvBiiFqwHmHZQ7KBw3M1YHpSkZe2nmLEryCqwXKr2JHt7gw8JUc3Z j3MRsSGuQDY6VLnmkLKf7Y08ZlGKgAgO6tsp8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=JZF+VSQFuFIkt2V+hEp06pTe2eC93mK+VjQB4ohbkeIRYOYSGkkGavdiKDPDNMwUwc JmJ05M7eDQnMO8n0tSmbcwlN+6OGc7X1I0NZRNkcm1W8rI/qSGdXIBv/ZkPrQGjvCWRq FwhhrSAcVOO3DObCtq5oEHCMQLEZwLb1LUpMs= Received: by 83.161.120.155 with SMTP id t1mr9078agb.45.1241194059106; Fri, 01 May 2009 09:07:39 -0700 (PDT) Received: from karl.gwp.corp.flightaware.com (natpool.gwp.corp.flightaware.com [83.161.120.155]) by mx.google.com with ESMTPS id 9sm5680207agb.35.283.161.120.155.07.37 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 01 May 2009 09:07:38 -0700 (PDT) Cc: xtaylor@example.net Message-Id: <xtaylor@example.net> From: Karl Lehenbauer <xtaylor@example.net> To: Massimo Manghi <xtaylor@example.net> In-Reply-To: <xtaylor@example.net> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Subject: Re: apache_table command for Rivet access to notes table Date: Fri, 1 May 2009 11:07:36 -0500 References: <xtaylor@example.net> <xtaylor@example.net> X-Mailer: Apple Mail (2.930.3) X-Virus-Checked: Checked by ClamAV on apache.org So you would prefer for it to work like an array? Have an "apache_table exists tableName key" and make "apache_table get tableName key" force an error ? On Apr 29, 2009, at 4:13 AM, Massimo Manghi wrote: > The syntax you have depicted here seems to be a very natural > approach to > the problem: easy to read and easy to use. This command has to > signal a few > potential error conditions though: table-key-value not existing, but > also more specifically > improper table names or not existing key in a valid table. > > I welcomed the new 'try/catch/finally' construct recently > introduced for > Tcl8.6. I wonder if it's possible to adopt a style for raising > errors that might > encourage the programmer to exploit it. Personally I don't like the > idea of checking > for an empty string in order to understand if a key-value pair > exists (but i'm sure long > time Tcl programmers will shrug at my attitude) > > -- Massimo > > > Karl Lehenbauer wrote: >> Hi Guys, >> >> I last brought this up a little over a year ago and other >> priorities intervened but I have now implemented an "apache_table" >> command and I want to get y'alls' feedback on it. >> >> apache_table as currently implemented provides read/write access to >> four tables in Apache: notes, headers_in, headers_out, >> err_headers_out and subprocess_env. >> >> Here's the syntax of the command: >> >> apache_table get tableName key >> >> returns the value of the specified key or an empty string >> >> apache_table set tableName keyValueList >> apache_table set tableName key value >> >> In the first case, takes zero or more key-value pairs in >> keyValueList and sets each key in the table with its corresponding >> value. >> >> In the second case, takes one key and one value and sets that >> key and value into the specified table. >> >> apache_table unset tableName key >> >> Unsets the specified key-value pair from the table. It is not >> an error to unset a key that doesn't exist. >> >> apache_table names tableName >> >> Returns a list of all the keys in the specified table. >> >> apache_table array_get tableName >> >> Returns the key-value pairs of the specified table as a list, >> suitable for array set. For instance: >> >> array set notes [apache_table array_get notes] >> >> apache_table clear tableName >> >> Invokes apr_table_clear to clear the contents of the specfied >> table. >> >> I think the above syntax is pretty reasonable. The part that's >> questionable is providing access to headers_in, headers_out, >> err_headers_out and subprocess_env. I know we already have a >> mechanism for access to subprocess_env and would be more than >> willing to remove any or all of these, or potentially add access to >> other tables, although I'm not aware of other tables that would be >> candidates. >> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: xtaylor@example.net >> For additional commands, e-mail: xtaylor@example.net >> > --------------------------------------------------------------------- To unsubscribe, e-mail: xtaylor@example.net For additional commands, e-mail: xtaylor@example.net From rivetxtaylor@example.net Fri May 01 16:16:53 2009 Return-Path: <rivetxtaylor@example.net> Delivered-To: xtaylor@example.net Received: (qmail 37200 invoked from network); 1 May 2009 16:16:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 May 2009 16:16:53 -0000 Received: (qmail 9587 invoked by uid 500); 1 May 2009 16:16:53 -0000 Delivered-To: xtaylor@example.net Received: (qmail 9568 invoked by uid 500); 1 May 2009 16:16:53 -0000 Mailing-List: contact xtaylor@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:xtaylor@example.net> List-Unsubscribe: <mailto:xtaylor@example.net> List-Post: <mailto:xtaylor@example.net> List-Id: <rivet-dev.tcl.apache.org> Delivered-To: mailing list xtaylor@example.net Received: (qmail 9560 invoked by uid 99); 1 May 2009 16:16:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2009 16:16:53 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of xtaylor@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO yx-out-2324.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2009 16:16:45 +0000 Received: by yx-out-2324.google.com with SMTP id 8so1419392yxm.63 for <xtaylor@example.net>; Fri, 01 May 2009 09:16:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :content-type:content-transfer-encoding:mime-version:subject:date :x-mailer; bh=QXXnINW9vMYrC+TTMeYuSLRrRJXLrzk4wHyVwvpP8eI=; b=cGMuXMT9BFo1WMiTbvjeoUT/gsQkV0DlzBAxYusfx0ETLtpZFMnUyI7xbyUsocAKCg yQp4lmLXcgxFaoAxObTpWtJb4h3DEhBeQZzD+nVwmXbAmW/bPJlrYZCx50F5n6RoBBqc bBPIH6GAjm4Bk+NbjYisw+ahgDnysINqcSy28= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:content-type:content-transfer-encoding :mime-version:subject:date:x-mailer; b=SlcrQbCHNpH84Tj1LFU/AWkT1S8TzDgCsIkMh8ZEmFGtU78Id2VyrKAP4zTjwIkj3C Db7ltzCYxiIIGqIyj0eCGUjzXOBlt7Ig1c4AHWRkolxp+Z2z5I8JJzsSbCUnHXMIZlCG jIGl4Skp+lrri6Gx/5I4/FTwSgrBsdAehITmU= Received: by 83.161.120.155 with SMTP id h2mr2008192agb.97.1241194584696; Fri, 01 May 2009 09:16:24 -0700 (PDT) Received: from karl.gwp.corp.flightaware.com (natpool.gwp.corp.flightaware.com [83.161.120.155]) by mx.google.com with ESMTPS id 36sm5712128aga.14.283.161.120.155.16.23 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 01 May 2009 09:16:24 -0700 (PDT) Message-Id: <xtaylor@example.net> From: Karl Lehenbauer <xtaylor@example.net> To: xtaylor@example.net Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Subject: interpreter-per-vhost problem; Rivet_Panic problem Date: Fri, 1 May 2009 11:16:22 -0500 X-Mailer: Apple Mail (2.930.3) X-Virus-Checked: Checked by ClamAV on apache.org I'm trying to turn on SeparateVirtualInterps and getting a coredump. Debugging that. Getting a Tcl_Panic that's calling out to Rivet_Panic due to attempt to append to a shared object. The Rivet_Panic is coredumping because it's dereferencing globalrr, which is null because it hasn't served a request yet. I think the init stuff needs to set a global server rec pointer but am looking at what it would use for a pool. Anyway this needs to be fixed so that panics in module initialization will cause error messages rather than coredumps. I expect to have something soon. --------------------------------------------------------------------- To unsubscribe, e-mail: xtaylor@example.net For additional commands, e-mail: xtaylor@example.net From xtaylor@example.net Fri May 01 17:27:57 2009 Return-Path: <xtaylor@example.net> Delivered-To: xtaylor@example.net Received: (qmail 73421 invoked from network); 1 May 2009 17:27:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 May 2009 17:27:57 -0000 Received: (qmail 50688 invoked by uid 500); 1 May 2009 17:27:57 -0000 Delivered-To: xtaylor@example.net Received: (qmail 50674 invoked by uid 500); 1 May 2009 17:27:57 -0000 Mailing-List: contact xtaylor@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:xtaylor@example.net> List-Unsubscribe: <mailto:xtaylor@example.net> List-Post: <mailto:xtaylor@example.net> List-Id: <rivet-cvs.tcl.apache.org> Delivered-To: mailing list xtaylor@example.net Received: (qmail 50665 invoked by uid 99); 1 May 2009 17:27:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2009 17:27:57 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2009 17:27:56 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 1201923888CA; Fri, 1 May 2009 17:27:36 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r770765 - in /tcl/rivet/trunk: ChangeLog src/apache-2/mod_rivet.c Date: Fri, 01 May 2009 17:27:35 -0000 To: xtaylor@example.net From: xtaylor@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <xtaylor@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: karl Date: Fri May 1 17:27:35 2009 New Revision: 770765 URL: http://svn.apache.org/viewvc?rev=770765&view=rev Log: * Rename global request rec pointer from globalrr to rivet_panic_request_rec, add rivet_panic_pool and rivet_panic_server_rec, grabbing those values from Rivet initialization rather than request handling so that they are initialized enough that Rivet_Panic can use them. (Previously Rivet_Panic or Tcl_Panic at initialization time caused a null-pointer-dereference segmentation violation because no request was being served. In Rivet_Panic, avoid emitting the unparsed URI unless a request is being processed. Modified: tcl/rivet/trunk/ChangeLog tcl/rivet/trunk/src/apache-2/mod_rivet.c Modified: tcl/rivet/trunk/ChangeLog URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/ChangeLog?rev=770765&r1=770764&r2=770765&view=diff ============================================================================== --- tcl/rivet/trunk/ChangeLog (original) +++ tcl/rivet/trunk/ChangeLog Fri May 1 17:27:35 2009 @@ -1,3 +1,15 @@ +2009-05-01 Karl Lehenbauer <xtaylor@example.net> + * Rename global request rec pointer from globalrr to + rivet_panic_request_rec, add rivet_panic_pool and + rivet_panic_server_rec, grabbing those values from Rivet initialization + rather than request handling so that they are initialized enough that + Rivet_Panic can use them. (Previously Rivet_Panic or Tcl_Panic at + initialization time caused a null-pointer-dereference segmentation + violation because no request was being served. + + In Rivet_Panic, avoid emitting the unparsed URI unless a request is + being processed. + 2009-04-27 Karl Lehenbauer <xtaylor@example.net> * src/apache-2/mod_rivet.c: In Rivet_SendContent, when checking to see Modified: tcl/rivet/trunk/src/apache-2/mod_rivet.c URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/apache-2/mod_rivet.c?rev=770765&r1=770764&r2=770765&view=diff ============================================================================== --- tcl/rivet/trunk/src/apache-2/mod_rivet.c (original) +++ tcl/rivet/trunk/src/apache-2/mod_rivet.c Fri May 1 17:27:35 2009 @@ -58,7 +58,9 @@ //module AP_MODULE_DECLARE_DATA rivet_module; /* This is used *only* in the PanicProc. Otherwise, don't touch it! */ -static request_rec *globalrr; +static request_rec *rivet_panic_request_rec = NULL; +static apr_pool_t *rivet_panic_pool = NULL; +static server_rec *rivet_panic_server_rec = NULL; /* Need some arbitrary non-NULL pointer which can't also be a request_rec */ #define NESTED_INCLUDE_MAGIC (&rivet_module) @@ -1071,6 +1073,9 @@ Rivet_InitHandler(apr_pool_t *pPool, apr_pool_t *pLog, apr_pool_t *pTemp, server_rec *s) { + rivet_panic_pool = pPool; + rivet_panic_server_rec = s; + #if RIVET_DISPLAY_VERSION ap_add_version_component(pPool, RIVET_PACKAGE_NAME"/"RIVET_PACKAGE_VERSION); #else @@ -1216,10 +1221,17 @@ char *format; format = (char *) TCL_VARARGS_START(char *,arg1,argList); - buf = (char *) apr_pvsprintf(globalrr->pool, format, argList); - ap_log_error(APLOG_MARK, APLOG_CRIT, APR_EGENERAL, globalrr->server, - "Critical error in request: %s", globalrr->unparsed_uri); - ap_log_error(APLOG_MARK, APLOG_CRIT, APR_EGENERAL, globalrr->server, buf); + buf = (char *) apr_pvsprintf(rivet_panic_pool, format, argList); + + if (rivet_panic_request_rec != NULL) { + ap_log_error(APLOG_MARK, APLOG_CRIT, APR_EGENERAL, + rivet_panic_server_rec, + "Critical error in request: %s", + rivet_panic_request_rec->unparsed_uri); + } + + ap_log_error(APLOG_MARK, APLOG_CRIT, APR_EGENERAL, + rivet_panic_server_rec, buf); abort(); } @@ -1467,6 +1479,8 @@ static void Rivet_ChildInit(apr_pool_t *pChild, server_rec *s) { + ap_assert (s != (server_rec *)NULL); + Rivet_InitTclStuff(s, pChild); Rivet_ChildHandlers(s, 1); @@ -1501,7 +1515,7 @@ /* Set the global request req to know what we are dealing with in * case we have to call the PanicProc. */ - globalrr = r; + rivet_panic_request_rec = r; rsc = Rivet_GetConf(r); interp = rsc->server_interp; --------------------------------------------------------------------- To unsubscribe, e-mail: xtaylor@example.net For additional commands, e-mail: xtaylor@example.net From rivetxtaylor@example.net Sat May 02 15:13:52 2009 Return-Path: <rivetxtaylor@example.net> Delivered-To: xtaylor@example.net Received: (qmail 27880 invoked from network); 2 May 2009 15:13:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 May 2009 15:13:51 -0000 Received: (qmail 8144 invoked by uid 500); 2 May 2009 15:13:51 -0000 Delivered-To: xtaylor@example.net Received: (qmail 8094 invoked by uid 500); 2 May 2009 15:13:51 -0000 Mailing-List: contact xtaylor@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:xtaylor@example.net> List-Unsubscribe: <mailto:xtaylor@example.net> List-Post: <mailto:xtaylor@example.net> List-Id: <rivet-dev.tcl.apache.org> Delivered-To: mailing list xtaylor@example.net Received: (qmail 8086 invoked by uid 99); 2 May 2009 15:13:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 May 2009 15:13:51 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO julesv.cce.unipr.it) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 May 2009 15:13:41 +0000 Received: from posta.unipr.it (ipruniv.cce.unipr.it [83.161.120.155]) by julesv.cce.unipr.it (8.13.8/8.13.8) with ESMTP id n42FCcTw004687; Sat, 2 May 2009 17:12:38 +0200 From: "Massimo Manghi" <xtaylor@example.net> To: Karl Lehenbauer <xtaylor@example.net>, Massimo Manghi <xtaylor@example.net> Cc: xtaylor@example.net Subject: Re: apache_table command for Rivet access to notes table Date: Sat, 2 May 2009 17:16:14 +0200 Message-Id: <xtaylor@example.net> In-Reply-To: <xtaylor@example.net> References: <xtaylor@example.net> <xtaylor@example.net> <xtaylor@example.net> X-Mailer: OpenWebMail 2.53 X-OriginatingIP: 83.161.120.155 (manghi) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-CCE-UniPR-MailScanner-Information: CCE X-MailScanner-ID: n42FCcTw004687 X-CCE-UniPR-Juv-MailScanner: Found to be clean X-CCE-UniPR-Juv-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-4.399, required 6, autolearn=not spam, ALL_TRUSTED -1.80, BAYES_00 -2.60) X-CCE-UniPR-MailScanner-From: xtaylor@example.net X-Virus-Checked: Checked by ClamAV on apache.org On Fri, 1 May 2009 11:07:36 -0500, Karl Lehenbauer wrote > So you would prefer for it to work like an array? Have an > "apache_table exists tableName key" and make "apache_table get > tableName key" force an error ? > in a word: yes. -- Massimo --------------------------------------------------------------------- To unsubscribe, e-mail: xtaylor@example.net For additional commands, e-mail: xtaylor@example.net From rivetxtaylor@example.net Sat May 02 21:26:41 2009 Return-Path: <rivetxtaylor@example.net> Delivered-To: xtaylor@example.net Received: (qmail 9197 invoked from network); 2 May 2009 21:26:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 May 2009 21:26:41 -0000 Received: (qmail 10536 invoked by uid 500); 2 May 2009 21:26:41 -0000 Delivered-To: xtaylor@example.net Received: (qmail 10491 invoked by uid 500); 2 May 2009 21:26:41 -0000 Mailing-List: contact xtaylor@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:xtaylor@example.net> List-Unsubscribe: <mailto:xtaylor@example.net> List-Post: <mailto:xtaylor@example.net> List-Id: <rivet-dev.tcl.apache.org> Delivered-To: mailing list xtaylor@example.net Received: (qmail 10480 invoked by uid 99); 2 May 2009 21:26:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 May 2009 21:26:41 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of xtaylor@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO an-out-0708.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 May 2009 21:26:32 +0000 Received: by an-out-0708.google.com with SMTP id d11so1886227and.18 for <xtaylor@example.net>; Sat, 02 May 2009 14:26:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:cc:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=8felhemiq3kOCntXdHjYVPPZ9qAYKXlwqI0vCyy9F8w=; b=XTrHucmj04nQo52dVm6B6P2Hsq7rFtsHiiz5VNYU/TbqXn1ZpKxhZqYAZA/VMY75hV kqghtTGu8XavpiROvWk5R2P6kZ/xgFax3ClrB/GzfN59ODyZVq7mJA1IHdciko+l1BP/ HwEaBA0XOSb1Jl3oKKJnfLo5aWuU1/Vv/HrFo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=JnjbeJ7tVT4hMhEY+cBSEi77Lc5hB6tOGhd9Hmi5GxhZIbPd/VlE0ghO10qGPBGzW6 2pMFl96XSLtQmeUY4w1qpYdWjAXsG+clQp9m0piIec4q6R56nBPV1l4xEGRPcRe7UWJs sPA0cPOmKseYu9gqFBvKqzJRR8GMPrIB4V45E= Received: by 83.161.120.155 with SMTP id 4mr8931726anh.146.1241299570885; Sat, 02 May 2009 14:26:10 -0700 (PDT) Received: from 152.sub-70-196-12.myvzw.com (152.sub-70-196-12.myvzw.com [83.161.120.155]) by mx.google.com with ESMTPS id 6sm12085021ywp.14.283.161.120.155.26.09 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 02 May 2009 14:26:10 -0700 (PDT) Cc: xtaylor@example.net Message-Id: <xtaylor@example.net> From: Karl Lehenbauer <xtaylor@example.net> To: Massimo Manghi <xtaylor@example.net> In-Reply-To: <xtaylor@example.net> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Subject: Re: apache_table command for Rivet access to notes table Date: Sat, 2 May 2009 16:26:04 -0500 References: <xtaylor@example.net> <xtaylor@example.net> <xtaylor@example.net> <xtaylor@example.net> X-Mailer: Apple Mail (2.930.3) X-Virus-Checked: Checked by ClamAV on apache.org On May 2, 2009, at 10:16 AM, Massimo Manghi wrote: > On Fri, 1 May 2009 11:07:36 -0500, Karl Lehenbauer wrote >> So you would prefer for it to work like an array? Have an >> "apache_table exists tableName key" and make "apache_table get >> tableName key" force an error ? >> > > in a word: yes. How about if "get" still returns an empty string when the key doesn't exist but I implement "exists" for people who want to clearly distinguish between missing and empty? I also considered adding an optional argument to "get" of a variable name to load with the value and having it return 1 or 0 on whether or not the key exists... if {[apache_table get notes key valueVar]} { } ...but it seems like overkill. -karl PS - As an aside, Tcl arrays should have a settable default, "array default arrayName 0" would be cool, although newer incr will instantiate a nonexistent variable at 0. Also there should be something like "array foreach arrayName var code". --------------------------------------------------------------------- To unsubscribe, e-mail: xtaylor@example.net For additional commands, e-mail: xtaylor@example.net From xtaylor@example.net Tue May 05 18:39:38 2009 Return-Path: <xtaylor@example.net> Delivered-To: xtaylor@example.net Received: (qmail 10669 invoked from network); 5 May 2009 18:39:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 5 May 2009 18:39:38 -0000 Received: (qmail 56753 invoked by uid 500); 5 May 2009 18:39:38 -0000 Delivered-To: xtaylor@example.net Received: (qmail 56733 invoked by uid 500); 5 May 2009 18:39:38 -0000 Mailing-List: contact xtaylor@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:xtaylor@example.net> List-Unsubscribe: <mailto:xtaylor@example.net> List-Post: <mailto:xtaylor@example.net> List-Id: <rivet-cvs.tcl.apache.org> Delivered-To: mailing list xtaylor@example.net Received: (qmail 56724 invoked by uid 99); 5 May 2009 18:39:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 May 2009 18:39:38 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 May 2009 18:39:35 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id CF5732388920; Tue, 5 May 2009 18:38:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r771956 - in /tcl/rivet/trunk: ChangeLog src/TclWeb.h src/apache-2/rivetCore.c Date: Tue, 05 May 2009 18:38:43 -0000 To: xtaylor@example.net From: xtaylor@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <xtaylor@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: karl Date: Tue May 5 18:38:42 2009 New Revision: 771956 URL: http://svn.apache.org/viewvc?rev=771956&view=rev Log: * Add new Rivet Tcl command,apache_table, which can query, get and set values in the Apache "notes", "headers_in", "headers_out", "err_headers_out" and "subprocess_env" tables. * Add new "upload" option "tempname" that'll return the name of the temporary file containing the upload. Modified: tcl/rivet/trunk/ChangeLog tcl/rivet/trunk/src/TclWeb.h tcl/rivet/trunk/src/apache-2/rivetCore.c Modified: tcl/rivet/trunk/ChangeLog URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/ChangeLog?rev=771956&r1=771955&r2=771956&view=diff ============================================================================== --- tcl/rivet/trunk/ChangeLog (original) +++ tcl/rivet/trunk/ChangeLog Tue May 5 18:38:42 2009 @@ -1,3 +1,11 @@ +2009-05-05 Karl Lehenbauer <xtaylor@example.net> + * Add new Rivet Tcl command,apache_table, which can query, get and set + values in the Apache "notes", "headers_in", "headers_out", + "err_headers_out" and "subprocess_env" tables. + + * Add new "upload" option "tempname" that'll return the name of the + temporary file containing the upload. + 2009-05-01 Karl Lehenbauer <xtaylor@example.net> * Rename global request rec pointer from globalrr to rivet_panic_request_rec, add rivet_panic_pool and Modified: tcl/rivet/trunk/src/TclWeb.h URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/TclWeb.h?rev=771956&r1=771955&r2=771956&view=diff ============================================================================== --- tcl/rivet/trunk/src/TclWeb.h (original) +++ tcl/rivet/trunk/src/TclWeb.h Tue May 5 18:38:42 2009 @@ -223,6 +223,22 @@ /* *----------------------------------------------------------------------------- * + * TclWeb_UploadTempname -- + * + * Get the name of the temp file the uploaded data was stored in. + * + * Results: + * + * Stores the temp name in 'tempname'. + * + *----------------------------------------------------------------------------- + */ + +int TclWeb_UploadTempname(Tcl_Obj *tempname, TclWebRequest *req); + +/* + *----------------------------------------------------------------------------- + * * TclWeb_UploadNames -- * * Fetch names of all the uploaded variables. Modified: tcl/rivet/trunk/src/apache-2/rivetCore.c URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/apache-2/rivetCore.c?rev=771956&r1=771955&r2=771956&view=diff ============================================================================== --- tcl/rivet/trunk/src/apache-2/rivetCore.c (original) +++ tcl/rivet/trunk/src/apache-2/rivetCore.c Tue May 5 18:38:42 2009 @@ -540,6 +540,251 @@ /* */ +static int append_key_callback (void *data, const char *key, const char *val) +{ + Tcl_Obj *list = data; + + Tcl_ListObjAppendElement (NULL, list, Tcl_NewStringObj (key, -1)); + return 1; +} + +static int +append_key_value_callback (void *data, const char *key, const char *val) +{ + Tcl_Obj *list = data; + + Tcl_ListObjAppendElement (NULL, list, Tcl_NewStringObj (key, -1)); + Tcl_ListObjAppendElement (NULL, list, Tcl_NewStringObj (val, -1)); + return 1; +} + +/* + *----------------------------------------------------------------------------- + * + * Rivet_ApacheTable -- + * + * Deals with Rivet key-value tables in the request structure + * + * apache_table get tablename key + * apache_table set tablename key value + * apache_table exists tablename key + * apache_table unset tablename key + * apache_table list tablename + * + * Results: + * A standard Tcl result. + * + * Side Effects: + * + *----------------------------------------------------------------------------- + */ + +TCL_CMD_HEADER( Rivet_ApacheTable ) +{ + apr_table_t *table; + int subcommandindex; + + static CONST84 char *SubCommand[] = { + "get", + "set", + "exists", + "unset", + "names", + "array_get", + "clear", + NULL + }; + + enum subcommand { + SUB_GET, + SUB_SET, + SUB_EXISTS, + SUB_UNSET, + SUB_NAMES, + SUB_ARRAY_GET, + SUB_CLEAR + }; + + static CONST84 char *tableNames[] = { + "notes", + "headers_in", + "headers_out", + "err_headers_out", + "subprocess_env", + NULL + }; + + int tableindex; + + enum tablename { + TABLE_NOTES, + TABLE_HEADERS_IN, + TABLE_HEADERS_OUT, + TABLE_ERR_HEADERS_OUT, + TABLE_SUBPROCESS_ENV + }; + + rivet_interp_globals *globals = Tcl_GetAssocData(interp, "rivet", NULL); + + if ((objc < 3) || (objc > 5)) { + Tcl_WrongNumArgs(interp, 1, objv, "option tablename ?args?"); + return TCL_ERROR; + } + + if (Tcl_GetIndexFromObj(interp, objv[1], SubCommand, + "get|set|unset|list", + 0, &subcommandindex) == TCL_ERROR) { + return TCL_ERROR; + } + + if (Tcl_GetIndexFromObj (interp, objv[2], tableNames, + "notes|headers_in|headers_out|err_header_out|subprocess_env", + 0, &tableindex) == TCL_ERROR) { + return TCL_ERROR; + } + + switch ((enum tablename)tableindex) + { + case TABLE_NOTES: { + table = globals->r->notes; + break; + } + + case TABLE_HEADERS_IN: { + table = globals->r->headers_in; + break; + } + + case TABLE_HEADERS_OUT: { + table = globals->r->headers_out; + break; + } + + case TABLE_ERR_HEADERS_OUT: { + table = globals->r->err_headers_out; + break; + } + + case TABLE_SUBPROCESS_ENV: { + table = globals->r->subprocess_env; + break; + } + } + + switch ((enum subcommand)subcommandindex) + { + case SUB_GET: { + const char *key; + const char *value; + + if (objc != 4) { + Tcl_WrongNumArgs(interp, 2, objv, "tablename key"); + return TCL_ERROR; + } + + key = Tcl_GetString (objv[3]); + value = apr_table_get (table, key); + + if (value != NULL) { + Tcl_SetObjResult (interp, Tcl_NewStringObj (value, -1)); + } + break; + } + + case SUB_EXISTS: { + const char *key; + const char *value; + + if (objc != 4) { + Tcl_WrongNumArgs(interp, 2, objv, "tablename key"); + return TCL_ERROR; + } + + key = Tcl_GetString (objv[3]); + value = apr_table_get (table, key); + + Tcl_SetObjResult (interp, Tcl_NewBooleanObj (value != NULL)); + break; + } + + + case SUB_SET: { + int i; + char *key; + char *value; + + if (objc == 4) { + int listObjc; + Tcl_Obj **listObjv; + + if (Tcl_ListObjGetElements (interp, objv[3], &listObjc, &listObjv) == TCL_ERROR) { + return TCL_ERROR; + } + + if (listObjc % 2 == 1) { + Tcl_SetObjResult (interp, Tcl_NewStringObj ("list must have even number of elements", -1)); + return TCL_ERROR; + } + + for (i = 0; i < listObjc; i += 2) { + apr_table_set (table, Tcl_GetString (listObjv[i]), Tcl_GetString (listObjv[i+1])); + } + + break; + } + + if (objc != 5) { + Tcl_WrongNumArgs(interp, 2, objv, "tablename key value"); + return TCL_ERROR; + } + + key = Tcl_GetString (objv[3]); + value = Tcl_GetString (objv[4]); + + apr_table_set (table, key, value); + break; + } + + case SUB_UNSET: { + char *key; + + if (objc != 4) { + Tcl_WrongNumArgs(interp, 2, objv, "tablename key"); + return TCL_ERROR; + } + + key = Tcl_GetString (objv[3]); + apr_table_unset (table, key); + break; + } + + case SUB_NAMES: { + Tcl_Obj *list = Tcl_NewObj (); + + apr_table_do(append_key_callback, (void*)list, table, NULL); + + Tcl_SetObjResult (interp, list); + break; + } + + case SUB_ARRAY_GET: { + Tcl_Obj *list = Tcl_NewObj (); + + apr_table_do(append_key_value_callback, (void*)list, table, NULL); + + Tcl_SetObjResult (interp, list); + break; + } + + case SUB_CLEAR: { + apr_table_clear (table); + } + } + + return TCL_OK; +} + + /* *----------------------------------------------------------------------------- * @@ -583,6 +828,7 @@ "size", "type", "filename", + "tempname", "names", "tempname", NULL @@ -602,9 +848,12 @@ rivet_interp_globals *globals = Tcl_GetAssocData(interp, "rivet", NULL); command = Tcl_GetString(objv[1]); - Tcl_GetIndexFromObj(interp, objv[1], SubCommand, - "channel|save|data|exists|size|type|filename|names|tempname", - 0, &subcommandindex); + if (Tcl_GetIndexFromObj(interp, objv[1], SubCommand, + "channel|save|data|exists|size|type|filename|names|tempname" + "|tempname|names", + 0, &subcommandindex) == TCL_ERROR) { + return TCL_ERROR; + } /* If it's any of these, we need to find a specific name. */ @@ -958,6 +1207,11 @@ NULL, (Tcl_CmdDeleteProc *)NULL); Tcl_CreateObjCommand(interp, + "apache_table", + Rivet_ApacheTable, + NULL, + (Tcl_CmdDeleteProc *)NULL); + Tcl_CreateObjCommand(interp, "var_qs", Rivet_Var, NULL, --------------------------------------------------------------------- To unsubscribe, e-mail: xtaylor@example.net For additional commands, e-mail: xtaylor@example.net From xtaylor@example.net Tue May 05 18:46:24 2009 Return-Path: <xtaylor@example.net> Delivered-To: xtaylor@example.net Received: (qmail 12279 invoked from network); 5 May 2009 18:46:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 5 May 2009 18:46:24 -0000 Received: (qmail 71470 invoked by uid 500); 5 May 2009 18:46:24 -0000 Delivered-To: xtaylor@example.net Received: (qmail 71454 invoked by uid 500); 5 May 2009 18:46:24 -0000 Mailing-List: contact xtaylor@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:xtaylor@example.net> List-Unsubscribe: <mailto:xtaylor@example.net> List-Post: <mailto:xtaylor@example.net> List-Id: <rivet-cvs.tcl.apache.org> Delivered-To: mailing list xtaylor@example.net Received: (qmail 71445 invoked by uid 99); 5 May 2009 18:46:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 May 2009 18:46:24 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 May 2009 18:46:22 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 5F2222388920; Tue, 5 May 2009 18:46:01 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r771960 - in /tcl/rivet/trunk: ChangeLog src/apache-2/mod_rivet.c Date: Tue, 05 May 2009 18:46:00 -0000 To: xtaylor@example.net From: xtaylor@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <xtaylor@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: karl Date: Tue May 5 18:45:59 2009 New Revision: 771960 URL: http://svn.apache.org/viewvc?rev=771960&view=rev Log: * When instantiating separate virtual interpreters, postpend an interpreter count to the self-created slave interpreter name, to keep Tcl_CreateSlave from failing if two or more virtual hosts have the same ServerName and don't have a port defined in the ServerName directive. * Detect and report failure of Tcl_CreateSlave rather than assuming it succeeded and dereferencing a null pointer when it didn't. Also added asserts to detect null interpreter pointer. * Slightly improved error messages when a child init or exit function fails. Modified: tcl/rivet/trunk/ChangeLog tcl/rivet/trunk/src/apache-2/mod_rivet.c Modified: tcl/rivet/trunk/ChangeLog URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/ChangeLog?rev=771960&r1=771959&r2=771960&view=diff ============================================================================== --- tcl/rivet/trunk/ChangeLog (original) +++ tcl/rivet/trunk/ChangeLog Tue May 5 18:45:59 2009 @@ -6,6 +6,18 @@ * Add new "upload" option "tempname" that'll return the name of the temporary file containing the upload. + * When instantiating separate virtual interpreters, postpend an interpreter + count to the self-created slave interpreter name, to keep + Tcl_CreateSlave from failing if two or more virtual hosts have the same + ServerName and don't have a port defined in the ServerName directive. + + * Detect and report failure of Tcl_CreateSlave rather than assuming it + succeeded and dereferencing a null pointer when it didn't. Also added + asserts to detect null interpreter pointer. + + * Slightly improved error messages when a child init or exit function + fails. + 2009-05-01 Karl Lehenbauer <xtaylor@example.net> * Rename global request rec pointer from globalrr to rivet_panic_request_rec, add rivet_panic_pool and Modified: tcl/rivet/trunk/src/apache-2/mod_rivet.c URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/apache-2/mod_rivet.c?rev=771960&r1=771959&r2=771960&view=diff ============================================================================== --- tcl/rivet/trunk/src/apache-2/mod_rivet.c (original) +++ tcl/rivet/trunk/src/apache-2/mod_rivet.c Tue May 5 18:45:59 2009 @@ -836,6 +836,8 @@ Tcl_Interp *interp = rsc->server_interp; rivet_interp_globals *globals = NULL; + ap_assert (interp != (Tcl_Interp *)NULL); + /* Create TCL commands to deal with Apache's BUFFs. */ rsc->outchannel = apr_pcalloc(p, sizeof(Tcl_Channel)); *(rsc->outchannel) = Tcl_CreateChannel(&RivetChan, "apacheout", rsc, TCL_WRITABLE); @@ -1291,7 +1293,11 @@ if (Tcl_EvalObjEx(rsc->server_interp,function, 0) != TCL_OK) { ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, s, errmsg, Tcl_GetString(function)); - ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, s, "%s", + ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, s, + "errorCode: %s", + Tcl_GetVar(rsc->server_interp, "errorCode", 0)); + ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, s, + "errorInfo: %s", Tcl_GetVar(rsc->server_interp, "errorInfo", 0)); } @@ -1359,6 +1365,7 @@ rivet_server_conf *myrsc; server_rec *sr; extern int ap_max_requests_per_child; + int interpCount = 0; /* Initialize TCL stuff */ Tcl_FindExecutable(RIVET_NAMEOFEXECUTABLE); @@ -1417,8 +1424,7 @@ } } - sr = s; - while (sr) + for (sr = s; sr; sr = sr->next) { myrsc = RIVET_SERVER_CONF(sr->module_config); /* We only have a different rivet_server_conf if MergeConfig @@ -1435,12 +1441,20 @@ if (sr != s) /* not the first one */ { if (rsc->separate_virtual_interps != 0) { - char *slavename = (char*) apr_psprintf(p, "%s_%d", + char *slavename = (char*) apr_psprintf(p, "%s_%d_%d", sr->server_hostname, - sr->port); + sr->port, + interpCount++); + /* Separate virtual interps. */ myrsc->server_interp = Tcl_CreateSlave(interp, slavename, 0); + if (myrsc->server_interp == NULL) { + ap_log_error( APLOG_MARK, APLOG_ERR, APR_EGENERAL, s, + "slave interp create failed: %s", + Tcl_GetStringResult(interp) ); + exit(1); + } Rivet_PerInterpInit(s, myrsc, p); } else { myrsc->server_interp = rsc->server_interp; @@ -1454,8 +1468,6 @@ myrsc->objCacheList = rsc->objCacheList; } myrsc->server_name = (char*)apr_pstrdup(p, sr->server_hostname); - - sr = sr->next; } } --------------------------------------------------------------------- To unsubscribe, e-mail: xtaylor@example.net For additional commands, e-mail: xtaylor@example.net From rivetxtaylor@example.net Wed May 06 09:07:54 2009 Return-Path: <rivetxtaylor@example.net> Delivered-To: xtaylor@example.net Received: (qmail 94282 invoked from network); 6 May 2009 09:07:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 6 May 2009 09:07:53 -0000 Received: (qmail 73794 invoked by uid 500); 6 May 2009 09:07:53 -0000 Delivered-To: xtaylor@example.net Received: (qmail 73766 invoked by uid 500); 6 May 2009 09:07:53 -0000 Mailing-List: contact xtaylor@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:xtaylor@example.net> List-Unsubscribe: <mailto:xtaylor@example.net> List-Post: <mailto:xtaylor@example.net> List-Id: <rivet-dev.tcl.apache.org> Delivered-To: mailing list xtaylor@example.net Received: (qmail 73758 invoked by uid 99); 6 May 2009 09:07:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 09:07:53 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO nemo3.cce.unipr.it) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 09:07:43 +0000 Received: from pachelbel.biol.unipr.it (pachelbel.biol.unipr.it [83.161.120.155]) by nemo3.cce.unipr.it (8.13.8/8.13.8) with ESMTP id n4692m4r002919; Wed, 6 May 2009 11:02:48 +0200 Received: from [83.161.120.155] (localhost [83.161.120.155]) by pachelbel.biol.unipr.it (Postfix) with ESMTP id E78859922C; Wed, 6 May 2009 11:02:00 +0200 (CEST) Message-ID: <xtaylor@example.net> Date: Wed, 06 May 2009 11:02:00 +0200 From: Massimo Manghi <xtaylor@example.net> Organization: =?ISO-8859-1?Q?Universit=E0_di_Parma?= User-Agent: Mozilla-Thunderbird 83.161.120.155 (X11/20090103) MIME-Version: 1.0 To: Karl Lehenbauer <xtaylor@example.net> CC: xtaylor@example.net Subject: Re: apache_table command for Rivet access to notes table References: <xtaylor@example.net> <xtaylor@example.net> <xtaylor@example.net> <xtaylor@example.net> <xtaylor@example.net> In-Reply-To: <xtaylor@example.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-CCE-UniPR-MailScanner-Information: CCE X-MailScanner-ID: n4692m4r002919 X-CCE-UniPR-Ne3-MailScanner: Found to be clean X-CCE-UniPR-Ne3-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-4.399, required 6, autolearn=not spam, ALL_TRUSTED -1.80, BAYES_00 -2.60) X-CCE-UniPR-MailScanner-From: xtaylor@example.net X-Virus-Checked: Checked by ClamAV on apache.org Karl Lehenbauer wrote: > How about if "get" still returns an empty string when the key doesn't > exist but I implement "exists" for people who want to clearly > distinguish between missing and empty? > it might work out a compromise. > I also considered adding an optional argument to "get" of a variable > name to load with the value and having it return 1 or 0 on whether or > not the key exists... > > if {[apache_table get notes key valueVar]} { > } > > ...but it seems like overkill. > what if 'apache_table get notes key' returns an error if 'key' is not existing or returns $valueVar if the last argument is present? if {[catch {apache_table get notes key} errcode]} { ... } if {[apache_table get notes key ""] == ""} { ... } this would enable us to use also defaults that are numbers... > -karl > > PS - As an aside, Tcl arrays should have a settable default, "array > default arrayName 0" would be cool, although newer incr will > instantiate a nonexistent variable at 0. Also there should be > something like "array foreach arrayName var code". > yes definitely. Will you bring up a proposal for this on Tclcore? -- Massimo --------------------------------------------------------------------- To unsubscribe, e-mail: xtaylor@example.net For additional commands, e-mail: xtaylor@example.net From rivetxtaylor@example.net Wed May 06 14:43:17 2009 Return-Path: <rivetxtaylor@example.net> Delivered-To: xtaylor@example.net Received: (qmail 51938 invoked from network); 6 May 2009 14:43:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 6 May 2009 14:43:17 -0000 Received: (qmail 98040 invoked by uid 500); 6 May 2009 14:43:17 -0000 Delivered-To: xtaylor@example.net Received: (qmail 97996 invoked by uid 500); 6 May 2009 14:43:17 -0000 Mailing-List: contact xtaylor@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:xtaylor@example.net> List-Unsubscribe: <mailto:xtaylor@example.net> List-Post: <mailto:xtaylor@example.net> List-Id: <rivet-dev.tcl.apache.org> Delivered-To: mailing list xtaylor@example.net Received: (qmail 97988 invoked by uid 99); 6 May 2009 14:43:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 14:43:17 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of xtaylor@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO yw-out-2324.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 14:43:08 +0000 Received: by yw-out-2324.google.com with SMTP id 3so70558ywj.63 for <xtaylor@example.net>; Wed, 06 May 2009 07:42:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :content-type:content-transfer-encoding:mime-version:subject:date :x-mailer; bh=cBcyKJ/J96KhyDMNAzUCvufYtFx9b8uPwcKWDcZlFGU=; b=BXFfEB6LDjcgQ+ssBm84fSbrbaYE0vDilHqfFs36NMAUX/XhYjMWNkFXIhz0bo9Dqq bxOOMFlhMqiBZdIs7Qi1u+vFZijXxwYdXp3lylYb4jxZn9h3MXfZPmn0IqOrTbD5+w2/ Qa/LKtnCybim80nCaJ2pqfTDULcBE9kL9CdS8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:content-type:content-transfer-encoding :mime-version:subject:date:x-mailer; b=qV0sPoXR14tMINqEexIuH1Hgk3QNSZ3Zpjhkl08rfS9JhS1JNNJZ0tPdiPeoyxSRYj 6eBb2GpIK8tPPy00qQ1MfnrH5KiCd+WQsgXLZ8ovM1kGVljs0CGmSwf2f9xbFL61VVW0 c/uqg1ZYHpYwhhosz2zYLvnr1uJFx9LKXwGwQ= Received: by 83.161.120.155 with SMTP id x6mr2985661ank.56.1241620967084; Wed, 06 May 2009 07:42:47 -0700 (PDT) Received: from karl.gwp.corp.flightaware.com (natpool.gwp.corp.flightaware.com [83.161.120.155]) by mx.google.com with ESMTPS id 7sm1653637agc.47.283.161.120.155.42.45 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 06 May 2009 07:42:46 -0700 (PDT) Message-Id: <xtaylor@example.net> From: Karl Lehenbauer <xtaylor@example.net> To: xtaylor@example.net Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Subject: coredumps on shutdown with separate virtual interps Date: Wed, 6 May 2009 09:42:43 -0500 X-Mailer: Apple Mail (2.930.3) X-Virus-Checked: Checked by ClamAV on apache.org Separate virtual interpreters are amazingly cool. Using them, fiddling with auto_path, and using git we're able to give each developer their own Rivet interpreters with a private library path that gets searched first, their own webpages, and so forth. It's great. But we're having a problem that when we do an apachectl stop all of the children that have served webpages dump core. The problem is that outputproc is getting called by the flush activities triggered by the call to Tcl_Finalize() as part of the shutdown. There isn't really a request structure so it quickly dereferences a null pointer and that triggers a coredump. Doing some debugging, I've determined that the Tcl channel that Rivet maps to Apache's ap_rwrite and such, its close routine is getting called prior to the attempt to flush this data. What's weird is that the data that it's trying to write is the same as the last webpage the child generated. I'm continuing to investigate because I want to know why it's happening, although it's also reasonable to make the closeproc set a "closed" flag that the outputproc would honor. The outputproc could also very easily detect that the request structure isn't real, but the big question is why is it getting called in the first place. I mention it here in the hopes that someone will have a flash of insight and/or knows the answer. Karl --------------------------------------------------------------------- To unsubscribe, e-mail: xtaylor@example.net For additional commands, e-mail: xtaylor@example.net From xtaylor@example.net Thu May 07 02:28:20 2009 Return-Path: <xtaylor@example.net> Delivered-To: xtaylor@example.net Received: (qmail 79537 invoked from network); 7 May 2009 02:28:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 7 May 2009 02:28:20 -0000 Received: (qmail 86641 invoked by uid 500); 7 May 2009 02:28:20 -0000 Delivered-To: xtaylor@example.net Received: (qmail 86625 invoked by uid 500); 7 May 2009 02:28:20 -0000 Mailing-List: contact xtaylor@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:xtaylor@example.net> List-Unsubscribe: <mailto:xtaylor@example.net> List-Post: <mailto:xtaylor@example.net> List-Id: <rivet-cvs.tcl.apache.org> Delivered-To: mailing list xtaylor@example.net Received: (qmail 86615 invoked by uid 99); 7 May 2009 02:28:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 May 2009 02:28:19 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 May 2009 02:28:18 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id C4BFC2388969; Thu, 7 May 2009 02:27:57 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r772488 - in /tcl/rivet/trunk: ChangeLog src/apache-1/mod_rivet.c src/apache-2/mod_rivet.c src/rivetChannel.c Date: Thu, 07 May 2009 02:27:57 -0000 To: xtaylor@example.net From: xtaylor@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <xtaylor@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: karl Date: Thu May 7 02:27:56 2009 New Revision: 772488 URL: http://svn.apache.org/viewvc?rev=772488&view=rev Log: * src/apache-2/mod_rivet.c: When Rivet was shutting down and per-vhost separate virtual interpreters were in use, the shutdown code deleted the master interpreter and all of the slave interpreters using Tcl_DepeteInterp(). This was an error as it should only delete the mater interpreter, as deleting the master interpreter causes its slaves to be deleted. It now does this. (Had it checked using Tcl_InterpDeleted to see if the interpreter was already marked as deleted, it probably would have been OK.) * src/rivetChannel.c - update Tcl channel handler to channel version 4. Modified: tcl/rivet/trunk/ChangeLog tcl/rivet/trunk/src/apache-1/mod_rivet.c tcl/rivet/trunk/src/apache-2/mod_rivet.c tcl/rivet/trunk/src/rivetChannel.c Modified: tcl/rivet/trunk/ChangeLog URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/ChangeLog?rev=772488&r1=772487&r2=772488&view=diff ============================================================================== --- tcl/rivet/trunk/ChangeLog (original) +++ tcl/rivet/trunk/ChangeLog Thu May 7 02:27:56 2009 @@ -1,4 +1,16 @@ 2009-05-05 Karl Lehenbauer <xtaylor@example.net> + * src/apache-2/mod_rivet.c: When Rivet is shutting down and per-vhost + separate virtual interpreters were in use, the shutdown code deleted + the master interpreter and all of the slave interpreters using + Tcl_DepeteInterp(). This was an error as it should only delete the + mater interpreter, as deleting the master interpreter causes its + slaves to be deleted. It now does this. (Had it checked using + Tcl_InterpDeleted to see if the interpreter was already marked as + deleted, it probably would have been OK.) + + * src/rivetChannel.c - update Tcl channel handler to channel version 4. + +2009-05-05 Karl Lehenbauer <xtaylor@example.net> * Add new Rivet Tcl command,apache_table, which can query, get and set values in the Apache "notes", "headers_in", "headers_out", "err_headers_out" and "subprocess_env" tables. Modified: tcl/rivet/trunk/src/apache-1/mod_rivet.c URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/apache-1/mod_rivet.c?rev=772488&r1=772487&r2=772488&view=diff ============================================================================== --- tcl/rivet/trunk/src/apache-1/mod_rivet.c (original) +++ tcl/rivet/trunk/src/apache-1/mod_rivet.c Thu May 7 02:27:56 2009 @@ -1466,17 +1466,21 @@ ap_log_error(APLOG_MARK, APLOG_ERR, s, "%s", Tcl_GetVar(rsc->server_interp, "errorInfo", 0)); } + } + sr = sr->next; - /* - * Upon child exit we delete each interpreter before the caller - * uses Tcl_Finalize - */ - - if (!init) { - Tcl_DeleteInterp(rsc->server_interp); + if (!init) { + /* + * Upon child exit we delete the master interpreter before the + * caller invokes Tcl_Finalize. Even if we're running separate + * virtual interpreters, we don't delete the slaves + * as deleting the master implicitly deltes its slave interpreters. + */ + rsc = RIVET_SERVER_CONF(s->module_config); + if (!Tcl_InterpDeleted (rsc->server_interp)) { + Tcl_DeleteInterp(rsc->server_interp); } } - sr = sr->next; } } Modified: tcl/rivet/trunk/src/apache-2/mod_rivet.c URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/apache-2/mod_rivet.c?rev=772488&r1=772487&r2=772488&view=diff ============================================================================== --- tcl/rivet/trunk/src/apache-2/mod_rivet.c (original) +++ tcl/rivet/trunk/src/apache-2/mod_rivet.c Thu May 7 02:27:56 2009 @@ -309,6 +309,7 @@ rivet_server_conf *conf = Rivet_GetConf(req); rivet_interp_globals *globals = Tcl_GetAssocData(interp, "rivet", NULL); + Tcl_Preserve (interp); if ( Tcl_EvalObjEx(interp, outbuf, 0) == TCL_ERROR ) { Tcl_Obj *errscript; Tcl_Obj *errorCodeListObj; @@ -380,6 +381,7 @@ } TclWeb_PrintHeaders(globals->req); Tcl_Flush(*(conf->outchannel)); + Tcl_Release(interp); return TCL_OK; } @@ -837,6 +839,7 @@ rivet_interp_globals *globals = NULL; ap_assert (interp != (Tcl_Interp *)NULL); + Tcl_Preserve (interp); /* Create TCL commands to deal with Apache's BUFFs. */ rsc->outchannel = apr_pcalloc(p, sizeof(Tcl_Channel)); @@ -863,7 +866,7 @@ * * This is the old call for setting up the tcl environment. * - * if (Tcl_PkgRequire(interp, "RivetTcl", "1.1", 1) == NULL) { + * if (Tcl_PkgRequire(interp, "RivetTcl", "1.1", 1) == NULL) * * We may revert to it if we can devise a mechanism that * links a specific installation to RivetTcl's version @@ -879,8 +882,10 @@ * won't send any result packets to the browser unless the Rivet * programmer does a "flush stdout" or the page is completed. */ - Tcl_SetChannelOption(interp, *(rsc->outchannel), "-buffersize", "1000000"); + // Tcl_SetChannelOption(interp, *(rsc->outchannel), "-buffersize", "1000000"); + Tcl_SetChannelBufferSize (*(rsc->outchannel), 1000000); Tcl_RegisterChannel(interp, *(rsc->outchannel)); + Tcl_Release(interp); } @@ -1290,6 +1295,7 @@ ( sr == s || rsc->separate_virtual_interps || function != parentfunction)) { + Tcl_Preserve (rsc->server_interp); if (Tcl_EvalObjEx(rsc->server_interp,function, 0) != TCL_OK) { ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, s, errmsg, Tcl_GetString(function)); @@ -1300,18 +1306,23 @@ "errorInfo: %s", Tcl_GetVar(rsc->server_interp, "errorInfo", 0)); } - - /* - * Upon child exit we delete each interpreter before the caller - * uses Tcl_Finalize - */ - - if (!init) { - Tcl_DeleteInterp(rsc->server_interp); - } + Tcl_Release (rsc->server_interp); } sr = sr->next; + + if (!init) { + /* + * Upon child exit we delete the master interpreter before the + * caller invokes Tcl_Finalize. Even if we're running separate + * virtual interpreters, we don't delete the slaves + * as deleting the master implicitly deltes its slave interpreters. + */ + rsc = RIVET_SERVER_CONF(s->module_config); + if (!Tcl_InterpDeleted (rsc->server_interp)) { + Tcl_DeleteInterp(rsc->server_interp); + } + } } } /* @@ -1447,8 +1458,7 @@ interpCount++); /* Separate virtual interps. */ - myrsc->server_interp = Tcl_CreateSlave(interp, - slavename, 0); + myrsc->server_interp = Tcl_CreateSlave(interp, slavename, 0); if (myrsc->server_interp == NULL) { ap_log_error( APLOG_MARK, APLOG_ERR, APR_EGENERAL, s, "slave interp create failed: %s", Modified: tcl/rivet/trunk/src/rivetChannel.c URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/rivetChannel.c?rev=772488&r1=772487&r2=772488&view=diff ============================================================================== --- tcl/rivet/trunk/src/rivetChannel.c (original) +++ tcl/rivet/trunk/src/rivetChannel.c Thu May 7 02:27:56 2009 @@ -84,17 +84,21 @@ } Tcl_ChannelType RivetChan = { - "apache_channel", - NULL, - closeproc, - inputproc, - outputproc, - NULL, - setoptionproc, - NULL, - watchproc, - gethandleproc, - NULL, - NULL + "apache_channel", /* typeName */ + TCL_CHANNEL_VERSION_4, /* channel type version */ + closeproc, /* close proc */ + inputproc, /* input proc */ + outputproc, /* output proc */ + NULL, /* seek proc - can be null */ + setoptionproc, /* set option proc - can be null */ + NULL, /* get option proc - can be null */ + watchproc, /* watch proc */ + gethandleproc, /* get handle proc */ + NULL, /* close 2 proc - can be null */ + NULL, /* block mode proc - can be null */ + NULL, /* flush proc - can be null */ + NULL, /* handler proc - can be null */ + NULL, /* wide seek proc - can be null if seekproc is*/ + NULL /* thread action proc - can be null */ }; --------------------------------------------------------------------- To unsubscribe, e-mail: xtaylor@example.net For additional commands, e-mail: xtaylor@example.net From xtaylor@example.net Thu May 07 02:49:11 2009 Return-Path: <xtaylor@example.net> Delivered-To: xtaylor@example.net Received: (qmail 88943 invoked from network); 7 May 2009 02:49:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 7 May 2009 02:49:11 -0000 Received: (qmail 4739 invoked by uid 500); 7 May 2009 02:49:11 -0000 Delivered-To: xtaylor@example.net Received: (qmail 4725 invoked by uid 500); 7 May 2009 02:49:11 -0000 Mailing-List: contact xtaylor@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:xtaylor@example.net> List-Unsubscribe: <mailto:xtaylor@example.net> List-Post: <mailto:xtaylor@example.net> List-Id: <rivet-cvs.tcl.apache.org> Delivered-To: mailing list xtaylor@example.net Received: (qmail 4716 invoked by uid 99); 7 May 2009 02:49:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 May 2009 02:49:11 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 May 2009 02:49:09 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id B4F0E2388969; Thu, 7 May 2009 02:48:49 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r772489 - /tcl/rivet/trunk/src/apache-2/mod_rivet.c Date: Thu, 07 May 2009 02:48:49 -0000 To: xtaylor@example.net From: xtaylor@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <xtaylor@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: karl Date: Thu May 7 02:48:49 2009 New Revision: 772489 URL: http://svn.apache.org/viewvc?rev=772489&view=rev Log: Correct bug in last commit. Now it works (Apache 2 anyway). Modified: tcl/rivet/trunk/src/apache-2/mod_rivet.c Modified: tcl/rivet/trunk/src/apache-2/mod_rivet.c URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/apache-2/mod_rivet.c?rev=772489&r1=772488&r2=772489&view=diff ============================================================================== --- tcl/rivet/trunk/src/apache-2/mod_rivet.c (original) +++ tcl/rivet/trunk/src/apache-2/mod_rivet.c Thu May 7 02:48:49 2009 @@ -1281,13 +1281,16 @@ //errmsg = (char *) apr_pstrdup(p, "Error in child exit script: %s"); } - sr = s; - while (sr) + for (sr = s; sr; sr = sr->next) { rsc = RIVET_SERVER_CONF(sr->module_config); function = init ? rsc->rivet_child_init_script : rsc->rivet_child_exit_script; + if (!init && sr == s) { + Tcl_Preserve(rsc->server_interp); + } + /* Execute it if it exists and it's the top level, separate * virtual interps are turned on, or it's different than the * main script. */ @@ -1309,20 +1312,20 @@ Tcl_Release (rsc->server_interp); } - sr = sr->next; + } - if (!init) { - /* - * Upon child exit we delete the master interpreter before the - * caller invokes Tcl_Finalize. Even if we're running separate - * virtual interpreters, we don't delete the slaves - * as deleting the master implicitly deltes its slave interpreters. - */ - rsc = RIVET_SERVER_CONF(s->module_config); - if (!Tcl_InterpDeleted (rsc->server_interp)) { - Tcl_DeleteInterp(rsc->server_interp); - } + if (!init) { + /* + * Upon child exit we delete the master interpreter before the + * caller invokes Tcl_Finalize. Even if we're running separate + * virtual interpreters, we don't delete the slaves + * as deleting the master implicitly deltes its slave interpreters. + */ + rsc = RIVET_SERVER_CONF(s->module_config); + if (!Tcl_InterpDeleted (rsc->server_interp)) { + Tcl_DeleteInterp(rsc->server_interp); } + Tcl_Release (rsc->server_interp); } } /* --------------------------------------------------------------------- To unsubscribe, e-mail: xtaylor@example.net For additional commands, e-mail: xtaylor@example.net From rivetxtaylor@example.net Thu May 07 21:32:11 2009 Return-Path: <rivetxtaylor@example.net> Delivered-To: xtaylor@example.net Received: (qmail 69672 invoked from network); 7 May 2009 21:32:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 7 May 2009 21:32:11 -0000 Received: (qmail 55305 invoked by uid 500); 7 May 2009 21:32:11 -0000 Delivered-To: xtaylor@example.net Received: (qmail 55268 invoked by uid 500); 7 May 2009 21:32:11 -0000 Mailing-List: contact xtaylor@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:xtaylor@example.net> List-Unsubscribe: <mailto:xtaylor@example.net> List-Post: <mailto:xtaylor@example.net> List-Id: <rivet-dev.tcl.apache.org> Delivered-To: mailing list xtaylor@example.net Received: (qmail 55260 invoked by uid 99); 7 May 2009 21:32:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 May 2009 21:32:11 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of xtaylor@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-bw0-f159.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 May 2009 21:32:01 +0000 Received: by bwz3 with SMTP id 3so1201200bwz.33 for <xtaylor@example.net>; Thu, 07 May 2009 14:31:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=gZUlKHqpBJtbgRX2aDel4rlSFN+U1DsYK2xZJ9S0uAE=; b=rtGdz13SbduKqsPijUZXJUHKhIarztBVDXecIBw5ju3ziQ5lY8Qb5pe/WBEo/YRgJe tkgD6ivgk8Ckvo3pQMIjIdqTk56GM1hjHODyngFS9UO7pTg1wvte/8dpc4KLvBPGfDxx RHZnEwewI+3C6gSV8+cBxRClPvasBMTqOzsnw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=f9lYMWm2j/eF9nyLdJ1Vwpz1D0Y+dyu1cbIfPOrWJyz7p8Qj7f7F197LdWOIrrdhGx lwQb847eXkMilGI1ISIqNUGpDLDVSolxdOon1lgrhTZ64Fa50sUoZ9YKJAh4/zZCJtf2 01mLqlX+kqMpcMaTGjWFLffi84O66ll5zCvvo= MIME-Version: 1.0 Sender: xtaylor@example.net Received: by 83.161.120.155 with SMTP id g4mr1984852fap.36.1241731899772; Thu, 07 May 2009 14:31:39 -0700 (PDT) In-Reply-To: <xtaylor@example.net> References: <xtaylor@example.net> Date: Thu, 7 May 2009 23:31:39 +0200 X-Google-Sender-Auth: 51fbf72c5e2723ea Message-ID: <xtaylor@example.net> Subject: Re: coredumps on shutdown with separate virtual interps From: David Welton <xtaylor@example.net> To: xtaylor@example.net Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Looks like you found a solution, according to the commit logs? -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ Sent from Padova, PD, Italy --------------------------------------------------------------------- To unsubscribe, e-mail: xtaylor@example.net For additional commands, e-mail: xtaylor@example.net From rivetxtaylor@example.net Fri May 08 15:32:10 2009 Return-Path: <rivetxtaylor@example.net> Delivered-To: xtaylor@example.net Received: (qmail 41072 invoked from network); 8 May 2009 15:32:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 8 May 2009 15:32:09 -0000 Received: (qmail 83282 invoked by uid 500); 8 May 2009 15:32:09 -0000 Delivered-To: xtaylor@example.net Received: (qmail 83257 invoked by uid 500); 8 May 2009 15:32:09 -0000 Mailing-List: contact xtaylor@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:xtaylor@example.net> List-Unsubscribe: <mailto:xtaylor@example.net> List-Post: <mailto:xtaylor@example.net> List-Id: <rivet-dev.tcl.apache.org> Delivered-To: mailing list xtaylor@example.net Received: (qmail 83249 invoked by uid 99); 8 May 2009 15:32:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 May 2009 15:32:09 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO nautilus2.cce.unipr.it) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 May 2009 15:31:57 +0000 Received: from pachelbel.biol.unipr.it (pachelbel.biol.unipr.it [83.161.120.155]) by nautilus2.cce.unipr.it (8.13.8/8.13.8) with ESMTP id n48FVXu8019098; Fri, 8 May 2009 17:31:33 +0200 Received: from [83.161.120.155] (localhost [83.161.120.155]) by pachelbel.biol.unipr.it (Postfix) with ESMTP id 002259922C; Fri, 8 May 2009 17:30:41 +0200 (CEST) Message-ID: <xtaylor@example.net> Date: Fri, 08 May 2009 17:30:41 +0200 From: Massimo Manghi <xtaylor@example.net> Organization: =?ISO-8859-1?Q?Universit=E0_di_Parma?= User-Agent: Mozilla-Thunderbird 83.161.120.155 (X11/20090103) MIME-Version: 1.0 To: Karl Lehenbauer <xtaylor@example.net> CC: xtaylor@example.net Subject: Re: coredumps on shutdown with separate virtual interps References: <xtaylor@example.net> In-Reply-To: <xtaylor@example.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-CCE-UniPR-MailScanner-Information: CCE X-MailScanner-ID: n48FVXu8019098 X-CCE-UniPR-Na2-MailScanner: Found to be clean X-CCE-UniPR-Na2-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-1.44, required 6, autolearn=disabled, ALL_TRUSTED -1.44) X-CCE-UniPR-MailScanner-From: xtaylor@example.net X-Virus-Checked: Checked by ClamAV on apache.org I read the log of your last commit and it looks like I introduced this bug because I missed the implications of having the SVI switch turned on. I apologize. -- Massimo Karl Lehenbauer wrote: > Separate virtual interpreters are amazingly cool. Using them, > fiddling with auto_path, and using git we're able to give each > developer their own Rivet interpreters with a private library path > that gets searched first, their own webpages, and so forth. It's great. > > But we're having a problem that when we do an apachectl stop all of > the children that have served webpages dump core. The problem is that > outputproc is getting called by the flush activities triggered by the > call to Tcl_Finalize() as part of the shutdown. There isn't really a > request structure so it quickly dereferences a null pointer and that > triggers a coredump. > > Doing some debugging, I've determined that the Tcl channel that Rivet > maps to Apache's ap_rwrite and such, its close routine is getting > called prior to the attempt to flush this data. > > What's weird is that the data that it's trying to write is the same as > the last webpage the child generated. > > I'm continuing to investigate because I want to know why it's > happening, although it's also reasonable to make the closeproc set a > "closed" flag that the outputproc would honor. The outputproc could > also very easily detect that the request structure isn't real, but the > big question is why is it getting called in the first place. > > I mention it here in the hopes that someone will have a flash of > insight and/or knows the answer. > > Karl > > --------------------------------------------------------------------- > To unsubscribe, e-mail: xtaylor@example.net > For additional commands, e-mail: xtaylor@example.net > --------------------------------------------------------------------- To unsubscribe, e-mail: xtaylor@example.net For additional commands, e-mail: xtaylor@example.net From rivetxtaylor@example.net Tue May 12 19:12:57 2009 Return-Path: <rivetxtaylor@example.net> Delivered-To: xtaylor@example.net Received: (qmail 96186 invoked from network); 12 May 2009 19:10:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 12 May 2009 19:10:56 -0000 Received: (qmail 49669 invoked by uid 500); 12 May 2009 19:10:56 -0000 Delivered-To: xtaylor@example.net Received: (qmail 49619 invoked by uid 500); 12 May 2009 19:10:55 -0000 Mailing-List: contact xtaylor@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:xtaylor@example.net> List-Unsubscribe: <mailto:xtaylor@example.net> List-Post: <mailto:xtaylor@example.net> List-Id: <rivet-dev.tcl.apache.org> Delivered-To: mailing list xtaylor@example.net Received: (qmail 49611 invoked by uid 99); 12 May 2009 19:10:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 May 2009 19:10:55 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of xtaylor@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-qy0-f133.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 May 2009 19:10:46 +0000 Received: by
{'source': 'Apache Software Foundation Public Mail Archives'}