tcsh and !#:q in alias postcmd

From: Anton Yuzhaninov <citrin_at_citrin.ru>
Date: Mon, 19 Mar 2007 10:09:45 +0300
Hello All.

In tcsh 6.14.00 this alias (which useful under screen) work fine:

alias postcmd 'echo -n "\033k\!#:q\033\\"'

But under tcsh 6.15.00 it segfault.

To repeat just set this alias and try to type any command, e. g. top

gdb -c tcsh.core /usr/obj/data/usr/src/bin/csh/csh
....
(gdb) bt
#0  0x28188400 in wcslen () from /lib/libc.so.7
#1  0x00000000 in ?? ()
#2  0x0808a440 in Strbuf_append (buf=0x80981d4, s=0x0) at /data/usr/src/bin/csh/../../contrib/tcsh/tc.str.c:599
#3  0x0805fb3d in getsub (en=0x80a97f8) at /data/usr/src/bin/csh/../../contrib/tcsh/sh.lex.c:854
#4  0x0805f5f9 in getexcl (sc=0) at /data/usr/src/bin/csh/../../contrib/tcsh/sh.lex.c:731
#5  0x0805ea17 in getC1 (flag=3) at /data/usr/src/bin/csh/../../contrib/tcsh/sh.lex.c:469
#6  0x0805e7f9 in word (parsehtime=0) at /data/usr/src/bin/csh/../../contrib/tcsh/sh.lex.c:413
#7  0x0805e116 in lex (hp=0xbfbfe4a0) at /data/usr/src/bin/csh/../../contrib/tcsh/sh.lex.c:185
#8  0x08062b43 in asyn3 (p1=0x80c7528, p2=0xbfbfe590) at /data/usr/src/bin/csh/../../contrib/tcsh/sh.parse.c:159
#9  0x08062a33 in asyn0 (p1=0x80c7528, p2=0xbfbfe590) at /data/usr/src/bin/csh/../../contrib/tcsh/sh.parse.c:122
#10 0x080628d2 in asyntax (p1=0x80c7528, p2=0xbfbfe590) at /data/usr/src/bin/csh/../../contrib/tcsh/sh.parse.c:78
#11 0x0806288c in alias (lexp=0xbfbfe590) at /data/usr/src/bin/csh/../../contrib/tcsh/sh.parse.c:70
#12 0x08085aca in aliasrun (cnt=1, s1=0x8095920, s2=0x0) at /data/usr/src/bin/csh/../../contrib/tcsh/tc.func.c:986
#13 0x0808561d in postcmd () at /data/usr/src/bin/csh/../../contrib/tcsh/tc.func.c:824
#14 0x0804cf25 in process (catch=1) at /data/usr/src/bin/csh/../../contrib/tcsh/sh.c:2010
#15 0x0804bd82 in main (argc=0, argv=0xbfbfe860) at /data/usr/src/bin/csh/../../contrib/tcsh/sh.c:1304
(gdb) f 3
#3  0x0805fb3d in getsub (en=0x80a97f8) at /data/usr/src/bin/csh/../../contrib/tcsh/sh.lex.c:854
854             Strbuf_append(&slhs, lhsb.s);
(gdb) p slhs
$1 = {s = 0x0, len = 0, size = 0}
(gdb) p lhsb
$2 = {s = 0x0, len = 0, size = 0}

-- 
 WBR,
 Anton Yuzhaninov.
Received on Mon Mar 19 2007 - 06:22:13 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:06 UTC