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

crash in completing code with unicode support



I tried the recent developments with unicode support, and it's going
pretty well. I can write text in zle without it showing up as
^{saa'*^+{^ instaed of actual text. Backspacing over doublewidth
characters only steps back one cell, but i understand this has not
been worked on yet. One problem i have encountered though, is if i
have a couple file that starts with the same multibyte character (it
seems to be important that it is at the very beginning of the name),
and then different endings, zsh crashes when i try to tabcomplete
them. An obvious case where this happens is tabcompleting mp3 files
where the artist's name starts with Ø (a danish capital O with a /
through it, any of åäöæøÅÄÖÆØ seems to do the same thing too).
The simplest testcase i could find is to create an empty directory,
and in it creaty two files, Øa and Øb. Just typing ls <tab> gives ls
Ø, and the second <tab> crashes zsh (backtrace at the end of mail).
Zsh crashes both if in a singlebyte locale and a doublebyte locale,
the important thing is the actual filename is utf-8.

backtrace:
% touch Øa
% touch Øb
%  ls<tab>
Øa  Øb
% ls Ø<tab>
Program received signal SIGSEGV, Segmentation fault.
ztrsub (t=0x82badca "", s=0x82d6000 <Address 0x82d6000 out of bounds>)
at utils.c:3059
3059		if (*s++ == Meta) {
(gdb) bt
#0  ztrsub (t=0x82badca "", s=0x82d6000 <Address 0x82d6000 out of
bounds>) at utils.c:3059
#1  0x080c42a4 in pattryrefs (prog=0x82bb738, string=0x82badc8
"Ã\203", stringlen=2, unmetalen=-1,
    patoffset=0, nump=0x0, begp=0x0, endp=0x0) at pattern.c:1586
#2  0x080c4548 in pattry (prog=0x0, string=0x0) at pattern.c:1511
#3  0xa7d11f96 in do_comp_vars (test=184, na=1, sa=0xa7a27970 "\213",
nb=137080266,
    sb=0xa7a27970 "\213", mod=1) at complete.c:831
#4  0xa7d12334 in bin_compset (name=0xa7a27970 "\213",
argv=0xffffffe5, ops=0xaffee090, func=0)
    at complete.c:969
#5  0x08052fb4 in execbuiltin (args=0xaffee090, bn=0xa7d29ba4) at builtin.c:439
#6  0x0807054e in execcmd (state=0xafffddf0, input=0, output=0,
how=18, last1=2) at exec.c:2558
#7  0x08070e65 in execpline2 (state=0xafffddf0, pcode=0, how=18,
input=0, output=0, last1=0)
    at exec.c:1289
#8  0x08071433 in execpline (state=0xafffddf0, slcode=137191424,
how=18, last1=0) at exec.c:1075
#9  0x08072da3 in execlist (state=0xafffddf0, dont_change_job=1,
exiting=0) at exec.c:881
#10 0x08099440 in execif (state=0xafffddf0, do_exec=0) at loop.c:505
#11 0x0806f070 in execcmd (state=0xafffddf0, input=0, output=0,
how=18, last1=2) at exec.c:2505
#12 0x08070e65 in execpline2 (state=0xafffddf0, pcode=0, how=18,
input=0, output=0, last1=0)
    at exec.c:1289
#13 0x08071433 in execpline (state=0xafffddf0, slcode=137191424,
how=18, last1=0) at exec.c:1075
#14 0x08072da3 in execlist (state=0xafffddf0, dont_change_job=1,
exiting=0) at exec.c:881
#15 0x080994e5 in execif (state=0xafffddf0, do_exec=0) at loop.c:520
#16 0x0806f070 in execcmd (state=0xafffddf0, input=0, output=0, how=2,
last1=2) at exec.c:2505
#17 0x08070e65 in execpline2 (state=0xafffddf0, pcode=0, how=2,
input=0, output=0, last1=0)
    at exec.c:1289
#18 0x08071433 in execpline (state=0xafffddf0, slcode=137191424,
how=2, last1=0) at exec.c:1075
#19 0x08072da3 in execlist (state=0xafffddf0, dont_change_job=1,
exiting=0) at exec.c:881
#20 0x0807308a in runshfunc (prog=0x82b71d0, wrap=0x82b71d0,
name=0xa7a26030 "_main_complete")
    at exec.c:781
#21 0xa7d12d7a in comp_wrapper (prog=0x0, w=0x0, name=0x0) at complete.c:1328
#22 0x08073482 in doshfunc (name=0x81451f0 "_main_complete",
prog=0x82b71d0, doshargs=0xa7a26030,
    flags=0, noreturnval=0) at exec.c:3823
#23 0xa7d1a866 in makecomplist (s=0x82bc0b0 "Ã\203¸", incmd=0, lst=0)
at compcore.c:818
#24 0xa7d1b918 in do_completion (dummy=0xa7d66e74, dat=0x82d6000) at
compcore.c:347
#25 0xa7d58604 in docomplete (lst=0) at zle_tricky.c:1899
#26 0xa7d59bbf in completeword (args=0x0) at zle_tricky.c:232
#27 0xa7d540b9 in completecall (args=0x82d6000) at zle_tricky.c:208
#28 0xa7d475c5 in execzlefunc (func=0xa7d64330, args=0xa7d6715c) at
zle_main.c:1063
#29 0xa7d47938 in zlecore () at zle_main.c:838
#30 0xa7d483bd in zleread (lp=0x8101b10, rp=0x0, flags=0, context=0)
at zle_main.c:992
#31 0x0808a054 in inputline () at input.c:278
#32 0x0808a69a in ingetc () at input.c:214
#33 0x08080bc7 in ihgetc () at hist.c:240
#34 0x08096076 in gettok () at lex.c:628
#35 0x08097d36 in yylex () at lex.c:344
#36 0x080b9dfa in parse_event () at parse.c:451
#37 0x08086eea in loop (toplevel=1, justonce=0) at init.c:128
#38 0x08089c04 in zsh_main (argc=1, argv=0xafffebd4) at init.c:1315
#39 0x0805292e in main (argc=0, argv=0x0) at main.c:93

-- 
Mikael Magnusson



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