From rivetyruiz@example.com Fri Nov 07 18:49:46 2008 Return-Path: <rivetyruiz@example.com> Delivered-To: yruiz@example.com Received: (qmail 94477 invoked from network); 7 Nov 2008 18:49:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 7 Nov 2008 18:49:46 -0000 Received: (qmail 73836 invoked by uid 500); 7 Nov 2008 18:49:53 -0000 Delivered-To: yruiz@example.com Received: (qmail 73816 invoked by uid 500); 7 Nov 2008 18:49:53 -0000 Mailing-List: contact yruiz@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:yruiz@example.com> List-Unsubscribe: <mailto:yruiz@example.com> List-Post: <mailto:yruiz@example.com> List-Id: <rivet-dev.tcl.apache.org> Delivered-To: mailing list yruiz@example.com Received: (qmail 73805 invoked by uid 99); 7 Nov 2008 18:49:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Nov 2008 10:49:53 -0800 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: 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; Fri, 07 Nov 2008 18:48:34 +0000 Received: from pachelbel.biol.unipr.it (pachelbel.biol.unipr.it [83.161.120.155]) by julesv.cce.unipr.it (8.13.8/8.13.8) with ESMTP id mA7Il2bb009356 for <yruiz@example.com>; Fri, 7 Nov 2008 19:47:02 +0100 Received: from [83.161.120.155] (localhost [83.161.120.155]) by pachelbel.biol.unipr.it (Postfix) with ESMTP id A637D715E0 for <yruiz@example.com>; Fri, 7 Nov 2008 19:44:25 +0100 (CET) Message-ID: <yruiz@example.com> Date: Fri, 07 Nov 2008 19:44:25 +0100 From: Massimo Manghi <yruiz@example.com> Organization: =?ISO-8859-1?Q?Universit=E0_di_Parma?= User-Agent: Mozilla-Thunderbird 83.161.120.155 (X11/20081018) MIME-Version: 1.0 To: Rivet_dev <yruiz@example.com> Subject: pointer corruption while executing Tcl_FSStat Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-CCE-UniPR-MailScanner-Information: CCE X-MailScanner-ID: mA7Il2bb009356 X-CCE-UniPR-Juv-MailScanner: Found to be clean X-CCE-UniPR-Juv-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-2.599, required 6, autolearn=not spam, BAYES_00 -2.60) X-CCE-UniPR-MailScanner-From: yruiz@example.com X-Virus-Checked: Checked by ClamAV on apache.org As I resumed some maintenance on Rivet's code I found out the code that was quite nicely working last summer segfaults when rivet templates parse other embedded templates. The gcc compiler and the C library have been upgrade since then but no other applications, either mine or shipped with debian, seem to have suffered from that. The way the segfault occurs is simple: in Rivet_Parse a call to Tcl_FSStat blasts the pointer value in the first argument. Arguments being passed in have been checked running Apache under debugger control and are valid. This is the relevant code TCL_CMD_HEADER( Rivet_Parse ) { char *filename; Tcl_StatBuf buf; Tcl_Obj *fnobj; ... fnobj = Tcl_NewStringObj(filename, -1); Tcl_IncrRefCount(fnobj); retval = Tcl_FSStat(fnobj, &buf); Tcl_DecrRefCount(fnobj); ... } and the backtrace after the process returns from the call (gdb) bt #0 Rivet_Parse (clientData=0x0, interp=0x9014e50, objc=2, objv=0x9018a7c) at rivetCore.c:142 #1 0xb6c44926 in TclEvalObjvInternal () from /usr/lib/libtcl8.4.so.0 #2 0xb6c6e7cf in ?? () from /usr/lib/libtcl8.4.so.0 #3 0x09014e50 in ?? () #4 0x00000002 in ?? () #5 0x09018a7c in ?? () #6 0x00000000 in ?? () (gdb) being fnobj no more pointing to a valid Tcl object the process segfaults on the call to Tcl_DecrRefCount. The code retval is successful and the buf structure contains the actual file status. Allocating the pointer on the heap (through the apr pool) fixes the problem, but it looks a way to put the head in the sand and pretend the problem is not around What I ask you for are hints that may help me to single out the culprit of this behavior. thank you -- Massimo --------------------------------------------------------------------- To unsubscribe, e-mail: yruiz@example.com For additional commands, e-mail: yruiz@example.com From rivetyruiz@example.com Fri Nov 07 19:11:26 2008 Return-Path: <rivetyruiz@example.com> Delivered-To: yruiz@example.com Received: (qmail 3615 invoked from network); 7 Nov 2008 19:11:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 7 Nov 2008 19:11:26 -0000 Received: (qmail 2493 invoked by uid 500); 7 Nov 2008 19:11:33 -0000 Delivered-To: yruiz@example.com Received: (qmail 2478 invoked by uid 500); 7 Nov 2008 19:11:33 -0000 Mailing-List: contact yruiz@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:yruiz@example.com> List-Unsubscribe: <mailto:yruiz@example.com> List-Post: <mailto:yruiz@example.com> List-Id: <rivet-dev.tcl.apache.org> Delivered-To: mailing list yruiz@example.com Received: (qmail 2467 invoked by uid 99); 7 Nov 2008 19:11:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Nov 2008 11:11:33 -0800 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: local policy) Received: from [83.161.120.155] (HELO mail.tclhome.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 07 Nov 2008 19:10:15 +0000 Received: (qmail 63704 invoked from network); 7 Nov 2008 19:11:32 -0000 Received: from c-98-194-24-194.hsd1.tx.comcast.net (HELO ?83.161.120.155?) (yruiz@example.com@83.161.120.155) by 0 with SMTP; 7 Nov 2008 19:11:32 -0000 Message-Id: <yruiz@example.com> From: Damon Courtney <yruiz@example.com> To: Rivet_dev <yruiz@example.com> In-Reply-To: <yruiz@example.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v929.2) Subject: Re: pointer corruption while executing Tcl_FSStat Date: Fri, 7 Nov 2008 13:10:36 -0600 References: <yruiz@example.com> X-Mailer: Apple Mail (2.929.2) X-Virus-Checked: Checked by ClamAV on apache.org On Nov 7, 2008, at 12:44 PM, Massimo Manghi wrote: > As I resumed some maintenance on Rivet's code I found out > the code that was quite nicely working last summer segfaults > when rivet templates parse other embedded templates. The gcc > compiler and the C library have been upgrade since then but no > other applications, either mine or shipped with debian, seem to > have suffered from that. > > The way the segfault occurs is simple: in Rivet_Parse a call > to Tcl_FSStat blasts the pointer value in the first > argument. Arguments being passed in have been > checked running Apache under debugger control > and are valid. > > This is the relevant code > > TCL_CMD_HEADER( Rivet_Parse ) > { > char *filename; > Tcl_StatBuf buf; > Tcl_Obj *fnobj; > ... > fnobj = Tcl_NewStringObj(filename, -1); > Tcl_IncrRefCount(fnobj); > retval = Tcl_FSStat(fnobj, &buf); > Tcl_DecrRefCount(fnobj); > ... > } > > and the backtrace after the process returns from the call > > (gdb) bt > #0 Rivet_Parse (clientData=0x0, interp=0x9014e50, objc=2, > objv=0x9018a7c) at rivetCore.c:142 > #1 0xb6c44926 in TclEvalObjvInternal () from /usr/lib/libtcl8.4.so.0 > #2 0xb6c6e7cf in ?? () from /usr/lib/libtcl8.4.so.0 > #3 0x09014e50 in ?? () > #4 0x00000002 in ?? () > #5 0x09018a7c in ?? () > #6 0x00000000 in ?? () > (gdb) > > being fnobj no more pointing to a valid Tcl object > the process segfaults on the call to Tcl_DecrRefCount. > The code retval is successful and the buf structure contains the > actual file status. Allocating the pointer on the heap (through the > apr pool) fixes the problem, but it looks a way to put the head > in the sand and pretend the problem is not around > > What I ask you for are hints that may help me to single out the > culprit > of this behavior. I believe that the Tcl_FSStat() call is actually decr'ing the refcount for you. I couldn't tell you why, but I've run into a number of occasions where the FS calls do this. The code is pretty simple, so from looking at it, it's the only explanation I can come up with. 0-] Damon --------------------------------------------------------------------- To unsubscribe, e-mail: yruiz@example.com For additional commands, e-mail: yruiz@example.com From rivetyruiz@example.com Mon Nov 10 00:22:36 2008 Return-Path: <rivetyruiz@example.com> Delivered-To: yruiz@example.com Received: (qmail 2227 invoked from network); 10 Nov 2008 00:22:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 10 Nov 2008 00:22:36 -0000 Received: (qmail 27739 invoked by uid 500); 10 Nov 2008 00:22:43 -0000 Delivered-To: yruiz@example.com Received: (qmail 27717 invoked by uid 500); 10 Nov 2008 00:22:43 -0000 Mailing-List: contact yruiz@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:yruiz@example.com> List-Unsubscribe: <mailto:yruiz@example.com> List-Post: <mailto:yruiz@example.com> List-Id: <rivet-dev.tcl.apache.org> Delivered-To: mailing list yruiz@example.com Received: (qmail 27706 invoked by uid 99); 10 Nov 2008 00:22:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Nov 2008 16:22:43 -0800 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: 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; Mon, 10 Nov 2008 00:21:23 +0000 Received: from posta.unipr.it (ipruniv.cce.unipr.it [83.161.120.155]) by nemo3.cce.unipr.it (8.13.8/8.13.8) with ESMTP id mAA0JsRa012654; Mon, 10 Nov 2008 01:19:55 +0100 From: "Massimo Manghi" <yruiz@example.com> To: Damon Courtney <yruiz@example.com>, Rivet_dev <yruiz@example.com> Subject: Re: pointer corruption while executing Tcl_FSStat Date: Mon, 10 Nov 2008 01:21:19 +0100 Message-Id: <yruiz@example.com> In-Reply-To: <yruiz@example.com> References: <yruiz@example.com> <yruiz@example.com> 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: mAA0JsRa012654 X-CCE-UniPR-Ne3-MailScanner: Found to be clean X-CCE-UniPR-Ne3-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-2.599, required 6, autolearn=not spam, BAYES_00 -2.60) X-CCE-UniPR-MailScanner-From: yruiz@example.com X-Virus-Checked: Checked by ClamAV on apache.org Thank you Damon for the quick answer. On Fri, 7 Nov 2008 13:10:36 -0600, Damon Courtney wrote > > > > TCL_CMD_HEADER( Rivet_Parse ) > > { > > char *filename; > > Tcl_StatBuf buf; > > Tcl_Obj *fnobj; > > ... > > fnobj = Tcl_NewStringObj(filename, -1); > > Tcl_IncrRefCount(fnobj); > > retval = Tcl_FSStat(fnobj, &buf); > > Tcl_DecrRefCount(fnobj); > > ... > > I believe that the Tcl_FSStat() call is actually decr'ing the > refcount for you. I couldn't tell you why, but I've run into a > number of occasions where the FS calls do this. The code is pretty > simple, so from looking at it, it's the only explanation I can come > up with. 0-] > > Damon > Isn't the value of pointer (not its address) that is passed to Tcl_FSStat? I might be discovering my knowledge of the C language fundamental mechanisms is overly naive, but how the pointer value get set to 0 in the caller's scope? -- Massimo --------------------------------------------------------------------- To unsubscribe, e-mail: yruiz@example.com For additional commands, e-mail: yruiz@example.com From rivetyruiz@example.com Mon Nov 10 08:33:55 2008 Return-Path: <rivetyruiz@example.com> Delivered-To: yruiz@example.com Received: (qmail 67332 invoked from network); 10 Nov 2008 08:33:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 10 Nov 2008 08:33:55 -0000 Received: (qmail 16111 invoked by uid 500); 10 Nov 2008 08:34:02 -0000 Delivered-To: yruiz@example.com Received: (qmail 16087 invoked by uid 500); 10 Nov 2008 08:34:02 -0000 Mailing-List: contact yruiz@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:yruiz@example.com> List-Unsubscribe: <mailto:yruiz@example.com> List-Post: <mailto:yruiz@example.com> List-Id: <rivet-dev.tcl.apache.org> Delivered-To: mailing list yruiz@example.com Received: (qmail 16076 invoked by uid 99); 10 Nov 2008 08:34:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Nov 2008 00:34:02 -0800 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 yruiz@example.com designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO rv-out-0506.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Nov 2008 08:32:42 +0000 Received: by rv-out-0506.google.com with SMTP id g37so2358479rvb.33 for <yruiz@example.com>; Mon, 10 Nov 2008 00:33:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=JutLVCfmDJ7jKkBV+IL2YW/cw7rZbNzBWeBtBrFD27Q=; b=s/ED8LcMIBT5+Tnvr62gA57Oo+MZUMufrGUTr/SPhJgXBGSktTFHhxZib1IyZWVQEC ce8aDsbAO1AOSMrVYEalmCrBjVpDfXNEsMZrDYNlYgLXoySLs5OwJi1278PN2Efp0hSd qRxOZOJQeovuyfVnPvFbWqgeRliSQU0kqJovI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=ahhYsxuc28+Jz7pNVHySISiuDvp95Bg/saEow+9LzzYE/wPU/pToW5oOwEelfSwOzc 4vw0xQjR2tGdTfpDcvdusDYkSMg081hAjogrSZU+215MsEzoswACakOBq8GsH516vdbh YSAi625QM8Zfi7B81wFan9cZfSruk3/hjZRKQ= Received: by 83.161.120.155 with SMTP id w9mr3443892rvi.31.1226305995245; Mon, 10 Nov 2008 00:33:15 -0800 (PST) Received: by 83.161.120.155 with HTTP; Mon, 10 Nov 2008 00:33:15 -0800 (PST) Message-ID: <yruiz@example.com> Date: Mon, 10 Nov 2008 09:33:15 +0100 From: "David Welton" <yruiz@example.com> To: Rivet_dev <yruiz@example.com> Subject: Re: pointer corruption while executing Tcl_FSStat Cc: "Damon Courtney" <yruiz@example.com> In-Reply-To: <yruiz@example.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <yruiz@example.com> <yruiz@example.com> <yruiz@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Tcl_FSStat sets off warning bells for me. I had problems with this years ago: the Tcl stat struct and the Apache one were different sizes, and they got mixed up during linking, meaning that a bit more memory than was supposed to got overwritten. It was a very subtle and nasty bug because it was hard to trigger, and didn't manifest itself right away in all cases. That's one thing to investigate. -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ --------------------------------------------------------------------- To unsubscribe, e-mail: yruiz@example.com For additional commands, e-mail: yruiz@example.com From rivetyruiz@example.com Mon Nov 10 10:16:50 2008 Return-Path: <rivetyruiz@example.com> Delivered-To: yruiz@example.com Received: (qmail 15160 invoked from network); 10 Nov 2008 10:16:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 10 Nov 2008 10:16:50 -0000 Received: (qmail 4758 invoked by uid 500); 10 Nov 2008 10:16:57 -0000 Delivered-To: yruiz@example.com Received: (qmail 4712 invoked by uid 500); 10 Nov 2008 10:16:57 -0000 Mailing-List: contact yruiz@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:yruiz@example.com> List-Unsubscribe: <mailto:yruiz@example.com> List-Post: <mailto:yruiz@example.com> List-Id: <rivet-dev.tcl.apache.org> Delivered-To: mailing list yruiz@example.com Received: (qmail 4701 invoked by uid 99); 10 Nov 2008 10:16:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Nov 2008 02:16:57 -0800 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: 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; Mon, 10 Nov 2008 10:15:38 +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 mAAABLna021407; Mon, 10 Nov 2008 11:11:21 +0100 Received: from [83.161.120.155] (localhost [83.161.120.155]) by pachelbel.biol.unipr.it (Postfix) with ESMTP id BFF02715E0; Mon, 10 Nov 2008 11:08:42 +0100 (CET) Message-ID: <yruiz@example.com> Date: Mon, 10 Nov 2008 11:08:42 +0100 From: Massimo Manghi <yruiz@example.com> Organization: =?ISO-8859-1?Q?Universit=E0_di_Parma?= User-Agent: Mozilla-Thunderbird 83.161.120.155 (X11/20081018) MIME-Version: 1.0 To: David Welton <yruiz@example.com> CC: Rivet_dev <yruiz@example.com>, Damon Courtney <yruiz@example.com> Subject: Re: pointer corruption while executing Tcl_FSStat References: <yruiz@example.com> <yruiz@example.com> <yruiz@example.com> <yruiz@example.com> In-Reply-To: <yruiz@example.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-CCE-UniPR-MailScanner-Information: CCE X-MailScanner-ID: mAAABLna021407 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: yruiz@example.com X-Virus-Checked: Checked by ClamAV on apache.org I clearly was wrong in my previous message answering Damon's hints as we are passing a structure address that is adjacent the object pointer. David's bring more stuff to think about David Welton wrote: > Tcl_FSStat sets off warning bells for me. I had problems with this > years ago: the Tcl stat struct and the Apache one were different > sizes, and they got mixed up during linking, meaning that a bit more > memory than was supposed to got overwritten. It was a very subtle and > Where Apache's stat structure comes into play in this case? > nasty bug because it was hard to trigger, and didn't manifest itself > right away in all cases. > > That's one thing to investigate. > > I had already checked the stack allocation using gdb: sizeof(Tcl_StatBuf) returns 88. The stat structure and the pointer fnobj are 92 bytes apart, making room for 4 extra bytes that guarantees nothing, unless you can exactly size up the real memory span handled by Tcl_FSStat for the stat struct. Obviously a compilation option mismatch could be the culprit even though I prepared the debugging session disabling the optimizer (usual -O0). I expected to see the segfault disappear in this case, but it wasn't enough. Clearly the Tcl library is handling the structure in a different way. -- Massimo --------------------------------------------------------------------- To unsubscribe, e-mail: yruiz@example.com For additional commands, e-mail: yruiz@example.com From rivetyruiz@example.com Mon Nov 10 10:52:50 2008 Return-Path: <rivetyruiz@example.com> Delivered-To: yruiz@example.com Received: (qmail 25430 invoked from network); 10 Nov 2008 10:52:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 10 Nov 2008 10:52:50 -0000 Received: (qmail 31913 invoked by uid 500); 10 Nov 2008 10:52:57 -0000 Delivered-To: yruiz@example.com Received: (qmail 31879 invoked by uid 500); 10 Nov 2008 10:52:57 -0000 Mailing-List: contact yruiz@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:yruiz@example.com> List-Unsubscribe: <mailto:yruiz@example.com> List-Post: <mailto:yruiz@example.com> List-Id: <rivet-dev.tcl.apache.org> Delivered-To: mailing list yruiz@example.com Received: (qmail 31867 invoked by uid 99); 10 Nov 2008 10:52:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Nov 2008 02:52:56 -0800 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 yruiz@example.com designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO rv-out-0506.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Nov 2008 10:51:36 +0000 Received: by rv-out-0506.google.com with SMTP id g37so2412899rvb.33 for <yruiz@example.com>; Mon, 10 Nov 2008 02:52:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=dmPyEST5kCF3PoOCyHyPd9ZK5cZvtusJRplZYEa2wpg=; b=koMB7ecNVkPeAtRLY1zuljMlxGZjfi3GCl2mIuRJ9jNUKLEDGAS1kLYpP2LGdn6oIY 45DBubz09ks1rFjX/EbTFTnNKJUHmDcDLt3AELtu609jhm39dFuoX95yMBFge42sHo2h +ZIWu7i/dm8mnjF8qY+hJkZx7+5oGhAIs+QkQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=Q6MAZJJouFO/EFxHBkF9CspVkzJvwTcDJy+PSxHgGn0GTLDm/ncFGCtbc8oBlisrNg lihjf3x4pTI3OnfLaTnmDQAny8L/VASgAGle8jJQOEHZQvjqJ5/Ow9NnzM7t1AbmcvNq pLBx/ktn78v94j1OUtN/5CT7y3TU9pNfxwH4o= Received: by 83.161.120.155 with SMTP id p1mr3499724rvo.87.1226314339924; Mon, 10 Nov 2008 02:52:19 -0800 (PST) Received: by 83.161.120.155 with HTTP; Mon, 10 Nov 2008 02:52:19 -0800 (PST) Message-ID: <yruiz@example.com> Date: Mon, 10 Nov 2008 11:52:19 +0100 From: "David Welton" <yruiz@example.com> To: "Massimo Manghi" <yruiz@example.com> Subject: Re: pointer corruption while executing Tcl_FSStat Cc: Rivet_dev <yruiz@example.com>, "Damon Courtney" <yruiz@example.com> In-Reply-To: <yruiz@example.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <yruiz@example.com> <yruiz@example.com> <yruiz@example.com> <yruiz@example.com> <yruiz@example.com> X-Virus-Checked: Checked by ClamAV on apache.org One thing to do would be to fire up Apache and Tcl separately (no Rivet loaded), and look at the size of the stat struct. -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ --------------------------------------------------------------------- To unsubscribe, e-mail: yruiz@example.com For additional commands, e-mail: yruiz@example.com From rivetyruiz@example.com Mon Nov 10 10:57:38 2008 Return-Path: <rivetyruiz@example.com> Delivered-To: yruiz@example.com Received: (qmail 29134 invoked from network); 10 Nov 2008 10:57:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 10 Nov 2008 10:57:38 -0000 Received: (qmail 38452 invoked by uid 500); 10 Nov 2008 10:57:45 -0000 Delivered-To: yruiz@example.com Received: (qmail 38404 invoked by uid 500); 10 Nov 2008 10:57:45 -0000 Mailing-List: contact yruiz@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:yruiz@example.com> List-Unsubscribe: <mailto:yruiz@example.com> List-Post: <mailto:yruiz@example.com> List-Id: <rivet-dev.tcl.apache.org> Delivered-To: mailing list yruiz@example.com Received: (qmail 38393 invoked by uid 99); 10 Nov 2008 10:57:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Nov 2008 02:57:45 -0800 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 yruiz@example.com designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO rv-out-0506.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Nov 2008 10:56:24 +0000 Received: by rv-out-0506.google.com with SMTP id g37so2414958rvb.33 for <yruiz@example.com>; Mon, 10 Nov 2008 02:57:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=MHcChs1AxkUARSgsIc/055tDA/x14XJJ+QrCW/VjSlI=; b=RnuADq/z7QqQ5OHl76FnCXD+onvYajtI92PPQvCVNbJkfMJkjTgWpV/rSDKPR0Pzxf FE1DQfQNqRQn2QjQmrJX1RFECK3xvJ/tmPpbp3dpu42wii72Ii2+DYenLiU+r166QUMC lAnhB1k5/UKuFgw7zKJMYBtgwj98hjhSHatkU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=VSvtVcdJs+AaIL0OtklInSCRNvuhBQT1KrJb1BcX8Zj767ViyOnQw+8ZvVi2UES/AW Dzx/rYmhQndDsQRVIj/1l8NvFoKXeZcVlZsWUt3uVOX3Ag++uMlI5nHNbDqYaAdCH/kT h/Tc5P10hXgwfZGDv+iWS8WB9VRJi9AMNykcw= Received: by 83.161.120.155 with SMTP id e5mr3504247rvk.38.1226314627496; Mon, 10 Nov 2008 02:57:07 -0800 (PST) Received: by 83.161.120.155 with HTTP; Mon, 10 Nov 2008 02:57:07 -0800 (PST) Message-ID: <yruiz@example.com> Date: Mon, 10 Nov 2008 11:57:07 +0100 From: "David Welton" <yruiz@example.com> To: "Massimo Manghi" <yruiz@example.com> Subject: Re: pointer corruption while executing Tcl_FSStat Cc: Rivet_dev <yruiz@example.com>, "Damon Courtney" <yruiz@example.com> In-Reply-To: <yruiz@example.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <yruiz@example.com> <yruiz@example.com> <yruiz@example.com> <yruiz@example.com> <yruiz@example.com> <yruiz@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Here's a thread on tcl-core about this problem: http://aspn.activestate.com/ASPN/Mail/Message/tcl-core/1670272 Once again - I'm not sure if this is the same problem, but it's worth a check, because if it is that, it's a pain to debug. -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ --------------------------------------------------------------------- To unsubscribe, e-mail: yruiz@example.com For additional commands, e-mail: yruiz@example.com From rivetyruiz@example.com Wed Nov 12 10:23:27 2008 Return-Path: <rivetyruiz@example.com> Delivered-To: yruiz@example.com Received: (qmail 59752 invoked from network); 12 Nov 2008 10:23:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 12 Nov 2008 10:23:27 -0000 Received: (qmail 95095 invoked by uid 500); 12 Nov 2008 10:23:35 -0000 Delivered-To: yruiz@example.com Received: (qmail 95078 invoked by uid 500); 12 Nov 2008 10:23:35 -0000 Mailing-List: contact yruiz@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:yruiz@example.com> List-Unsubscribe: <mailto:yruiz@example.com> List-Post: <mailto:yruiz@example.com> List-Id: <rivet-dev.tcl.apache.org> Delivered-To: mailing list yruiz@example.com Received: (qmail 95067 invoked by uid 99); 12 Nov 2008 10:23:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Nov 2008 02:23:34 -0800 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: 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; Wed, 12 Nov 2008 10:22:15 +0000 Received: from pachelbel.biol.unipr.it (pachelbel.biol.unipr.it [83.161.120.155]) by julesv.cce.unipr.it (8.13.8/8.13.8) with ESMTP id mACAKjru013369; Wed, 12 Nov 2008 11:20:45 +0100 Received: from [83.161.120.155] (localhost [83.161.120.155]) by pachelbel.biol.unipr.it (Postfix) with ESMTP id 8F9E871B9E; Wed, 12 Nov 2008 11:18:04 +0100 (CET) Message-ID: <yruiz@example.com> Date: Wed, 12 Nov 2008 11:18:04 +0100 From: Massimo Manghi <yruiz@example.com> Organization: =?ISO-8859-1?Q?Universit=E0_di_Parma?= User-Agent: Mozilla-Thunderbird 83.161.120.155 (X11/20081018) MIME-Version: 1.0 To: David Welton <yruiz@example.com> CC: Rivet_dev <yruiz@example.com>, Damon Courtney <yruiz@example.com> Subject: Re: pointer corruption while executing Tcl_FSStat References: <yruiz@example.com> <yruiz@example.com> <yruiz@example.com> <yruiz@example.com> <yruiz@example.com> <yruiz@example.com> In-Reply-To: <yruiz@example.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-CCE-UniPR-MailScanner-Information: CCE X-MailScanner-ID: mACAKjru013369 X-CCE-UniPR-Juv-MailScanner: Found to be clean X-CCE-UniPR-Juv-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-2.599, required 6, autolearn=not spam, BAYES_00 -2.60) X-CCE-UniPR-MailScanner-From: yruiz@example.com X-Virus-Checked: Checked by ClamAV on apache.org David Welton wrote: > One thing to do would be to fire up Apache and Tcl separately (no > Rivet loaded), and look at the size of the stat struct. > > The sizes do match: 88 in both cases. I read the thread you pointed out on the tcl-core archives. The problem is the same, I think. Since the discussion in that circumstance was quite inconclusive I propose to change Rivet_Parse and move to the stat call to from Tcl_FSStat to apr_stat, keeping call and structures within apache's pen. -- Massimo --------------------------------------------------------------------- To unsubscribe, e-mail: yruiz@example.com For additional commands, e-mail: yruiz@example.com From rivetyruiz@example.com Wed Nov 12 11:56:45 2008 Return-Path: <rivetyruiz@example.com> Delivered-To: yruiz@example.com Received: (qmail 86503 invoked from network); 12 Nov 2008 11:56:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 12 Nov 2008 11:56:44 -0000 Received: (qmail 19188 invoked by uid 500); 12 Nov 2008 11:56:52 -0000 Delivered-To: yruiz@example.com Received: (qmail 19174 invoked by uid 500); 12 Nov 2008 11:56:52 -0000 Mailing-List: contact yruiz@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:yruiz@example.com> List-Unsubscribe: <mailto:yruiz@example.com> List-Post: <mailto:yruiz@example.com> List-Id: <rivet-dev.tcl.apache.org> Delivered-To: mailing list yruiz@example.com Received: (qmail 19162 invoked by uid 99); 12 Nov 2008 11:56:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Nov 2008 03:56:52 -0800 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: 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, 12 Nov 2008 11:55:32 +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 mACBrbAq021963; Wed, 12 Nov 2008 12:53:37 +0100 Received: from [83.161.120.155] (localhost [83.161.120.155]) by pachelbel.biol.unipr.it (Postfix) with ESMTP id CC4D9715E0; Wed, 12 Nov 2008 12:50:47 +0100 (CET) Message-ID: <yruiz@example.com> Date: Wed, 12 Nov 2008 12:50:47 +0100 From: Massimo Manghi <yruiz@example.com> Organization: =?ISO-8859-1?Q?Universit=E0_di_Parma?= User-Agent: Mozilla-Thunderbird 83.161.120.155 (X11/20081018) MIME-Version: 1.0 To: David Welton <yruiz@example.com> CC: Rivet_dev <yruiz@example.com> Subject: Re: pointer corruption while executing Tcl_FSStat References: <yruiz@example.com> <yruiz@example.com> <yruiz@example.com> <yruiz@example.com> <yruiz@example.com> <yruiz@example.com> <yruiz@example.com> In-Reply-To: <yruiz@example.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-CCE-UniPR-MailScanner-Information: CCE X-MailScanner-ID: mACBrbAq021963 X-CCE-UniPR-Ne3-MailScanner: Found to be clean X-CCE-UniPR-Ne3-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-2.599, required 6, autolearn=not spam, BAYES_00 -2.60) X-CCE-UniPR-MailScanner-From: yruiz@example.com X-Virus-Checked: Checked by ClamAV on apache.org Index: src/apache-2/rivetCore.c =================================================================== --- src/apache-2/rivetCore.c (revision 712202) +++ src/apache-2/rivetCore.c (working copy) @@ -41,6 +41,7 @@ #include <tcl.h> #include <string.h> #include <stdio.h> +#include <apr_errno.h> #include "apache_request.h" #include "mod_rivet.h" @@ -52,6 +53,7 @@ #define COOKIES_ARRAY_NAME "cookies" extern module rivet_module; +extern char* TclWeb_GetRawPost (TclWebRequest *req); #define POOL (globals->r->pool) @@ -105,10 +107,10 @@ TCL_CMD_HEADER( Rivet_Parse ) { - char *filename; - Tcl_StatBuf buf; - Tcl_Obj *fnobj; - int retval = 0; + char *filename; + apr_status_t stat_s; + apr_finfo_t finfo_b; + rivet_interp_globals *globals = Tcl_GetAssocData(interp, "rivet", NULL); if( objc < 2 || objc > 3 ) @@ -124,8 +126,7 @@ Tcl_WrongNumArgs( interp, 1, objv, "?-virtual? filename" ); return TCL_ERROR; } - filename = TclWeb_GetVirtualFile( globals->req, - Tcl_GetStringFromObj(objv[2], (int *)NULL) ); + filename = TclWeb_GetVirtualFile(globals->req,Tcl_GetStringFromObj(objv[2],(int *)NULL)); } if (!strcmp(filename, globals->r->filename)) @@ -134,13 +135,12 @@ return TCL_ERROR; } - fnobj = Tcl_NewStringObj(filename, -1); - Tcl_IncrRefCount(fnobj); - retval = Tcl_FSStat(fnobj, &buf); - Tcl_DecrRefCount(fnobj); - if (retval != 0) + stat_s = apr_stat(&finfo_b,filename,APR_FINFO_NORM,globals->r->pool); + if (stat_s != APR_SUCCESS) { - Tcl_AddErrorInfo(interp, Tcl_PosixError(interp)); + char apr_error_message[256]; + + Tcl_AddErrorInfo(interp,apr_strerror(stat_s,apr_error_message,256)); return TCL_ERROR; } --------------------------------------------------------------------- To unsubscribe, e-mail: yruiz@example.com For additional commands, e-mail: yruiz@example.com From rivetyruiz@example.com Wed Nov 12 14:40:20 2008 Return-Path: <rivetyruiz@example.com> Delivered-To: yruiz@example.com Received: (qmail 77091 invoked from network); 12 Nov 2008 14:40:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 12 Nov 2008 14:40:20 -0000 Received: (qmail 63519 invoked by uid 500); 12 Nov 2008 14:40:27 -0000 Delivered-To: yruiz@example.com Received: (qmail 63469 invoked by uid 500); 12 Nov 2008 14:40:27 -0000 Mailing-List: contact yruiz@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:yruiz@example.com> List-Unsubscribe: <mailto:yruiz@example.com> List-Post: <mailto:yruiz@example.com> List-Id: <rivet-dev.tcl.apache.org> Delivered-To: mailing list yruiz@example.com Received: (qmail 63458 invoked by uid 99); 12 Nov 2008 14:40:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Nov 2008 06:40:27 -0800 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: 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; Wed, 12 Nov 2008 14:39:08 +0000 Received: from pachelbel.biol.unipr.it (pachelbel.biol.unipr.it [83.161.120.155]) by julesv.cce.unipr.it (8.13.8/8.13.8) with ESMTP id mACEbNZB031817 for <yruiz@example.com>; Wed, 12 Nov 2008 15:37:23 +0100 Received: from [83.161.120.155] (localhost [83.161.120.155]) by pachelbel.biol.unipr.it (Postfix) with ESMTP id D0953715E0 for <yruiz@example.com>; Wed, 12 Nov 2008 15:34:40 +0100 (CET) Message-ID: <yruiz@example.com> Date: Wed, 12 Nov 2008 15:34:40 +0100 From: Massimo Manghi <yruiz@example.com> Organization: =?ISO-8859-1?Q?Universit=E0_di_Parma?= User-Agent: Mozilla-Thunderbird 83.161.120.155 (X11/20081018) MIME-Version: 1.0 To: Rivet_dev <yruiz@example.com> Subject: examples and TOC Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-CCE-UniPR-MailScanner-Information: CCE X-MailScanner-ID: mACEbNZB031817 X-CCE-UniPR-Juv-MailScanner: Found to be clean X-CCE-UniPR-Juv-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-2.599, required 6, autolearn=not spam, BAYES_00 -2.60) X-CCE-UniPR-MailScanner-From: yruiz@example.com X-Virus-Checked: Checked by ClamAV on apache.org David, you're a docbook master. Do you know if we can have the <example> elements in the manual listed in the table of contents? Something like is done for the <section> elements (an 'examples and usage' section exists) but with a lesser rank than the parent element. I know we have only a few examples, but I thought I could add more and rework a bit the ones are already in the manual. -- Massimo --------------------------------------------------------------------- To unsubscribe, e-mail: yruiz@example.com For additional commands, e-mail: yruiz@example.com From yruiz@example.com Thu Nov 13 14:27:08 2008 Return-Path: <yruiz@example.com> Delivered-To: yruiz@example.com Received: (qmail 1497 invoked from network); 13 Nov 2008 14:27:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 13 Nov 2008 14:27:07 -0000 Received: (qmail 22682 invoked by uid 500); 13 Nov 2008 14:27:15 -0000 Delivered-To: yruiz@example.com Received: (qmail 22664 invoked by uid 500); 13 Nov 2008 14:27:15 -0000 Mailing-List: contact yruiz@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:yruiz@example.com> List-Unsubscribe: <mailto:yruiz@example.com> List-Post: <mailto:yruiz@example.com> List-Id: <rivet-cvs.tcl.apache.org> Delivered-To: mailing list yruiz@example.com Received: (qmail 22655 invoked by uid 99); 13 Nov 2008 14:27:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Nov 2008 06:27:15 -0800 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, 13 Nov 2008 14:25:53 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 9289123888F1; Thu, 13 Nov 2008 06:26:37 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r713733 - in /tcl/rivet/trunk: ChangeLog src/apache-2/rivetCore.c Date: Thu, 13 Nov 2008 14:26:37 -0000 To: yruiz@example.com From: yruiz@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <yruiz@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: mxmanghi Date: Thu Nov 13 06:26:37 2008 New Revision: 713733 URL: http://svn.apache.org/viewvc?rev=713733&view=rev Log: * src/apache-2/rivetCore.c: In function 'Rivet_Parse' the call to Tcl_FSStat was turned into the corresponding apr function 'apr_stat'. This change was motivated by a possibile mismatch between Rivet's allocation of the structure 'Tcl_StatBuf' and the handling of the structure done within the Tcl C library. This seems to have healed a pointer corruption that caused segfaults when the 'parse' command was executed. Modified: tcl/rivet/trunk/ChangeLog tcl/rivet/trunk/src/apache-2/rivetCore.c Modified: tcl/rivet/trunk/ChangeLog URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/ChangeLog?rev=713733&r1=713732&r2=713733&view=diff ============================================================================== --- tcl/rivet/trunk/ChangeLog (original) +++ tcl/rivet/trunk/ChangeLog Thu Nov 13 06:26:37 2008 @@ -1,3 +1,14 @@ +2008-11-13 Massimo Manghi <yruiz@example.com> + + * src/apache-2/rivetCore.c: In function 'Rivet_Parse' the call + to Tcl_FSStat was turned into the corresponding apr function + 'apr_stat'. + This change was motivated by a possibile mismatch between Rivet's + allocation of the structure 'Tcl_StatBuf' and the handling + of the structure done within the Tcl C library. + This seems to have healed a pointer corruption that caused + segfaults when the 'parse' command was executed. + 2008-10-07 Massimo Manghi <yruiz@example.com> * src/apache-2/apache_multipart_buffer.c, src/apache-2/rivetCore.c, @@ -559,7 +570,7 @@ file uploads. 2005-08-01 Karl Lehenbauer <yruiz@example.com> - * abort_page was, for all intents and purposes, completely and utterly + * : abort_page was, for all intents and purposes, completely and utterly broken -- it forced a return from whatever called it, as if it was a "return" statement, but it didn't stop evaluating Tcl beyond that, which was broken, and it discarded output by setting an "aborted" @@ -698,7 +709,7 @@ * Collected some build notes in README.configure - * Clean up presentation of --with-apxs and --with-tclsh and + * : Clean up presentation of --with-apxs and --with-tclsh and have them show up when configure --help is run. * tclconfig/tcl.m4, configure.ac, config.h, src/*.c: @@ -709,9 +720,9 @@ arguments, where the third argument is a description, so that autoheader can generate the config.h.in, significantly decluttering the compiler command lines. - (tcl.m4 changes should be fed back to the TEA project, + tcl.m4 changes should be fed back to the TEA project, as well as the technique for using automake to simplify - the build) + the build * Move aclocal.m4 to acinclude.m4 -- we need the aclocal command to generate acinclude.m4 based on aclocal.m4 and stuff it gleans Modified: tcl/rivet/trunk/src/apache-2/rivetCore.c URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/apache-2/rivetCore.c?rev=713733&r1=713732&r2=713733&view=diff ============================================================================== --- tcl/rivet/trunk/src/apache-2/rivetCore.c (original) +++ tcl/rivet/trunk/src/apache-2/rivetCore.c Thu Nov 13 06:26:37 2008 @@ -41,6 +41,7 @@ #include <tcl.h> #include <string.h> #include <stdio.h> +#include <apr_errno.h> #include "apache_request.h" #include "mod_rivet.h" @@ -52,6 +53,7 @@ #define COOKIES_ARRAY_NAME "cookies" extern module rivet_module; +extern char* TclWeb_GetRawPost (TclWebRequest *req); #define POOL (globals->r->pool) @@ -105,10 +107,10 @@ TCL_CMD_HEADER( Rivet_Parse ) { - char *filename; - Tcl_StatBuf buf; - Tcl_Obj *fnobj; - int retval = 0; + char *filename; + apr_status_t stat_s; + apr_finfo_t finfo_b; + rivet_interp_globals *globals = Tcl_GetAssocData(interp, "rivet", NULL); if( objc < 2 || objc > 3 ) @@ -124,8 +126,7 @@ Tcl_WrongNumArgs( interp, 1, objv, "?-virtual? filename" ); return TCL_ERROR; } - filename = TclWeb_GetVirtualFile( globals->req, - Tcl_GetStringFromObj(objv[2], (int *)NULL) ); + filename = TclWeb_GetVirtualFile(globals->req,Tcl_GetStringFromObj(objv[2],(int *)NULL)); } if (!strcmp(filename, globals->r->filename)) @@ -134,13 +135,12 @@ return TCL_ERROR; } - fnobj = Tcl_NewStringObj(filename, -1); - Tcl_IncrRefCount(fnobj); - retval = Tcl_FSStat(fnobj, &buf); - Tcl_DecrRefCount(fnobj); - if (retval != 0) + stat_s = apr_stat(&finfo_b,filename,APR_FINFO_NORM,globals->r->pool); + if (stat_s != APR_SUCCESS) { - Tcl_AddErrorInfo(interp, Tcl_PosixError(interp)); + char apr_error_message[256]; + + Tcl_AddErrorInfo(interp,apr_strerror(stat_s,apr_error_message,256)); return TCL_ERROR; } --------------------------------------------------------------------- To unsubscribe, e-mail: yruiz@example.com For additional commands, e-mail: yruiz@example.com From rivetyruiz@example.com Fri Nov 14 14:34:34 2008 Return-Path: <rivetyruiz@example.com> Delivered-To: yruiz@example.com Received: (qmail 78345 invoked from network); 14 Nov 2008 14:34:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 14 Nov 2008 14:34:34 -0000 Received: (qmail 63440 invoked by uid 500); 14 Nov 2008 14:34:41 -0000 Delivered-To: yruiz@example.com Received: (qmail 63428 invoked by uid 500); 14 Nov 2008 14:34:41 -0000 Mailing-List: contact yruiz@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:yruiz@example.com> List-Unsubscribe: <mailto:yruiz@example.com> List-Post: <mailto:yruiz@example.com> List-Id: <rivet-dev.tcl.apache.org> Delivered-To: mailing list yruiz@example.com Received: (qmail 63417 invoked by uid 99); 14 Nov 2008 14:34:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Nov 2008 06:34:41 -0800 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 yruiz@example.com designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO rv-out-0506.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Nov 2008 14:33:18 +0000 Received: by rv-out-0506.google.com with SMTP id g37so1404646rvb.33 for <yruiz@example.com>; Fri, 14 Nov 2008 06:33:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=MZzoIaDSnc3gWmI6TI9tZ7vkL0Y7pt+kzaS02l646Cw=; b=KIJVVfZ6fgbq/DDXlLRT6wqlbhZHV9o0P5l/1Dzr3AXIX+Gg5a5nEpvWf2jjpkfYEk AxQVV3A8Ej7se10UQbU7jhVoq+7fcCUUIeP6SdFbDbc+HZIEDDZCFtj5J4nncJlnL/xs 4zTpMFl+6aUKOhH2JiQOvVMpvZWSc7ITggFgY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=qyuuMMVAeZWLV8SMyqYk+x6AxKKcwvg/bNTnBDZks3t0t49ApsUr4ej+cRJUvuFX8W HjSoXWkVmz4dgv1YokdyhgHpzCIJacEWTGfNEVorDo6HBYEhkoxoE/032YzIpVDOo2QY ecVxFdBsTVe9OUehCyEii0v8SOG6MSPvyFNpw= Received: by 83.161.120.155 with SMTP id p13mr558187rvl.286.1226673232719; Fri, 14 Nov 2008 06:33:52 -0800 (PST) Received: by 83.161.120.155 with HTTP; Fri, 14 Nov 2008 06:33:52 -0800 (PST) Message-ID: <yruiz@example.com> Date: Fri, 14 Nov 2008 15:33:52 +0100 From: "David Welton" <yruiz@example.com> To: "Massimo Manghi" <yruiz@example.com> Subject: Re: examples and TOC Cc: Rivet_dev <yruiz@example.com> In-Reply-To: <yruiz@example.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <yruiz@example.com> X-Virus-Checked: Checked by ClamAV on apache.org > David, you're a docbook master. Do you know if we can have > the <example> elements in the manual listed in the table of > contents? Something like is done for the <section> > elements (an 'examples and usage' section exists) but with a lesser > rank than the parent element. I know we have only a > few examples, but I thought I could add more and rework > a bit the ones are already in the manual. Possible? Certainly... Probably not easy enough that I'll get to it though:-( -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ --------------------------------------------------------------------- To unsubscribe, e-mail: yruiz@example.com For additional commands, e-mail: yruiz@example.com From rivetyruiz@example.com Fri Nov 14 15:17:17 2008 Return-Path: <rivetyruiz@example.com> Delivered-To: yruiz@example.com Received: (qmail 98185 invoked from network); 14 Nov 2008 15:17:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 14 Nov 2008 15:17:17 -0000 Received: (qmail 32489 invoked by uid 500); 14 Nov 2008 15:17:24 -0000 Delivered-To: yruiz@example.com Received: (qmail 32478 invoked by uid 500); 14 Nov 2008 15:17:24 -0000 Mailing-List: contact yruiz@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:yruiz@example.com> List-Unsubscribe: <mailto:yruiz@example.com> List-Post: <mailto:yruiz@example.com> List-Id: <rivet-dev.tcl.apache.org> Delivered-To: mailing list yruiz@example.com Received: (qmail 32467 invoked by uid 99); 14 Nov 2008 15:17:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Nov 2008 07:17:24 -0800 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: 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; Fri, 14 Nov 2008 15:16:03 +0000 Received: from posta.unipr.it (ipruniv.cce.unipr.it [83.161.120.155]) by nemo3.cce.unipr.it (8.13.8/8.13.8) with ESMTP id mAEFGZmG008588; Fri, 14 Nov 2008 16:16:35 +0100 From: "Massimo Manghi" <yruiz@example.com> To: "David Welton" <yruiz@example.com>, "Massimo Manghi" <yruiz@example.com> Cc: Rivet_dev <yruiz@example.com> Subject: Re: examples and TOC Date: Fri, 14 Nov 2008 16:18:35 +0100 Message-Id: <yruiz@example.com> In-Reply-To: <yruiz@example.com> References: <yruiz@example.com> <yruiz@example.com> 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: mAEFGZmG008588 X-CCE-UniPR-Ne3-MailScanner: Found to be clean X-CCE-UniPR-Ne3-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-2.599, required 6, autolearn=not spam, BAYES_00 -2.60) X-CCE-UniPR-MailScanner-From: yruiz@example.com X-Virus-Checked: Checked by ClamAV on apache.org On Fri, 14 Nov 2008 15:33:52 +0100, David Welton wrote > > David, you're a docbook master. Do you know if we can have > > the <example> elements in the manual listed in the table of > > contents? Something like is done for the <section> > > elements (an 'examples and usage' section exists) but with a lesser > > rank than the parent element. I know we have only a > > few examples, but I thought I could add more and rework > > a bit the ones are already in the manual. > > Possible? Certainly... Probably not easy enough that I'll get to it > though:-( > Ok, thank you anyway. I hoped that existed an easy attribute that could work as a switch to change the tag behavior ... I'll make an attempt myself, but I don't want to get lost now in the docbook mechanisms -- Massimo --------------------------------------------------------------------- To unsubscribe, e-mail: yruiz@example.com For additional commands, e-mail: yruiz@example.com From rivetyruiz@example.com Fri Nov 14 15:19:58 2008 Return-Path: <rivetyruiz@example.com> Delivered-To: yruiz@example.com Received: (qmail 99489 invoked from network); 14 Nov 2008 15:19:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 14 Nov 2008 15:19:57 -0000 Received: (qmail 38290 invoked by uid 500); 14 Nov 2008 15:20:05 -0000 Delivered-To: yruiz@example.com Received: (qmail 38272 invoked by uid 500); 14 Nov 2008 15:20:05 -0000 Mailing-List: contact yruiz@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:yruiz@example.com> List-Unsubscribe: <mailto:yruiz@example.com> List-Post: <mailto:yruiz@example.com> List-Id: <rivet-dev.tcl.apache.org> Delivered-To: mailing list yruiz@example.com Received: (qmail 38261 invoked by uid 99); 14 Nov 2008 15:20:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Nov 2008 07:20:05 -0800 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: 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; Fri, 14 Nov 2008 15:18:44 +0000 Received: from posta.unipr.it (ipruniv.cce.unipr.it [83.161.120.155]) by nemo3.cce.unipr.it (8.13.8/8.13.8) with ESMTP id mAEFHGS9008613; Fri, 14 Nov 2008 16:17:16 +0100 From: "Massimo Manghi" <yruiz@example.com> To: "David Welton" <yruiz@example.com>, "Massimo Manghi" <yruiz@example.com> Cc: Rivet_dev <yruiz@example.com> Subject: Re: examples and TOC Date: Fri, 14 Nov 2008 16:19:16 +0100 Message-Id: <yruiz@example.com> In-Reply-To: <yruiz@example.com> References: <yruiz@example.com> <yruiz@example.com> 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: mAEFHGS9008613 X-CCE-UniPR-Ne3-MailScanner: Found to be clean X-CCE-UniPR-Ne3-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-2.599, required 6, autolearn=not spam, BAYES_00 -2.60) X-CCE-UniPR-MailScanner-From: yruiz@example.com X-Virus-Checked: Checked by ClamAV on apache.org On Fri, 14 Nov 2008 15:33:52 +0100, David Welton wrote > > David, you're a docbook master. Do you know if we can have > > the <example> elements in the manual listed in the table of > > contents? Something like is done for the <section> > > elements (an 'examples and usage' section exists) but with a lesser > > rank than the parent element. I know we have only a > > few examples, but I thought I could add more and rework > > a bit the ones are already in the manual. > > Possible? Certainly... Probably not easy enough that I'll get to it > though:-( > Ok, thank you anyway. I hoped that existed an easy attribute that could work as a switch to change the tag behavior ... I'll make an attempt myself, but I don't want to get lost now in the docbook mechanisms -- Massimo --------------------------------------------------------------------- To unsubscribe, e-mail: yruiz@example.com For additional commands, e-mail: yruiz@example.com From rivetyruiz@example.com Fri Nov 14 15:35:57 2008 Return-Path: <rivetyruiz@example.com> Delivered-To: yruiz@example.com Received: (qmail 6257 invoked from network); 14 Nov 2008 15:35:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 14 Nov 2008 15:35:57 -0000 Received: (qmail 81926 invoked by uid 500); 14 Nov 2008 15:36:04 -0000 Delivered-To: yruiz@example.com Received: (qmail 81908 invoked by uid 500); 14 Nov 2008 15:36:04 -0000 Mailing-List: contact yruiz@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:yruiz@example.com> List-Unsubscribe: <mailto:yruiz@example.com> List-Post: <mailto:yruiz@example.com> List-Id: <rivet-dev.tcl.apache.org> Delivered-To: mailing list yruiz@example.com Delivered-To: moderator for yruiz@example.com Received: (qmail 68408 invoked by uid 99); 14 Nov 2008 05:19: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 (athena.apache.org: domain of yruiz@example.com designates 83.161.120.155 as permitted sender) Message-Id: <yruiz@example.com> From: Karl Lehenbauer <yruiz@example.com> To: yruiz@example.com Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v929.2) Subject: Some upload options not working on Apache 2 Date: Thu, 13 Nov 2008 23:12:29 -0600 X-Mailer: Apple Mail (2.929.2) X-Virus-Checked: Checked by ClamAV on apache.org Hi Guys, Doing some testing I've discovered that "upload channel" doesn't work. It gives a bad file handle error on a file handle of, like, file168, which seems bogus. Also "upload data" will error out saying that the RivetServerConf UploadFilesToVar is not set, even though it is. Even after forcing the code to accept the request, it still doesn't work. "upload save" works, however, providing a workaround. I'm continuing to investigate. The code is almost identical to the apache-1 version, which works. There is a comment in there that says "this sucks - we should use the hook, but I want to get everything fixed and working first" I'm trying to understand the code. It looks like the file upload gets saved to a temp file regardless (?). I'm going to add an upload option to get the temp name, although I don't intend to commit it without consulting y'all. Regards, Karl --------------------------------------------------------------------- To unsubscribe, e-mail: yruiz@example.com For additional commands, e-mail: yruiz@example.com From rivetyruiz@example.com Fri Nov 14 15:36:22 2008 Return-Path: <rivetyruiz@example.com> Delivered-To: yruiz@example.com Received: (qmail 6393 invoked from network); 14 Nov 2008 15:36:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 14 Nov 2008 15:36:21 -0000 Received: (qmail 82285 invoked by uid 500); 14 Nov 2008 15:36:29 -0000 Delivered-To: yruiz@example.com Received: (qmail 82240 invoked by uid 500); 14 Nov 2008 15:36:29 -0000 Mailing-List: contact yruiz@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:yruiz@example.com> List-Unsubscribe: <mailto:yruiz@example.com> List-Post: <mailto:yruiz@example.com> List-Id: <rivet-dev.tcl.apache.org> Delivered-To: mailing list yruiz@example.com Delivered-To: moderator for yruiz@example.com Received: (qmail 38273 invoked by uid 99); 14 Nov 2008 06:42:08 -0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of yruiz@example.com designates 83.161.120.155 as permitted sender) Message-Id: <yruiz@example.com> From: Karl Lehenbauer <yruiz@example.com> To: yruiz@example.com Content-Type: multipart/alternative; boundary=Apple-Mail-73--770414254 Mime-Version: 1.0 (Apple Message framework v929.2) Subject: "upload data" and "upload channel" problem solved / fixed for Apache 2 Date: Fri, 14 Nov 2008 00:41:28 -0600 X-Mailer: Apple Mail (2.929.2) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail-73--770414254 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit This was tricky. Apache has its own portable I/O library that apparently is just a FILE * in Apache 1.3 but is an Apache-defined C structure in 2.2. Rivet made some assumptions about it that it shouldn't have, like that it could use the fileno() library call to get the UNIX file descriptor. I've got a fix working such that "upload channel" works with Apache 2 and "upload data" which has not been working in Apache 1.3 or 2. I've also added a new subcommand, "upload tempname", to get the name of the temporary file that contains the uploaded file for those who want to roll their own. In addition to working, it is now system independent without any special code, like it'll work on NT and stuff. The cost is that it opens the temp file that contains the uploaded file, rather than grabbing the file handle out of the Apache portable runtime file structure. There appears to be no "legal" way to grab the file descriptor out of the apr_file_t structure, so I think it's a small cost in overhead for something that's intrinsically relatively high overhead anyway (uploading files), and IMHO it's worth it to use the Apache file API in a standard manner. With your agreement I'd like to commit these changes. By the way, the "raw_post" command doesn't seem to work. --Apple-Mail-73--770414254 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable <html><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; = -webkit-line-break: after-white-space; "><div style=3D"word-wrap: = break-word; -webkit-nbsp-mode: space; -webkit-line-break: = after-white-space; "><div>This was tricky.<div><br></div><div>Apache has = its own&nbsp;<a = href=3D"http://apr.apache.org/docs/apr/1.2/group__apr__file__io.html">port= able I/O library</a>&nbsp;that apparently is just a FILE * in Apache 1.3 = but is an Apache-defined C structure in 2.2. &nbsp;Rivet made some = assumptions about it that it shouldn't have, like that it could use the = fileno() library call to get the UNIX file = descriptor.<div><br></div><div>I've got a fix working such that "upload = channel" works with Apache 2 and "upload data" which has not been = working in Apache 1.3 or 2. &nbsp;I've also added a new subcommand, = "upload tempname", to get the name of the temporary file that contains = the uploaded file for those who want to roll their = own.</div><div><br></div><div>In addition to working, it is now system = independent without any special code, like it'll work on NT and = stuff.</div><div><br></div><div>The cost is that it opens the temp file = that contains the uploaded file, rather than grabbing the file handle = out of the Apache portable runtime file structure. &nbsp;There appears = to be no "legal" way to grab the file descriptor out of the apr_file_t = structure, so I think it's a small cost in overhead for something that's = intrinsically relatively high overhead anyway (uploading files), and = IMHO it's worth it to use the Apache file API in a standard = manner.</div><div><br></div><div>With your agreement I'd like to commit = these changes.</div><div><br></div><div>By the way, the "raw_post" = command doesn't seem to work.</div></div></div></div></body></html>= --Apple-Mail-73--770414254-- From rivetyruiz@example.com Fri Nov 14 17:23:41 2008 Return-Path: <rivetyruiz@example.com> Delivered-To: yruiz@example.com Received: (qmail 49369 invoked from network); 14 Nov 2008 17:23:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 14 Nov 2008 17:23:41 -0000 Received: (qmail 8047 invoked by uid 500); 14 Nov 2008 17:23:48 -0000 Delivered-To: yruiz@example.com Received: (qmail 7999 invoked by uid 500); 14 Nov 2008 17:23:48 -0000 Mailing-List: contact yruiz@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:yruiz@example.com> List-Unsubscribe: <mailto:yruiz@example.com> List-Post: <mailto:yruiz@example.com> List-Id: <rivet-dev.tcl.apache.org> Delivered-To: mailing list yruiz@example.com Received: (qmail 7988 invoked by uid 99); 14 Nov 2008 17:23:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Nov 2008 09:23:48 -0800 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: 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, 14 Nov 2008 17:22:27 +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 mAEHMiTx028868; Fri, 14 Nov 2008 18:22:44 +0100 Received: from [83.161.120.155] (localhost [83.161.120.155]) by pachelbel.biol.unipr.it (Postfix) with ESMTP id 69D82715E0; Fri, 14 Nov 2008 18:19:58 +0100 (CET) Message-ID: <yruiz@example.com> Date: Fri, 14 Nov 2008 18:19:58 +0100 From: Massimo Manghi <yruiz@example.com> Organization: =?ISO-8859-1?Q?Universit=E0_di_Parma?= User-Agent: Mozilla-Thunderbird 83.161.120.155 (X11/20081018) MIME-Version: 1.0 To: Karl Lehenbauer <yruiz@example.com> CC: yruiz@example.com Subject: Re: "upload data" and "upload channel" problem solved / fixed for Apache 2 References: <yruiz@example.com> In-Reply-To: <yruiz@example.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-CCE-UniPR-MailScanner-Information: CCE X-MailScanner-ID: mAEHMiTx028868 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: yruiz@example.com X-Virus-Checked: Checked by ClamAV on apache.org Hi Karl, as you are one of Rivet's masterminds it's good to hear from you again. Actually 'upload channel' works for me (apache2 and rivet code from svn trunk) but, as you said, 'upload data' complains about the server configuration variable not being set. Karl Lehenbauer wrote: > This was tricky. > > Apache has its own portable I/O library > <http://apr.apache.org/docs/apr/1.2/group__apr__file__io.html> that > apparently is just a FILE * in Apache 1.3 but is an Apache-defined C > structure in 2.2. Rivet made some assumptions about it that it > shouldn't have, like that it could use the fileno() library call to > get the UNIX file descriptor. > > I've got a fix working such that "upload channel" works with Apache 2 > and "upload data" which has not been working in Apache 1.3 or 2. I've > also added a new subcommand, "upload tempname", to get the name of the > temporary file that contains the uploaded file for those who want to > roll their own. > > In addition to working, it is now system independent without any > special code, like it'll work on NT and stuff. > > The cost is that it opens the temp file that contains the uploaded > file, rather than grabbing the file handle out of the Apache portable > runtime file structure. There appears to be no "legal" way to grab > the file descriptor out of the apr_file_t structure, so I think it's a > small cost in overhead for something that's intrinsically relatively > high overhead anyway (uploading files), and IMHO it's worth it to use > the Apache file API in a standard manner. > > With your agreement I'd like to commit these changes. no objection, I'm curious to see what difference caused one subcommand to fail. > > By the way, the "raw_post" command doesn't seem to work. thank you for pointing this out. I never used this undocumented command but this could be an opportunity for doing it along with the fix. By the way, I remember you came up with an idea about exploiting a field in 'request_rec' to pass custom data to the server for subsequent logging. IIRC you had already coded it, are you still willing to share it with Rivet? -- Massimo --------------------------------------------------------------------- To unsubscribe, e-mail: yruiz@example.com For additional commands, e-mail: yruiz@example.com From rivetyruiz@example.com Fri Nov 14 17:31:25 2008 Return-Path: <rivetyruiz@example.com> Delivered-To: yruiz@example.com Received: (qmail 54727 invoked from network); 14 Nov 2008 17:31:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 14 Nov 2008 17:31:25 -0000 Received: (qmail 22021 invoked by uid 500); 14 Nov 2008 17:31:33 -0000 Delivered-To: yruiz@example.com Received: (qmail 22010 invoked by uid 500); 14 Nov 2008 17:31:33 -0000 Mailing-List: contact yruiz@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:yruiz@example.com> List-Unsubscribe: <mailto:yruiz@example.com> List-Post: <mailto:yruiz@example.com> List-Id: <rivet-dev.tcl.apache.org> Delivered-To: mailing list yruiz@example.com Received: (qmail 21999 invoked by uid 99); 14 Nov 2008 17:31:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Nov 2008 09:31:33 -0800 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: local policy) Received: from [83.161.120.155] (HELO mail.tclhome.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 14 Nov 2008 17:30:12 +0000 Received: (qmail 33730 invoked from network); 14 Nov 2008 17:30:27 -0000 Received: from c-98-194-24-194.hsd1.tx.comcast.net (HELO ?83.161.120.155?) (yruiz@example.com@83.161.120.155) by 0 with SMTP; 14 Nov 2008 17:30:27 -0000 Message-Id: <yruiz@example.com> From: Damon Courtney <yruiz@example.com> To: Rivet_dev <yruiz@example.com> In-Reply-To: <yruiz@example.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v929.2) Subject: Re: "upload data" and "upload channel" problem solved / fixed for Apache 2 Date: Fri, 14 Nov 2008 11:29:38 -0600 References: <yruiz@example.com> <yruiz@example.com> X-Mailer: Apple Mail (2.929.2) X-Virus-Checked: Checked by ClamAV on apache.org I like the new 'upload tempname' as well. That's better in a lot of ways than 'upload save' which is just going to copy (rename?) the temp file into another location when all you really want is to open up the file wherever it is. Damon On Nov 14, 2008, at 11:19 AM, Massimo Manghi wrote: > Hi Karl, > > as you are one of Rivet's masterminds it's good to hear from you > again. > Actually 'upload channel' works for me (apache2 and rivet code from > svn trunk) > but, as you said, 'upload data' complains about the server > configuration variable not > being set. > > Karl Lehenbauer wrote: >> This was tricky. >> >> Apache has its own portable I/O library <http://apr.apache.org/docs/apr/1.2/group__apr__file__io.html >> > that apparently is just a FILE * in Apache 1.3 but is an Apache- >> defined C structure in 2.2. Rivet made some assumptions about it >> that it shouldn't have, like that it could use the fileno() library >> call to get the UNIX file descriptor. >> >> I've got a fix working such that "upload channel" works with Apache >> 2 and "upload data" which has not been working in Apache 1.3 or 2. >> I've also added a new subcommand, "upload tempname", to get the >> name of the temporary file that contains the uploaded file for >> those who want to roll their own. >> >> In addition to working, it is now system independent without any >> special code, like it'll work on NT and stuff. >> >> The cost is that it opens the temp file that contains the
{'source': 'Apache Software Foundation Public Mail Archives'}