Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: 3.1.6-pws-6: $compstate[unambiguous] could be garbage



> One thing I tried while figuring out what was going on for the patch above
> was inserting
> 
> noglob print -l x"${(@kv)^compstate}"x
> 
> immediately before line 92.  That would at least tell you which assoc key
> has the bad value.

Beware, this is long:

zsh/2 7 % a2ps --prexnormal_nmatchesx
x1x
xnmatchesx
x1x
xrestorex
xautox
xcontextx
xcommandx
xvaredx
xx
xunambiguousx
x--pretty-printx
xlist_maxx
x100x
xunambiguous_cursorx
x15x
xlistx
xambiguousx
xtotal_matchersx
x0x
xexactx
xacceptx
xto_endx
xmatchx
xlast_promptx
xyesx
xpattern_insertx
xmenux
xmatcher_stringx
xx
xmatcherx
x0x
xinsertx
xmenux
tty-print=

and then

tty-print=xnormal_nmatchesx
x0x
xnmatchesx
x0x
xpattern_matchx
x*x
xrestorex
xautox
xcontextx
xcommandx
xvaredx
xx
xunambiguousx
xx
xlist_maxx
x100x
xunambiguous_cursorx
x1x
xlistx
xambiguousx
xtotal_matchersx
x0x
xexactx
xacceptx
xto_endx
xmatchx
xlast_promptx
xyesx
xpattern_insertx
xmenux
xmatcher_stringx
xx
xmatcherx
x0x
xinsertx
xmenux

and then

xnormal_nmatchesx
x0x
xnmatchesx
x0x
xpattern_matchx
x*x
xrestorex
xautox
xcontextx
xcommandx
xvaredx
xx
xunambiguousx
xx
xlist_maxx
x100x
xunambiguous_cursorx
x1x
xlistx
xambiguousx
xtotal_matchersx
x0x
xexactx
xacceptx
xto_endx
xmatchx
xlast_promptx
xyesx
xpattern_insertx
xmenux
xmatcher_stringx
xx
xmatcherx
x0x
xinsertx
xmenux

and then

xnormal_nmatchesx
x0x
xnmatchesx
x0x
xpattern_matchx
x*x
xrestorex
xautox
xcontextx
xcommandx
xvaredx
xx
xunambiguousx
x0Tu@0Tu@ox  <-----------------------------
xlist_maxx
x100x
xunambiguous_cursorx
x1x
xlistx
xambiguousx
xtotal_matchersx
x0x
xexactx
xacceptx
xto_endx
xmatchx
xlast_promptx
xyesx
xpattern_insertx
xmenux
xmatcher_stringx
xx
xmatcherx
x0x
xinsertx
xmenux


And from gdb

a2ps --pre<TAB>

Breakpoint 1, unambig_data (cp=0x0) at zle_tricky.c:7956
7956                zsfree(scache);
(gdb) display mnum
1: mnum = 1
(gdb) display unambig_mnum
2: unambig_mnum = -1
(gdb) display ainfo
3: ainfo = 0x8103020
(gdb) display scache
4: scache = 0x0

(gdb) continue
Continuing.
tty-print=

[dozens of <TAB>s and nothing]


And again with breakpoint set to two lines earlier:

zsh/2 1 % a2ps --pre
Breakpoint 1, unambig_data (cp=0x0) at zle_tricky.c:7954
7954        if (mnum && ainfo) {
3: ainfo = 0x8103020
2: unambig_mnum = -1
1: mnum = 1
(gdb) display scache
4: scache = 0x0
(gdb) 
(gdb) continue
Continuing.

Breakpoint 1, unambig_data (cp=0xbfffe6d4) at zle_tricky.c:7954
7954        if (mnum && ainfo) {
4: scache = 0x823d650 "--pretty-print"
3: ainfo = 0x8103020
2: unambig_mnum = 1
1: mnum = 1
(gdb) continue
Continuing.
tty-print=
[TAB]
Breakpoint 1, unambig_data (cp=0x0) at zle_tricky.c:7954
7954        if (mnum && ainfo) {
4: scache = 0x823d650 "--pretty-print"
3: ainfo = 0x8103038
2: unambig_mnum = -1
1: mnum = 0
(gdb) continue
Continuing.

Breakpoint 1, unambig_data (cp=0xbfffeba4) at zle_tricky.c:7954
7954        if (mnum && ainfo) {
4: scache = 0x81232f0 ""
3: ainfo = 0x8103038
2: unambig_mnum = 0
1: mnum = 0
(gdb) continue
Continuing.
[TAB]

Breakpoint 1, unambig_data (cp=0x0) at zle_tricky.c:7954
7954        if (mnum && ainfo) {
4: scache = 0x81232f0 ""
3: ainfo = 0x8103050
2: unambig_mnum = -1
1: mnum = 0
(gdb) continue
Continuing.

Breakpoint 1, unambig_data (cp=0xbfffeba4) at zle_tricky.c:7954
7954        if (mnum && ainfo) {
4: scache = 0x8122f70 ""
3: ainfo = 0x8103050
2: unambig_mnum = 0
1: mnum = 0
(gdb) continue
Continuing.

Breakpoint 1, unambig_data (cp=0x0) at zle_tricky.c:7954
7954        if (mnum && ainfo) {
4: scache = 0x8122f70 ""
3: ainfo = 0x8103068
2: unambig_mnum = -1
1: mnum = 0

and so on.

I now conclude that I have been stupid and failed to install zle.so after
patching and that the corruption no longer seems to occur.

Nevertheless, --pretty-print still doesn't complete.  See next message.



Messages sorted by: Reverse Date, Date, Thread, Author