zsh-workers
 help / color / mirror / code / Atom feed
* describe-key-briefly crashes in cvs
@ 2008-04-28 18:26 Mikael Magnusson
  2008-04-29  8:40 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Mikael Magnusson @ 2008-04-28 18:26 UTC (permalink / raw)
  To: zsh-workers

% gdb --args zsh -f
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) run
Starting program: /usr/local/bin/zsh -f
fartmonstret% <alt-x descr<tab>><enter>
Program received signal SIGSEGV, Segmentation fault.
                           0x080ce992 in unmetafy (s=0xa7b4bc2a
"Describe key briefly: _", len=0xafed5930) at utils.c:3592
3592	    for (t = p; (*t = *p++);)
(gdb) bt
#0  0x080ce992 in unmetafy (s=0xa7b4bc2a "Describe key briefly: _",
len=0xafed5930)
    at utils.c:3592
#1  0xa7b43c3e in stringaszleline (instr=0xa7b4bc2a "Describe key
briefly: _", incs=0,
    outll=0xafed59b0, outsz=0xafed59ac, outcs=0x0) at zle_utils.c:311
#2  0xa7b362db in zrefresh () at zle_refresh.c:1423
#3  0xa7b2d201 in describekeybriefly (args=0xa7b51c7c) at zle_main.c:1640
#4  0xa7b2bb57 in execzlefunc (func=0xa7b4fb00, args=0xa7b51c7c,
set_bindk=0) at zle_main.c:1298
#5  0xa7b2b030 in zlecore () at zle_main.c:1043
#6  0xa7b2b733 in zleread (lp=0x80f18fc, rp=0x0, flags=3, context=0)
at zle_main.c:1205
#7  0x080868a3 in autoload_zleread (lp=0x80f18fc, rp=0x0, ha=3, con=0)
at init.c:1221
#8  0x0808712e in inputline () at input.c:278
#9  0x08086fad in ingetc () at input.c:214
#10 0x0807d536 in ihgetc () at hist.c:240
#11 0x0808f2a3 in gettok () at lex.c:663
#12 0x0808eb2e in yylex () at lex.c:350
#13 0x080ab009 in parse_event () at parse.c:451
#14 0x0808406b in loop (toplevel=1, justonce=0) at init.c:129
#15 0x08086be1 in zsh_main (argc=2, argv=0xafed6004) at init.c:1352
#16 0x08055076 in main (argc=0, argv=0x0) at ./main.c:93


-- 
Mikael Magnusson


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

* Re: describe-key-briefly crashes in cvs
  2008-04-28 18:26 describe-key-briefly crashes in cvs Mikael Magnusson
@ 2008-04-29  8:40 ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2008-04-29  8:40 UTC (permalink / raw)
  To: zsh-workers

Probably I should never have made unmetafying in place the default
behaviour for stringaszleline().

Index: Src/Zle/zle_refresh.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_refresh.c,v
retrieving revision 1.62
diff -u -r1.62 zle_refresh.c
--- Src/Zle/zle_refresh.c	26 Apr 2008 22:52:51 -0000	1.62
+++ Src/Zle/zle_refresh.c	29 Apr 2008 08:38:08 -0000
@@ -1418,8 +1418,9 @@
 
     if (statusline) {
 	int outll, outsz;
+	char *statusdup = ztrdup(statusline);
 	ZLE_STRING_T outputline =
-	    stringaszleline(statusline, 0, &outll, &outsz, NULL); 
+	    stringaszleline(statusdup, 0, &outll, &outsz, NULL); 
 
 	rpms.tosln = rpms.ln + 1;
 	nbuf[rpms.ln][winw + 1] = zr_zr;	/* text not wrapped */
@@ -1484,6 +1485,7 @@
 	    snextline(&rpms);
 	}
 	zfree(outputline, outsz);
+	free(statusdup);
     }
     *rpms.s = zr_zr;
 


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


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

end of thread, other threads:[~2008-04-29  8:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-28 18:26 describe-key-briefly crashes in cvs Mikael Magnusson
2008-04-29  8:40 ` 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).