Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: functrace and funcsourcetrace (was Re: PATCH: trace information for sourced files)



On Mon, 18 Aug 2008 13:13:39 +0200
"Mikael Magnusson" <mikachu@xxxxxxxxx> 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@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070



Messages sorted by: Reverse Date, Date, Thread, Author