zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: "Zsh hackers list" <zsh-workers@sunsite.dk>
Subject: Re: functrace and funcsourcetrace (was Re: PATCH: trace information for sourced files)
Date: Fri, 22 Aug 2008 16:33:35 +0100	[thread overview]
Message-ID: <20080822163335.5153f1be@news01> (raw)
In-Reply-To: <237967ef0808180413q6a98d584k7cd0be52c07550ef@mail.gmail.com>

On Mon, 18 Aug 2008 13:13:39 +0200
"Mikael Magnusson" <mikachu@gmail.com> 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<tab>
> 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 <Address 0x3cff9c3 out of
> 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 <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


  parent reply	other threads:[~2008-08-22 15:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-13  0:00 Rocky Bernstein
2008-08-13 19:42 ` Peter Stephenson
2008-08-13 20:43   ` Peter Stephenson
2008-08-13 21:05     ` Peter Stephenson
2008-08-13 22:06       ` Rocky Bernstein
2008-08-18 11:13       ` Mikael Magnusson
2008-08-21 15:31         ` Peter Stephenson
2008-08-21 20:21           ` Mikael Magnusson
2008-08-22 15:33         ` Peter Stephenson [this message]
2008-08-22 15:48           ` Mikael Magnusson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080822163335.5153f1be@news01 \
    --to=pws@csr.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).