zsh-workers
 help / color / mirror / code / Atom feed
* [nicolas.george@ens.fr: Bug#187259: Zsh: segmentation fault with vared]
@ 2003-05-10 14:50 Clint Adams
  2003-05-12 11:27 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Clint Adams @ 2003-05-10 14:50 UTC (permalink / raw)
  To: zsh-workers; +Cc: 187259-forwarded, Nicolas George

I can reproduce this on 4.0.6, 4.1.1-test-{1,2} on Debian.
No segfault with 4.1.1-test-1 on Solaris 9.

#0  0x400fe299 in free () from /lib/libc.so.6
#1  0x403bfef4 in zleread () from /usr/lib/zsh/4.0.6/zsh/zle.so
#2  0x403c0ce3 in execzlefunc () from /usr/lib/zsh/4.0.6/zsh/zle.so
#3  0x08051a37 in execbuiltin ()
#4  0x0805ffeb in execsubst ()
#5  0x0805eb3f in execlist ()
#6  0x0805e125 in execlist ()
#7  0x0805deab in execlist ()
#8  0x0805da23 in execode ()
#9  0x0806e2a6 in loop ()
#10 0x08070770 in zsh_main ()
#11 0x08051477 in main ()
#12 0x400aaa51 in __libc_start_main () from /lib/libc.so.6

----- Forwarded message from Nicolas George <nicolas.george@ens.fr> -----

Date: Wed, 2 Apr 2003 13:24:50 +0200
From: Nicolas George <nicolas.george@ens.fr>
To: submit@bugs.debian.org
Subject: Bug#187259: Zsh: segmentation fault with vared

Package: zsh
Version: 4.0.6-30

cigaes@ssecem ~ $ zsh
cigaes@ssecem ~ $ l=(); vared l
zsh: segmentation fault  zsh

The problem does not depend on my config files, since it is still there
if I disable them all (chmod 700 /etc/zsh and HOME=/dev/null; strace
proves me it really does not find them).

This command works fine with zsh 4.0.6-13 with exactly the same orhers
packages.

Package: debconf
Version: 1.2.32

Package: libc6
Version: 2.3.1-16

Package: libcap1
Version: 1:1.10-12

Package: libncurses5
Version: 5.3.20021109-2

Linux ssecem 2.4.20 #1 Tue Apr 1 14:48:59 CEST 2003 i686 AMD Athlon(tm) Processor AuthenticAMD GNU/Linux

(Yes, I changed my kernel yesterday (ptrace bug), but since 4.0.6-13
does not segfault, I do not think it is the problem)

----- End forwarded message -----


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [nicolas.george@ens.fr: Bug#187259: Zsh: segmentation fault with vared]
  2003-05-10 14:50 [nicolas.george@ens.fr: Bug#187259: Zsh: segmentation fault with vared] Clint Adams
@ 2003-05-12 11:27 ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2003-05-12 11:27 UTC (permalink / raw)
  To: zsh-workers, 187259-forwarded; +Cc: Nicolas George

Clint Adams wrote:
> ----- Forwarded message from Nicolas George <nicolas.george@ens.fr> -----
> 
> Date: Wed, 2 Apr 2003 13:24:50 +0200
> From: Nicolas George <nicolas.george@ens.fr>
> To: submit@bugs.debian.org
> Subject: Bug#187259: Zsh: segmentation fault with vared
> 
> Package: zsh
> Version: 4.0.6-30
> 
> cigaes@ssecem ~ $ zsh
> cigaes@ssecem ~ $ l=(); vared l
> zsh: segmentation fault  zsh

I think this is the most consistent fix, but if anyone else thinks all
the undocumented calls to the undocumented sepjoin interface require a
non-zalloc'd value in the special case where the array is NULL I can
rethink.  (In case you are in any doubt this is expecting the answer
`no'.)

Index: Src/utils.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/utils.c,v
retrieving revision 1.49
diff -u -r1.49 utils.c
--- Src/utils.c	2 May 2003 10:25:33 -0000	1.49
+++ Src/utils.c	12 May 2003 11:20:14 -0000
@@ -2050,7 +2050,7 @@
     char sepbuf[3];
 
     if (!*s)
-	return "";
+	return heap ? "" : ztrdup("");
     if (!sep) {
 	sep = sepbuf;
 	sepbuf[0] = *ifs;

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
prohibited.  
If you received this in error, please contact the sender and 
delete the material from any computer.
**********************************************************************


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-05-12 11:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-10 14:50 [nicolas.george@ens.fr: Bug#187259: Zsh: segmentation fault with vared] Clint Adams
2003-05-12 11:27 ` Peter Stephenson

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).