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

Re: zsh 4.3.4 released



"Mikael Magnusson" <mikachu@xxxxxxxxx> wrote:
> > Is it possibly you have old wordcode for the dot file that might define
> > svmode?  (Obviously the shell should be robust even if this is the case;
> > since the wordcode has a version stamp this shouldn't happen with a
> > released version of the shell.)
> 
> Aha, this seems to have been the problem. I renamed my .zshurxvt.zwc
> and it doesn't crash anymore. I always run zrecompile -p on all my .z*
> files after upgrading zsh but apparently it only takes effect if the
> .file is newer than the .file.zwc, maybe it should also take effect if
> $SHELL is newer than the .zwc?

I think I've found the problem: parse.c doesn't get recompiled when
version.h changes, so zcompile might output the wrong version, so the shell
can't check properly when the ZWC file is loaded.

Luckily, this won't happen if the shell is built from scratch, so it
doesn't affect the fast majority of installed versions.

I think the fix is as simple as changing the dependency, though I decided I
felt happier if the header for the ZWC file had uninitialised bits set to
null bytes rather than (say) the password that was lying around in
memory.

Thanks for your help.

Index: Src/parse.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/parse.c,v
retrieving revision 1.60
diff -u -r1.60 parse.c
--- Src/parse.c	19 Jan 2007 21:36:03 -0000	1.60
+++ Src/parse.c	23 Apr 2007 16:36:30 -0000
@@ -2693,6 +2693,8 @@
     if (map == 1)
 	map = (tlen >= FD_MINMAP);
 
+    memset(pre, 0, sizeof(wordcode) * FD_PRELEN)
+
     for (ohlen = hlen; ; hlen = ohlen) {
 	fdmagic(pre) = (other ? FD_OMAGIC : FD_MAGIC);
 	fdsetflags(pre, ((map ? FDF_MAP : 0) | other));
Index: Src/zsh.mdd
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/zsh.mdd,v
retrieving revision 1.15
diff -u -r1.15 zsh.mdd
--- Src/zsh.mdd	21 Jan 2007 22:47:41 -0000	1.15
+++ Src/zsh.mdd	23 Apr 2007 16:36:30 -0000
@@ -31,7 +31,7 @@
 
 init.o: bltinmods.list zshpaths.h zshxmods.h
 
-init.o params.o: version.h
+init.o params.o parse.o: version.h
 
 version.h: $(sdir_top)/Config/version.mk
 	echo '#define ZSH_VERSION "'$(VERSION)'"' > $@


-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php

To get further information regarding CSR, please visit our Investor Relations page at http://ir.csr.com/csr/about/overview



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