From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10980 invoked from network); 18 Sep 2006 02:20:51 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.5 (2006-08-29) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 18 Sep 2006 02:20:51 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 46779 invoked from network); 18 Sep 2006 02:20:44 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 18 Sep 2006 02:20:44 -0000 Received: (qmail 22986 invoked by alias); 18 Sep 2006 02:20:38 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22733 Received: (qmail 22977 invoked from network); 18 Sep 2006 02:20:38 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 18 Sep 2006 02:20:38 -0000 Received: (qmail 46175 invoked from network); 18 Sep 2006 02:20:38 -0000 Received: from vms042pub.verizon.net (206.46.252.42) by a.mx.sunsite.dk with SMTP; 18 Sep 2006 02:20:36 -0000 Received: from torch.brasslantern.com ([71.116.118.106]) by vms042.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPA id <0J5R00KY2NUAIG41@vms042.mailsrvcs.net> for zsh-workers@sunsite.dk; Sun, 17 Sep 2006 21:20:35 -0500 (CDT) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id k8I2KYtO000788 for ; Sun, 17 Sep 2006 19:20:34 -0700 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id k8I2KXaQ000787 for zsh-workers@sunsite.dk; Sun, 17 Sep 2006 19:20:33 -0700 Date: Sun, 17 Sep 2006 19:20:31 -0700 From: Bart Schaefer Subject: Re: PATCH: functrace [was Re: funcstack and backtraces] In-reply-to: <20060917233845.GA32023@scowler.net> To: zsh-workers@sunsite.dk Message-id: <060917192033.ZM786@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <20060901191034.GA31335@scowler.net> <060904142643.ZM9472@torch.brasslantern.com> <20060917191418.GA22898@scowler.net> <060917155254.ZM312@torch.brasslantern.com> <20060917233845.GA32023@scowler.net> Comments: In reply to Clint Adams "Re: PATCH: functrace [was Re: funcstack and backtraces]" (Sep 17, 7:38pm) On Sep 17, 7:38pm, Clint Adams wrote: } Subject: Re: PATCH: functrace [was Re: funcstack and backtraces] } } > Adding an extra level of function stack avoids the crash, but this } > still doesn't look right to me: } } What crash? zsh-workers/22730 } > schaefer<506> (baz() { bar }; } > bar() { foo } ; } > foo() { print $functrace } ; } > baz ) } > bar:0 baz:0 Src/zsh:bar:0 } } > What does that it mean that "bar" is at both ends of the stack? } } I can't reproduce that. I get } bar:0 baz:0 Src/zsh:6 } (or Src/zsh:0 Src/zsh:0 Src/Zsh:12) I suspect there's somewhere that you're calling dupstring() on a hunk of memory that isn't really nul-terminated. } > You're right about it being buggy when functionargzero is not set. } > Even the examples above that don't crash when it is set, crash when } > it is not set (with effectively the same backtrace). } } I can't reproduce that either. torch% unsetopt functionargzero torch% (baz() { bar }; bar() { foo } ; foo() { print $functrace } ; baz ) zsh: segmentation fault (core dumped) (; baz () { ... }; bar () { ... }; foo () { ... }; baz; ) torch% gdb Src/zsh core.771 (gdb) where #0 0x001e3de6 in strcpy () from /lib/tls/libc.so.6 #1 0x080aa616 in dupstring ( s=0xb7cdde40 "Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:"...) at ../../zsh-4.0/Src/string.c:40 [...] (gdb) run -f Starting program: /usr/local/src/zsh/Src/zsh -f torch% baz() { bar }; torch% bar() { foo } ; torch% foo() { print $functrace } ; torch% baz bar:0 baz:0 /usr/locbar:0 torch% unsetopt functionargzero torch% baz Program received signal SIGSEGV, Segmentation fault. 0x001e3de6 in strcpy () from /lib/tls/libc.so.6 (gdb) where #0 0x001e3de6 in strcpy () from /lib/tls/libc.so.6 #1 0x080aa616 in dupstring ( s=0xb7d76350 "/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc"...) at ../../zsh-4.0/Src/string.c:40 [...] --