zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: "Zsh hackers list" <zsh-workers@sunsite.dk>
Subject: Re: zsh 4.3.4 released
Date: Mon, 23 Apr 2007 17:40:29 +0100	[thread overview]
Message-ID: <20070423174029.1e8293a9.pws@csr.com> (raw)
In-Reply-To: <237967ef0704230900r21af3aa1od42cd0b41abe2251@mail.gmail.com>

"Mikael Magnusson" <mikachu@gmail.com> 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@csr.com>                  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


  reply	other threads:[~2007-04-23 16:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200704161647.l3GGl2FE027950@news01.csr.com>
     [not found] ` <20070419120758.e9774528.pws@csr.com>
2007-04-19 19:44   ` Paul Ackersviller
     [not found]   ` <237967ef0704201440g1c072ca8l451439d2ec8578bf@mail.gmail.com>
     [not found]     ` <20070423104151.1f5f368e.pws@csr.com>
     [not found]       ` <237967ef0704230550k41ddb13fy60deebd526ecc5ec@mail.gmail.com>
2007-04-23 13:18         ` Peter Stephenson
2007-04-23 14:22           ` Mikael Magnusson
2007-04-23 15:06             ` Peter Stephenson
2007-04-23 16:00               ` Mikael Magnusson
2007-04-23 16:40                 ` Peter Stephenson [this message]
2007-04-23 17:07                   ` Peter Stephenson
2007-04-23 17:18                   ` Mikael Magnusson
2007-04-23 16:07               ` Mikael Magnusson
     [not found]         ` <BB046CA812535C45BD0029AA9D04BA79C66F39@KL-SRV57.lmsintl.com>
2007-04-23 14:01           ` Peter Stephenson
     [not found]             ` <BB046CA812535C45BD0029AA9D04BA79C66F72@KL-SRV57.lmsintl.com>
2007-04-23 15:14               ` Peter Stephenson

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=20070423174029.1e8293a9.pws@csr.com \
    --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).