zsh-workers
 help / color / mirror / code / Atom feed
* Yank-pop Dumps Core
@ 2003-02-26  3:13 Vin Shelton
  2003-02-27 11:24 ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Vin Shelton @ 2003-02-26  3:13 UTC (permalink / raw)
  To: zsh-workers

In the latest CVS sources, the following recipe dumps core:

zsh -f
bindkey -e
asdf^A^K^Y<esc>y

Popping one too many yanks off the stack causes a crash.

Here is the backtrace:

Loaded symbols for /home/acs/zsh-debug/lib/zsh/4.1.0-dev-7/zsh/compctl.so
#0  0x4020a97d in yankpop (args=0x40225250) at /opt/src/zsh-2003-02-25-1603/Src/Zle/zle_misc.c:413
413         } while (!buf->buf || !*buf->buf);
(gdb) bt
#0  0x4020a97d in yankpop (args=0x40225250) at /opt/src/zsh-2003-02-25-1603/Src/Zle/zle_misc.c:413
#1  0x40207ca2 in execzlefunc (func=0x402241d0, args=0x40225250)
    at /opt/src/zsh-2003-02-25-1603/Src/Zle/zle_main.c:892
#2  0x402073f3 in zlecore () at /opt/src/zsh-2003-02-25-1603/Src/Zle/zle_main.c:690
#3  0x40207977 in zleread (lp=0x80e17d0 "%m%# ", rp=0x0, flags=3)
    at /opt/src/zsh-2003-02-25-1603/Src/Zle/zle_main.c:824
#4  0x0807c560 in inputline () at /opt/src/zsh-2003-02-25-1603/Src/input.c:275
#5  0x0807c41c in ingetc () at /opt/src/zsh-2003-02-25-1603/Src/input.c:214
#6  0x080740c9 in ihgetc () at /opt/src/zsh-2003-02-25-1603/Src/hist.c:241
#7  0x080825e4 in gettok () at /opt/src/zsh-2003-02-25-1603/Src/lex.c:631
#8  0x08081ea3 in yylex () at /opt/src/zsh-2003-02-25-1603/Src/lex.c:347
#9  0x080997c7 in parse_event () at /opt/src/zsh-2003-02-25-1603/Src/parse.c:449
#10 0x0807953f in loop (toplevel=1, justonce=0) at /opt/src/zsh-2003-02-25-1603/Src/init.c:128
#11 0x0807c090 in zsh_main (argc=2, argv=0xbffffa54) at /opt/src/zsh-2003-02-25-1603/Src/init.c:1266
#12 0x080516da in main (argc=2, argv=0xbffffa54) at /opt/src/zsh-2003-02-25-1603/Src/main.c:37
#13 0x400bb082 in __libc_start_main () from /lib/i686/libc.so.6

zsh-4.0.6 does not seem to have this problem.

This is on my x86 Linux box at home; uname -a reports:

Linux zion.rcn.com 2.4.19-24acs #4 SMP Tue Feb 25 20:10:27 EST 2003
i686 unknown unknown GNU/Linux


HTH,
  Vin


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

* Re: Yank-pop Dumps Core
  2003-02-26  3:13 Yank-pop Dumps Core Vin Shelton
@ 2003-02-27 11:24 ` Peter Stephenson
  2003-02-28  0:44   ` Vin Shelton
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Stephenson @ 2003-02-27 11:24 UTC (permalink / raw)
  To: zsh-workers

Vin Shelton wrote:
> In the latest CVS sources, the following recipe dumps core:
> 
> zsh -f
> bindkey -e
> asdf^A^K^Y<esc>y

Thanks for spotting this.  Here's cant_yankpop_if_no_kring.dif.

You should find the bug only happened if you'd done exactly one kill.

Index: Src/Zle/zle_misc.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_misc.c,v
retrieving revision 1.7
diff -u -r1.7 zle_misc.c
--- Src/Zle/zle_misc.c	27 Jan 2003 14:55:00 -0000	1.7
+++ Src/Zle/zle_misc.c	27 Feb 2003 11:22:49 -0000
@@ -372,7 +372,7 @@
     int cc, kctstart = kct;
     Cutbuffer buf;
 
-    if (!(lastcmd & ZLE_YANK))
+    if (!(lastcmd & ZLE_YANK) || !kring)
 	return 1;
     do {
 	/*

-- 
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] 3+ messages in thread

* Re: Yank-pop Dumps Core
  2003-02-27 11:24 ` Peter Stephenson
@ 2003-02-28  0:44   ` Vin Shelton
  0 siblings, 0 replies; 3+ messages in thread
From: Vin Shelton @ 2003-02-28  0:44 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh-workers

Peter Stephenson <pws@csr.com> writes:
> Vin Shelton wrote:
>> In the latest CVS sources, the following recipe dumps core:
>> 
>> zsh -f
>> bindkey -e
>> asdf^A^K^Y<esc>y
>
> Thanks for spotting this.  Here's cant_yankpop_if_no_kring.dif.
>
> You should find the bug only happened if you'd done exactly one kill.
>
> Index: Src/Zle/zle_misc.c
> ===================================================================
> RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_misc.c,v
> retrieving revision 1.7
> diff -u -r1.7 zle_misc.c
> --- Src/Zle/zle_misc.c	27 Jan 2003 14:55:00 -0000	1.7
> +++ Src/Zle/zle_misc.c	27 Feb 2003 11:22:49 -0000
> @@ -372,7 +372,7 @@
>      int cc, kctstart = kct;
>      Cutbuffer buf;
>  
> -    if (!(lastcmd & ZLE_YANK))
> +    if (!(lastcmd & ZLE_YANK) || !kring)
>  	return 1;
>      do {
>  	/*
>
> -- 
> 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.
> **********************************************************************

Peter, yes that worked.  Thanks!

  - Vin


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

end of thread, other threads:[~2003-02-28  0:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-26  3:13 Yank-pop Dumps Core Vin Shelton
2003-02-27 11:24 ` Peter Stephenson
2003-02-28  0:44   ` Vin Shelton

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