From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23567 invoked from network); 22 Aug 2008 15:37:47 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 22 Aug 2008 15:37:47 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 25855 invoked from network); 22 Aug 2008 15:37:29 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 22 Aug 2008 15:37:29 -0000 Received: (qmail 12666 invoked by alias); 22 Aug 2008 15:37:17 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25508 Received: (qmail 12642 invoked from network); 22 Aug 2008 15:37:14 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 22 Aug 2008 15:37:14 -0000 Received: from cluster-d.mailcontrol.com (cluster-d.mailcontrol.com [217.69.20.190]) by bifrost.dotsrc.org (Postfix) with ESMTPS id 5305D801E2B4 for ; Fri, 22 Aug 2008 17:37:07 +0200 (CEST) Received: from cameurexb01.EUROPE.ROOT.PRI ([193.128.72.68]) by rly16d.srv.mailcontrol.com (MailControl) with ESMTP id m7MFajWh009460 for ; Fri, 22 Aug 2008 16:37:06 +0100 Received: from news01 ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Fri, 22 Aug 2008 16:33:35 +0100 Date: Fri, 22 Aug 2008 16:33:35 +0100 From: Peter Stephenson To: "Zsh hackers list" Subject: Re: functrace and funcsourcetrace (was Re: PATCH: trace information for sourced files) Message-ID: <20080822163335.5153f1be@news01> In-Reply-To: <237967ef0808180413q6a98d584k7cd0be52c07550ef@mail.gmail.com> References: <6cd6de210808121700kf500ea6p9b3eed0fefadfc8@mail.gmail.com> <20080813204212.4c72c96a@pws-pc> <20080813214318.09f570e7@pws-pc> <20080813220528.24263eb3@pws-pc> <237967ef0808180413q6a98d584k7cd0be52c07550ef@mail.gmail.com> Organization: CSR X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.8; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 22 Aug 2008 15:33:35.0404 (UTC) FILETIME=[70E896C0:01C9046C] X-Scanned-By: MailControl A-08-50-13 (www.mailcontrol.com) on 10.68.0.126 X-Virus-Scanned: ClamAV 0.92.1/8073/Fri Aug 22 14:48:21 2008 on bifrost X-Virus-Status: Clean On Mon, 18 Aug 2008 13:13:39 +0200 "Mikael Magnusson" wrote: > The current cvs zsh crashes for me on any tabcompletion now iff i've > done a zcompile on the functions dir in /usr/local/share/zsh/blabla. > The first commit with the crash is "25247 with further modifications: > add $funcsourcetrace": > > % cd > Program received signal SIGSEGV, Segmentation fault. > 0x41b6624b in strlen () from /lib/libc.so.6 > (gdb) bt > #0 0x41b6624b in strlen () from /lib/libc.so.6 > #1 0x080bfb10 in dupstring (s=0x3cff9c3
bounds>) at string.c:39 > #2 0x08073673 in execautofn (state=0xaf92bf1c, do_exec=0) at exec.c:4075 Looking at this part of the trace, I wonder if this is the problem? We could do with some tests for zcompile. Index: Src/exec.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/exec.c,v retrieving revision 1.139 diff -u -r1.139 exec.c --- Src/exec.c 11 Aug 2008 19:22:54 -0000 1.139 +++ Src/exec.c 22 Aug 2008 15:32:16 -0000 @@ -4405,8 +4405,11 @@ sprintf(buf, "%s/%s", *pp, s); else strcpy(buf, s); - if ((r = try_dump_file(*pp, s, buf, ksh))) + if ((r = try_dump_file(*pp, s, buf, ksh))) { + if (fname) + *fname = ztrdup(buf); return r; + } unmetafy(buf, NULL); if (!access(buf, R_OK) && (fd = open(buf, O_RDONLY | O_NOCTTY)) != -1) { if ((len = lseek(fd, 0, 2)) != -1) { -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070