zsh-workers
 help / color / mirror / code / Atom feed
* crash with multibyte and matcher-list
@ 2008-11-01 17:53 Mikael Magnusson
  2008-11-02 17:20 ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Mikael Magnusson @ 2008-11-01 17:53 UTC (permalink / raw)
  To: zsh-workers

% PS1='%% ' gdb --args zsh -f
GNU gdb 6.8
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) run
Starting program: /usr/local/bin/zsh -f
% autoload compinit;compinit
% zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
+'r:|[._-]=* r:|=*' +'l:|=* r:|=*'
% touch $'\u51fa'{a,b}
% ls <tab>出<tab>
Program received signal SIGSEGV, Segmentation fault.
0x6fb13a2f in cfp_matcher_range (ms=0x77deb910, add=0x6fb01ba3 "º") at
computil.c:4063
4063			if (m->line->tp == CPAT_EQUIV &&
(gdb) bt
#0  0x6fb13a2f in cfp_matcher_range (ms=0x77deb910, add=0x6fb01ba3
"º") at computil.c:4063
#1  0x6fb1425b in cfp_matcher_pats (
    matcher=0x6fb01b18 "m:{a-zA-Z}={A-Za-z} m:{a-zA-Z}={A-Za-z}",
add=0x6fb01ba0 "å\203§º")
    at computil.c:4320
#2  0x6fb147d6 in cfp_opt_pats (pats=0x77debccc,
    matcher=0x6fb01b18 "m:{a-zA-Z}={A-Za-z} m:{a-zA-Z}={A-Za-z}") at
computil.c:4399
#3  0x6fb14fc8 in cf_pats (dirs=0, noopt=0, names=0x6fb01b70, accept=0x81919f8,
    skipped=0x6fb01ac8 "", matcher=0x6fb01b18 "m:{a-zA-Z}={A-Za-z}
m:{a-zA-Z}={A-Za-z}",
    sdirs=0x6fb01b48 "", fake=0x81922b0, pats=0x77debccc) at computil.c:4545
#4  0x6fb1585b in bin_compfiles (nam=0x6fb01a38 "compfiles",
args=0x77debcb0, ops=0x77debd10,
    func=0) at computil.c:4680
#5  0x08055b7b in execbuiltin (args=0x6fb019c0, bn=0x6fb181c8) at builtin.c:439
#6  0x080716a6 in execcmd (state=0x77ded70c, input=0, output=0,
how=18, last1=2) at exec.c:3066
#7  0x0806d386 in execpline2 (state=0x77ded70c, pcode=25731, how=18,
input=0, output=0, last1=0)
    at exec.c:1561
#8  0x0806c70d in execpline (state=0x77ded70c, slcode=11266, how=18,
last1=0) at exec.c:1347
#9  0x0806bf41 in execlist (state=0x77ded70c, dont_change_job=1,
exiting=0) at exec.c:1144
#10 0x08094292 in execif (state=0x77ded70c, do_exec=0) at loop.c:515
#11 0x08071430 in execcmd (state=0x77ded70c, input=0, output=0, how=2,
last1=2) at exec.c:3007
#12 0x0806d386 in execpline2 (state=0x77ded70c, pcode=25091, how=2,
input=0, output=0, last1=0)
    at exec.c:1561
#13 0x0806c70d in execpline (state=0x77ded70c, slcode=90114, how=2,
last1=0) at exec.c:1347
#14 0x0806bf41 in execlist (state=0x77ded70c, dont_change_job=1,
exiting=0) at exec.c:1144
#15 0x08093eed in execwhile (state=0x77ded70c, do_exec=0) at loop.c:410
#16 0x08071430 in execcmd (state=0x77ded70c, input=0, output=0, how=2,
last1=2) at exec.c:3007
#17 0x0806d386 in execpline2 (state=0x77ded70c, pcode=23235, how=2,
input=0, output=0, last1=0)
    at exec.c:1561
#18 0x0806c70d in execpline (state=0x77ded70c, slcode=671746, how=2,
last1=0) at exec.c:1347
---Type <return> to continue, or q <return> to quit---
#19 0x0806bf41 in execlist (state=0x77ded70c, dont_change_job=1,
exiting=0) at exec.c:1144
#20 0x080934b4 in execfor (state=0x77ded70c, do_exec=0) at loop.c:159
#21 0x08071430 in execcmd (state=0x77ded70c, input=0, output=0, how=2,
last1=2) at exec.c:3007
#22 0x0806d386 in execpline2 (state=0x77ded70c, pcode=20547, how=2,
input=0, output=0, last1=0)
    at exec.c:1561
#23 0x0806c70d in execpline (state=0x77ded70c, slcode=1792002, how=2,
last1=0) at exec.c:1347
#24 0x0806bf41 in execlist (state=0x77ded70c, dont_change_job=1,
exiting=0) at exec.c:1144
#25 0x0806b9fb in execode (p=0x8193410, dont_change_job=1, exiting=0)
at exec.c:975
#26 0x0807444c in runshfunc (prog=0x8193410, wrap=0x0, name=0x6faff6c0
"_path_files")
    at exec.c:4416
#27 0x6ffd79f8 in comp_wrapper (prog=0x8193410, w=0x0, name=0x6faff6c0
"_path_files")
    at complete.c:1453
#28 0x080743db in runshfunc (prog=0x8193410, wrap=0x6fff2720,
name=0x6faff6c0 "_path_files")
    at exec.c:4404
#29 0x080741b4 in doshfunc (shfunc=0x8176518, doshargs=0x6faff510,
noreturnval=0) at exec.c:4324
#30 0x080739a9 in execshfunc (shf=0x8176518, args=0x6faff510) at exec.c:4072
#31 0x08071627 in execcmd (state=0x77deffbc, input=0, output=0, how=2,
last1=2) at exec.c:3055
#32 0x0806d386 in execpline2 (state=0x77deffbc, pcode=7555, how=2,
input=0, output=0, last1=0)
    at exec.c:1561
#33 0x0806c70d in execpline (state=0x77deffbc, slcode=7202, how=2,
last1=0) at exec.c:1347
#34 0x0806bf8d in execlist (state=0x77deffbc, dont_change_job=1,
exiting=0) at exec.c:1151
#35 0x08094292 in execif (state=0x77deffbc, do_exec=0) at loop.c:515
#36 0x08071430 in execcmd (state=0x77deffbc, input=0, output=0,
how=18, last1=2) at exec.c:3007
#37 0x0806d386 in execpline2 (state=0x77deffbc, pcode=7491, how=18,
input=0, output=0, last1=0)
    at exec.c:1561
#38 0x0806c70d in execpline (state=0x77deffbc, slcode=38914, how=18,
last1=0) at exec.c:1347
#39 0x0806bf41 in execlist (state=0x77deffbc, dont_change_job=1,
exiting=0) at exec.c:1144
#40 0x08093eed in execwhile (state=0x77deffbc, do_exec=0) at loop.c:410
---Type <return> to continue, or q <return> to quit---
#41 0x08071430 in execcmd (state=0x77deffbc, input=0, output=0, how=2,
last1=2) at exec.c:3007
#42 0x0806d386 in execpline2 (state=0x77deffbc, pcode=7363, how=2,
input=0, output=0, last1=0)
    at exec.c:1561
#43 0x0806c70d in execpline (state=0x77deffbc, slcode=58370, how=2,
last1=0) at exec.c:1347
#44 0x0806bf41 in execlist (state=0x77deffbc, dont_change_job=1,
exiting=0) at exec.c:1144
#45 0x08093eed in execwhile (state=0x77deffbc, do_exec=0) at loop.c:410
#46 0x08071430 in execcmd (state=0x77deffbc, input=0, output=0, how=2,
last1=2) at exec.c:3007
#47 0x0806d386 in execpline2 (state=0x77deffbc, pcode=7235, how=2,
input=0, output=0, last1=0)
    at exec.c:1561
#48 0x0806c70d in execpline (state=0x77deffbc, slcode=81922, how=2,
last1=0) at exec.c:1347
#49 0x0806bf41 in execlist (state=0x77deffbc, dont_change_job=1,
exiting=0) at exec.c:1144
#50 0x080934b4 in execfor (state=0x77deffbc, do_exec=0) at loop.c:159
#51 0x08071430 in execcmd (state=0x77deffbc, input=0, output=0, how=2,
last1=2) at exec.c:3007
#52 0x0806d386 in execpline2 (state=0x77deffbc, pcode=6147, how=2,
input=0, output=0, last1=0)
    at exec.c:1561
#53 0x0806c70d in execpline (state=0x77deffbc, slcode=165890, how=2,
last1=0) at exec.c:1347
#54 0x0806bf41 in execlist (state=0x77deffbc, dont_change_job=1,
exiting=0) at exec.c:1144
#55 0x080934b4 in execfor (state=0x77deffbc, do_exec=0) at loop.c:159
#56 0x08071430 in execcmd (state=0x77deffbc, input=0, output=0, how=2,
last1=2) at exec.c:3007
#57 0x0806d386 in execpline2 (state=0x77deffbc, pcode=5699, how=2,
input=0, output=0, last1=0)
    at exec.c:1561
#58 0x0806c70d in execpline (state=0x77deffbc, slcode=212994, how=2,
last1=0) at exec.c:1347
#59 0x0806bf41 in execlist (state=0x77deffbc, dont_change_job=1,
exiting=0) at exec.c:1144
#60 0x0806b9fb in execode (p=0x8193470, dont_change_job=1, exiting=0)
at exec.c:975
#61 0x0807444c in runshfunc (prog=0x8193470, wrap=0x0, name=0x6fb062f0
"_files") at exec.c:4416
#62 0x6ffd79f8 in comp_wrapper (prog=0x8193470, w=0x0, name=0x6fb062f0 "_files")
    at complete.c:1453
#63 0x080743db in runshfunc (prog=0x8193470, wrap=0x6fff2720,
name=0x6fb062f0 "_files")
---Type <return> to continue, or q <return> to quit---
    at exec.c:4404
#64 0x080741b4 in doshfunc (shfunc=0x8170ce8, doshargs=0x6fb06160,
noreturnval=0) at exec.c:4324
#65 0x080739a9 in execshfunc (shf=0x8170ce8, args=0x6fb06160) at exec.c:4072
#66 0x08071627 in execcmd (state=0x77df40cc, input=0, output=0, how=2,
last1=2) at exec.c:3055
#67 0x0806d386 in execpline2 (state=0x77df40cc, pcode=28163, how=2,
input=0, output=0, last1=0)
    at exec.c:1561
#68 0x0806c70d in execpline (state=0x77df40cc, slcode=6178, how=2,
last1=0) at exec.c:1347
#69 0x0806bf8d in execlist (state=0x77df40cc, dont_change_job=1,
exiting=0) at exec.c:1151
#70 0x08093eed in execwhile (state=0x77df40cc, do_exec=0) at loop.c:410
#71 0x08071430 in execcmd (state=0x77df40cc, input=0, output=0, how=2,
last1=2) at exec.c:3007
#72 0x0806d386 in execpline2 (state=0x77df40cc, pcode=28099, how=2,
input=0, output=0, last1=0)
    at exec.c:1561
#73 0x0806c70d in execpline (state=0x77df40cc, slcode=24578, how=2,
last1=0) at exec.c:1347
#74 0x0806bf41 in execlist (state=0x77df40cc, dont_change_job=1,
exiting=0) at exec.c:1144
#75 0x08094292 in execif (state=0x77df40cc, do_exec=0) at loop.c:515
#76 0x08071430 in execcmd (state=0x77df40cc, input=0, output=0,
how=18, last1=2) at exec.c:3007
#77 0x0806d386 in execpline2 (state=0x77df40cc, pcode=24835, how=18,
input=0, output=0, last1=0)
    at exec.c:1561
#78 0x0806c70d in execpline (state=0x77df40cc, slcode=271362, how=18,
last1=0) at exec.c:1347
#79 0x0806bf41 in execlist (state=0x77df40cc, dont_change_job=1,
exiting=0) at exec.c:1144
#80 0x08094292 in execif (state=0x77df40cc, do_exec=0) at loop.c:515
#81 0x08071430 in execcmd (state=0x77df40cc, input=0, output=0,
how=18, last1=2) at exec.c:3007
#82 0x0806d386 in execpline2 (state=0x77df40cc, pcode=23427, how=18,
input=0, output=0, last1=0)
    at exec.c:1561
#83 0x0806c70d in execpline (state=0x77df40cc, slcode=384002, how=18,
last1=0) at exec.c:1347
#84 0x0806bf41 in execlist (state=0x77df40cc, dont_change_job=1,
exiting=0) at exec.c:1144
#85 0x08094292 in execif (state=0x77df40cc, do_exec=0) at loop.c:515
#86 0x08071430 in execcmd (state=0x77df40cc, input=0, output=0,
how=18, last1=2) at exec.c:3007
---Type <return> to continue, or q <return> to quit---
#87 0x0806d386 in execpline2 (state=0x77df40cc, pcode=22659, how=18,
input=0, output=0, last1=0)
    at exec.c:1561
#88 0x0806c70d in execpline (state=0x77df40cc, slcode=441346, how=18,
last1=0) at exec.c:1347
#89 0x0806bf41 in execlist (state=0x77df40cc, dont_change_job=1,
exiting=0) at exec.c:1144
#90 0x08093eed in execwhile (state=0x77df40cc, do_exec=0) at loop.c:410
#91 0x08071430 in execcmd (state=0x77df40cc, input=0, output=0,
how=18, last1=2) at exec.c:3007
#92 0x0806d386 in execpline2 (state=0x77df40cc, pcode=22019, how=18,
input=0, output=0, last1=0)
    at exec.c:1561
#93 0x0806c70d in execpline (state=0x77df40cc, slcode=490498, how=18,
last1=0) at exec.c:1347
#94 0x0806bf41 in execlist (state=0x77df40cc, dont_change_job=1,
exiting=0) at exec.c:1144
#95 0x08094292 in execif (state=0x77df40cc, do_exec=0) at loop.c:515
#96 0x08071430 in execcmd (state=0x77df40cc, input=0, output=0, how=2,
last1=2) at exec.c:3007
#97 0x0806d386 in execpline2 (state=0x77df40cc, pcode=21955, how=2,
input=0, output=0, last1=0)
    at exec.c:1561
#98 0x0806c70d in execpline (state=0x77df40cc, slcode=499714, how=2,
last1=0) at exec.c:1347
#99 0x0806bf41 in execlist (state=0x77df40cc, dont_change_job=1,
exiting=0) at exec.c:1144
#100 0x08093eed in execwhile (state=0x77df40cc, do_exec=0) at loop.c:410
#101 0x08071430 in execcmd (state=0x77df40cc, input=0, output=0,
how=2, last1=2) at exec.c:3007
#102 0x0806d386 in execpline2 (state=0x77df40cc, pcode=21827, how=2,
input=0, output=0, last1=0)
    at exec.c:1561
#103 0x0806c70d in execpline (state=0x77df40cc, slcode=866306, how=2,
last1=0) at exec.c:1347
#104 0x0806bf41 in execlist (state=0x77df40cc, dont_change_job=1,
exiting=0) at exec.c:1144
#105 0x08093eed in execwhile (state=0x77df40cc, do_exec=0) at loop.c:410
#106 0x08071430 in execcmd (state=0x77df40cc, input=0, output=0,
how=2, last1=2) at exec.c:3007
#107 0x0806d386 in execpline2 (state=0x77df40cc, pcode=21763, how=2,
input=0, output=0, last1=0)
    at exec.c:1561
#108 0x0806c70d in execpline (state=0x77df40cc, slcode=1010690, how=2,
last1=0) at exec.c:1347
#109 0x0806bf41 in execlist (state=0x77df40cc, dont_change_job=1,
exiting=0) at exec.c:1144
---Type <return> to continue, or q <return> to quit---
#110 0x08094292 in execif (state=0x77df40cc, do_exec=0) at loop.c:515
#111 0x08071430 in execcmd (state=0x77df40cc, input=0, output=0,
how=18, last1=2) at exec.c:3007
#112 0x0806d386 in execpline2 (state=0x77df40cc, pcode=19459, how=18,
input=0, output=0, last1=0)
    at exec.c:1561
#113 0x0806c70d in execpline (state=0x77df40cc, slcode=1296386,
how=18, last1=0) at exec.c:1347
#114 0x0806bf41 in execlist (state=0x77df40cc, dont_change_job=1,
exiting=0) at exec.c:1144
#115 0x0806b9fb in execode (p=0x8186d98, dont_change_job=1, exiting=0)
at exec.c:975
#116 0x0807444c in runshfunc (prog=0x8186d98, wrap=0x0,
name=0x6fb1beb0 "_arguments")
    at exec.c:4416
#117 0x6ffd79f8 in comp_wrapper (prog=0x8186d98, w=0x0,
name=0x6fb1beb0 "_arguments")
    at complete.c:1453
#118 0x080743db in runshfunc (prog=0x8186d98, wrap=0x6fff2720,
name=0x6fb1beb0 "_arguments")
    at exec.c:4404
#119 0x080741b4 in doshfunc (shfunc=0x816cdc0, doshargs=0x6fb1a3b8,
noreturnval=0) at exec.c:4324
#120 0x080739a9 in execshfunc (shf=0x816cdc0, args=0x6fb1a3b8) at exec.c:4072
#121 0x08071627 in execcmd (state=0x77df499c, input=0, output=0,
how=18, last1=2) at exec.c:3055
#122 0x0806d386 in execpline2 (state=0x77df499c, pcode=9027, how=18,
input=0, output=0, last1=0)
    at exec.c:1561
#123 0x0806c70d in execpline (state=0x77df499c, slcode=5122, how=18,
last1=0) at exec.c:1347
#124 0x0806bf41 in execlist (state=0x77df499c, dont_change_job=1,
exiting=0) at exec.c:1144
#125 0x0806b9fb in execode (p=0x8181b70, dont_change_job=1, exiting=0)
at exec.c:975
#126 0x0807444c in runshfunc (prog=0x8181b70, wrap=0x0,
name=0x6fb1fdc0 "_ls") at exec.c:4416
#127 0x6ffd79f8 in comp_wrapper (prog=0x8181b70, w=0x0,
name=0x6fb1fdc0 "_ls") at complete.c:1453
#128 0x080743db in runshfunc (prog=0x8181b70, wrap=0x6fff2720,
name=0x6fb1fdc0 "_ls")
    at exec.c:4404
#129 0x080741b4 in doshfunc (shfunc=0x8174128, doshargs=0x6fb1fd90,
noreturnval=0) at exec.c:4324
#130 0x080739a9 in execshfunc (shf=0x8174128, args=0x6fb1fd90) at exec.c:4072
#131 0x08071627 in execcmd (state=0x77df526c, input=0, output=0,
how=18, last1=2) at exec.c:3055
---Type <return> to continue, or q <return> to quit---
#132 0x0806d386 in execpline2 (state=0x77df526c, pcode=131, how=18,
input=0, output=0, last1=0)
    at exec.c:1561
#133 0x0806c70d in execpline (state=0x77df526c, slcode=3074, how=18,
last1=0) at exec.c:1347
#134 0x0806bf41 in execlist (state=0x77df526c, dont_change_job=1,
exiting=0) at exec.c:1144
#135 0x0806b9fb in execode (p=0x6fb1fd40, dont_change_job=1,
exiting=0) at exec.c:975
#136 0x08064fa6 in bin_eval (nam=0x6fb1fd00 "eval", argv=0x77df52f0,
ops=0x77df5330, func=14)
    at builtin.c:4815
#137 0x08055b7b in execbuiltin (args=0x6fb1fcd8, bn=0x80df63c) at builtin.c:439
#138 0x080716a6 in execcmd (state=0x77df605c, input=0, output=0,
how=2, last1=2) at exec.c:3066
#139 0x0806d386 in execpline2 (state=0x77df605c, pcode=3779, how=2,
input=0, output=0, last1=0)
    at exec.c:1561
#140 0x0806c70d in execpline (state=0x77df605c, slcode=4130, how=2,
last1=0) at exec.c:1347
#141 0x0806bf8d in execlist (state=0x77df605c, dont_change_job=1,
exiting=0) at exec.c:1151
#142 0x08094292 in execif (state=0x77df605c, do_exec=0) at loop.c:515
#143 0x08071430 in execcmd (state=0x77df605c, input=0, output=0,
how=2, last1=2) at exec.c:3007
#144 0x0806d386 in execpline2 (state=0x77df605c, pcode=3651, how=2,
input=0, output=0, last1=0)
    at exec.c:1561
#145 0x0806c70d in execpline (state=0x77df605c, slcode=43010, how=2,
last1=0) at exec.c:1347
#146 0x0806bf41 in execlist (state=0x77df605c, dont_change_job=1,
exiting=0) at exec.c:1144
#147 0x0806b9fb in execode (p=0x8178b28, dont_change_job=1, exiting=0)
at exec.c:975
#148 0x0807444c in runshfunc (prog=0x8178b28, wrap=0x0,
name=0x6fb1f880 "_dispatch")
    at exec.c:4416
#149 0x6ffd79f8 in comp_wrapper (prog=0x8178b28, w=0x0,
name=0x6fb1f880 "_dispatch")
    at complete.c:1453
#150 0x080743db in runshfunc (prog=0x8178b28, wrap=0x6fff2720,
name=0x6fb1f880 "_dispatch")
    at exec.c:4404
#151 0x080741b4 in doshfunc (shfunc=0x816fb88, doshargs=0x6fb1f750,
noreturnval=0) at exec.c:4324
#152 0x080739a9 in execshfunc (shf=0x816fb88, args=0x6fb1f750) at exec.c:4072
---Type <return> to continue, or q <return> to quit---
#153 0x08071627 in execcmd (state=0x77df692c, input=0, output=0,
how=18, last1=2) at exec.c:3055
#154 0x0806d386 in execpline2 (state=0x77df692c, pcode=1667, how=18,
input=0, output=0, last1=0)
    at exec.c:1561
#155 0x0806c70d in execpline (state=0x77df692c, slcode=8194, how=18,
last1=0) at exec.c:1347
#156 0x0806bf41 in execlist (state=0x77df692c, dont_change_job=1,
exiting=0) at exec.c:1144
#157 0x0806b9fb in execode (p=0x8170f40, dont_change_job=1, exiting=0)
at exec.c:975
#158 0x0807444c in runshfunc (prog=0x8170f40, wrap=0x0,
name=0x6fb1f618 "_normal") at exec.c:4416
#159 0x6ffd79f8 in comp_wrapper (prog=0x8170f40, w=0x0,
name=0x6fb1f618 "_normal")
    at complete.c:1453
#160 0x080743db in runshfunc (prog=0x8170f40, wrap=0x6fff2720,
name=0x6fb1f618 "_normal")
    at exec.c:4404
#161 0x080741b4 in doshfunc (shfunc=0x8175e60, doshargs=0x6fb1f5d0,
noreturnval=0) at exec.c:4324
#162 0x080739a9 in execshfunc (shf=0x8175e60, args=0x6fb1f5d0) at exec.c:4072
#163 0x08071627 in execcmd (state=0x77df783c, input=0, output=0,
how=2, last1=2) at exec.c:3055
#164 0x0806d386 in execpline2 (state=0x77df783c, pcode=7555, how=2,
input=0, output=0, last1=0)
    at exec.c:1561
#165 0x0806c70d in execpline (state=0x77df783c, slcode=4130, how=2,
last1=0) at exec.c:1347
#166 0x0806bf8d in execlist (state=0x77df783c, dont_change_job=1,
exiting=0) at exec.c:1151
#167 0x08094292 in execif (state=0x77df783c, do_exec=0) at loop.c:515
#168 0x08071430 in execcmd (state=0x77df783c, input=0, output=0,
how=2, last1=2) at exec.c:3007
#169 0x0806d386 in execpline2 (state=0x77df783c, pcode=7427, how=2,
input=0, output=0, last1=0)
    at exec.c:1561
#170 0x0806c70d in execpline (state=0x77df783c, slcode=114690, how=2,
last1=0) at exec.c:1347
#171 0x0806bf41 in execlist (state=0x77df783c, dont_change_job=1,
exiting=0) at exec.c:1144
#172 0x0806b9fb in execode (p=0x8178c10, dont_change_job=1, exiting=0)
at exec.c:975
#173 0x0807444c in runshfunc (prog=0x8178c10, wrap=0x0,
name=0x6fb1f0f8 "_complete")
    at exec.c:4416
#174 0x6ffd79f8 in comp_wrapper (prog=0x8178c10, w=0x0,
name=0x6fb1f0f8 "_complete")
---Type <return> to continue, or q <return> to quit---
    at complete.c:1453
#175 0x080743db in runshfunc (prog=0x8178c10, wrap=0x6fff2720,
name=0x6fb1f0f8 "_complete")
    at exec.c:4404
#176 0x080741b4 in doshfunc (shfunc=0x816e380, doshargs=0x6fb1f0a8,
noreturnval=0) at exec.c:4324
#177 0x080739a9 in execshfunc (shf=0x816e380, args=0x6fb1f0a8) at exec.c:4072
#178 0x08071627 in execcmd (state=0x77df946c, input=0, output=0,
how=18, last1=2) at exec.c:3055
#179 0x0806d386 in execpline2 (state=0x77df946c, pcode=10371, how=18,
input=0, output=0, last1=0)
    at exec.c:1561
#180 0x0806c70d in execpline (state=0x77df946c, slcode=3074, how=18,
last1=0) at exec.c:1347
#181 0x0806bf41 in execlist (state=0x77df946c, dont_change_job=1,
exiting=0) at exec.c:1144
#182 0x080941ed in execif (state=0x77df946c, do_exec=0) at loop.c:500
#183 0x08071430 in execcmd (state=0x77df946c, input=0, output=0,
how=2, last1=2) at exec.c:3007
#184 0x0806d386 in execpline2 (state=0x77df946c, pcode=10051, how=2,
input=0, output=0, last1=0)
    at exec.c:1561
#185 0x0806c70d in execpline (state=0x77df946c, slcode=48130, how=2,
last1=0) at exec.c:1347
#186 0x0806bf41 in execlist (state=0x77df946c, dont_change_job=1,
exiting=0) at exec.c:1144
#187 0x080934b4 in execfor (state=0x77df946c, do_exec=0) at loop.c:159
#188 0x08071430 in execcmd (state=0x77df946c, input=0, output=0,
how=2, last1=2) at exec.c:3007
#189 0x0806d386 in execpline2 (state=0x77df946c, pcode=9539, how=2,
input=0, output=0, last1=0)
    at exec.c:1561
#190 0x0806c70d in execpline (state=0x77df946c, slcode=90114, how=2,
last1=0) at exec.c:1347
#191 0x0806bf41 in execlist (state=0x77df946c, dont_change_job=1,
exiting=0) at exec.c:1144
#192 0x080934b4 in execfor (state=0x77df946c, do_exec=0) at loop.c:159
#193 0x08071430 in execcmd (state=0x77df946c, input=0, output=0,
how=2, last1=2) at exec.c:3007
#194 0x0806d386 in execpline2 (state=0x77df946c, pcode=8067, how=2,
input=0, output=0, last1=0)
    at exec.c:1561
#195 0x0806c70d in execpline (state=0x77df946c, slcode=220162, how=2,
last1=0) at exec.c:1347
#196 0x0806bf41 in execlist (state=0x77df946c, dont_change_job=1,
exiting=0) at exec.c:1144
---Type <return> to continue, or q <return> to quit---
#197 0x0806b9fb in execode (p=0x817d8d0, dont_change_job=1, exiting=0)
at exec.c:975
#198 0x0807444c in runshfunc (prog=0x817d8d0, wrap=0x0,
name=0x6fb1d030 "_main_complete")
    at exec.c:4416
#199 0x6ffd79f8 in comp_wrapper (prog=0x817d8d0, w=0x0,
name=0x6fb1d030 "_main_complete")
    at complete.c:1453
#200 0x080743db in runshfunc (prog=0x817d8d0, wrap=0x6fff2720,
name=0x6fb1d030 "_main_complete")
    at exec.c:4404
#201 0x080741b4 in doshfunc (shfunc=0x81747d0, doshargs=0x0,
noreturnval=0) at exec.c:4324
#202 0x6ffda2c9 in callcompfunc (s=0x6fc67628 "å\203§º", fn=0x81137d8
"_main_complete")
    at compcore.c:817
#203 0x6ffdab9b in makecomplist (s=0x6fc67628 "å\203§º", incmd=0,
lst=0) at compcore.c:968
#204 0x6ffd893e in do_completion (dummy=0x6fb829d4, dat=0x77df98d8) at
compcore.c:349

#205 0x0809b2fc in runhookdef (h=0x6fb829d4, d=0x77df98d8) at module.c:996
#206 0x6fb72934 in docompletion (s=0x8114788 "å\203§º", lst=0,
incmd=0) at zle_tricky.c:2135
#207 0x6fb6e9a7 in docomplete (lst=0) at zle_tricky.c:859
#208 0x6fb6d427 in expandorcomplete (args=0x6fb82cbc) at zle_tricky.c:315
#209 0x6fb6cfca in completecall (args=0x6fb82cbc) at zle_tricky.c:208

#210 0x6fb5cbc8 in execzlefunc (func=0x6fb80cd0, args=0x6fb82cbc,
set_bindk=0) at zle_main.c:1292
#211 0x6fb5c0e2 in zlecore () at zle_main.c:1043
#212 0x6fb5c809 in zleread (lp=0x80f4afc, rp=0x0, flags=3, context=0)
at zle_main.c:1206
#213 0x6fb5e966 in zle_main_entry (cmd=1, ap=0x77df9d24 "") at zle_main.c:1836
#214 0x080875e5 in zleentry (cmd=1) at init.c:1255

#215 0x08087ec6 in inputline () at input.c:278
#216 0x08087d35 in ingetc () at input.c:214
#217 0x0807e252 in ihgetc () at hist.c:263
#218 0x08090095 in gettok () at lex.c:677
#219 0x0808f920 in yylex () at lex.c:364

#220 0x080ac2e9 in parse_event () at parse.c:451
---Type <return> to continue, or q <return> to quit---
#221 0x08084c67 in loop (toplevel=1, justonce=0) at init.c:129
#222 0x08087966 in zsh_main (argc=2, argv=0x77df9f84) at init.c:1406
#223 0x08055256 in main (argc=Cannot access memory at address 0x1a
) at ./main.c:93
(gdb)
(gdb)
(gdb)
(gdb)
(gdb)
(gdb)
(gdb)
(gdb)
(gdb)
(gdb) frame 0
#0  0x6fb13a2f in cfp_matcher_range (ms=0x77deb910, add=0x6fb01ba3
"º") at computil.c:4063
4063			if (m->line->tp == CPAT_EQUIV &&
(gdb) print m
$1 = (Cmatcher) 0x6fb13ee8
(gdb) print m->line
$2 = (Cpattern) 0xc10fc083
(gdb) print m->line->tp
Cannot access memory at address 0xc10fc087
(gdb) print *m
$3 = {refc = -1947974263, next = 0xe0c1e445, flags = 264274690, line =
0xc10fc083,
  llen = -524221208, word = 0x8dc42904, wlen = -1995430844, left = 0x458bb045,
  lalen = 264274864, right = 0xc104e8c1, ralen = 1166607584}
(gdb) frame 1
#1  0x6fb1425b in cfp_matcher_pats (
    matcher=0x6fb01b18 "m:{a-zA-Z}={A-Za-z} m:{a-zA-Z}={A-Za-z}",
add=0x6fb01ba0 "å\203§º")
    at computil.c:4320
4320		    return cfp_matcher_range(ms, add);
(gdb) print *add
$4 = -27 'å'
(gdb) print ms
$5 = 0x77deb910
(gdb) print *ms
$6 = (Cmatcher) 0x0


-- 
Mikael Magnusson

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

* Re: crash with multibyte and matcher-list
  2008-11-01 17:53 crash with multibyte and matcher-list Mikael Magnusson
@ 2008-11-02 17:20 ` Peter Stephenson
  2008-11-02 17:58   ` Mikael Magnusson
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Stephenson @ 2008-11-02 17:20 UTC (permalink / raw)
  To: zsh-workers

On Sat, 1 Nov 2008 18:53:52 +0100
"Mikael Magnusson" <mikachu@gmail.com> wrote:
> GNU gdb 6.8
> This GDB was configured as "i686-pc-linux-gnu"...
> (gdb) run
> Starting program: /usr/local/bin/zsh -f
> % autoload compinit;compinit
> % zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
> +'r:|[._-]=* r:|=*' +'l:|=* r:|=*'
> % touch $'\u51fa'{a,b}
> % ls <tab>出<tab>
> Program received signal SIGSEGV, Segmentation fault.

This is going to be a complete hotch-potch until I take a week out of my
life to convert the whole thing to do multibyte character properly, but
the following ought to be safer and more future-proof.  The characters
stored in the matcher are not handled as multibyte characters, so this
is not likely to handle completion for multibyte characters any better
yet.

Index: Src/Zle/computil.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/computil.c,v
retrieving revision 1.112
diff -u -r1.112 computil.c
--- Src/Zle/computil.c	29 Oct 2008 01:33:23 -0000	1.112
+++ Src/Zle/computil.c	2 Nov 2008 17:18:27 -0000
@@ -4024,7 +4024,17 @@
      * management is difficult.
      */
     for (;;) {
+	MB_METACHARINIT();
 	for (mp = ms; *add; ) {
+	    convchar_t addc;
+	    int addlen;
+
+	    addlen = MB_METACHARLENCONV(add, &addc);
+#ifdef MULTIBYTE_SUPPORT
+	    if (addc == WEOF)
+		addc = (wchar_t)(*p == Meta ? p[1] ^ 32 : *p);
+#endif
+
 	    if (!(m = *mp)) {
 		/*
 		 * No matcher, so just match the character
@@ -4034,13 +4044,10 @@
 		 * metacharacter?
 		 */
 		if (ret) {
-		    if (*add == Meta) {
-			*p++ = Meta;
-			*p++ = add[1];
-		    } else
-			*p++ = *add;
+		    memcpy(p, add, addlen);
+		    p += addlen;
 		} else
-		    len += (*add == Meta) ? 2 : 1;
+		    len += addlen;
 	    } else if (m->flags & CMF_RIGHT) {
 		/*
 		 * Right-anchored:  match anything followed
@@ -4049,16 +4056,12 @@
 		if (ret) {
 		    *p++ = '*';
 		    /* TODO: quote again? */
-		    if (*add == Meta) {
-			*p++ = Meta;
-			*p++ = add[1];
-		    } else
-			*p++ = *add;
+		    memcpy(p, add, addlen);
+		    p += addlen;
 		} else
-		    len += (*add == Meta) ? 3 : 2;
+		    len += addlen + 1;
 	    } else {
 		/* The usual set of matcher possibilities. */
-		int chr = (*add == Meta) ? add[1] ^ 32 : *add;
 		int ind;
 		if (m->line->tp == CPAT_EQUIV &&
 		    m->word->tp == CPAT_EQUIV) {
@@ -4073,21 +4076,17 @@
 		     */
 		    if (ret) {
 			*p++ = '[';
-			if (*add == Meta) {
-			    *p++ = Meta;
-			    *p++ = add[1];
-			} else
-			    *p++ = *add;
+			memcpy(p, add, addlen);
+			p += addlen;
 		    } else
-			len += (*add == Meta) ? 3 : 2;
-		    if (PATMATCHRANGE(m->line->u.str, CONVCAST(chr),
-				      &ind, &mt)) {
+			len += addlen + 1;
+		    if (PATMATCHRANGE(m->line->u.str, addc, &ind, &mt)) {
 			/*
 			 * Find the equivalent match for ind in the
 			 * word pattern.
 			 */
 			if ((ind = pattern_match_equivalence
-			     (m->word, ind, mt, CONVCAST(chr))) != -1) {
+			     (m->word, ind, mt, addc)) != -1) {
 			    if (ret) {
 				if (imeta(ind)) {
 				    *p++ = Meta;
@@ -4159,7 +4158,7 @@
 			 * if *add is ] and ] is also the first
 			 * character in the range.
 			 */
-			addadd = !pattern_match1(m->word, CONVCAST(chr), &mt);
+			addadd = !pattern_match1(m->word, addc, &mt);
 			if (addadd && *add == ']') {
 			    if (ret)
 				*p++ = *add;
@@ -4196,13 +4195,10 @@
 			}
 			if (addadd && *add != ']') {
 			    if (ret) {
-				if (imeta(*add)) {
-				    *p++ = Meta;
-				    *p++ = *add ^ 32;
-				} else
-				    *p++ = *add;
+				memcpy(p, add, addlen);
+				p += addlen;
 			    } else
-				len += imeta(*add) ? 2 : 1;
+				len += addlen;
 			}
 			if (ret)
 			    *p++ = ']';
@@ -4219,13 +4215,8 @@
 		    }
 		}
 	    }
-	    if (*add == Meta) {
-		add += 2;
-		mp += 2;
-	    } else {
-		add++;
-		mp++;
-	    }
+	    add += addlen;
+	    mp++;
 	}
 	if (ret) {
 	    *p = '\0';


-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


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

* Re: crash with multibyte and matcher-list
  2008-11-02 17:20 ` Peter Stephenson
@ 2008-11-02 17:58   ` Mikael Magnusson
  0 siblings, 0 replies; 3+ messages in thread
From: Mikael Magnusson @ 2008-11-02 17:58 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh-workers

2008/11/2 Peter Stephenson <p.w.stephenson@ntlworld.com>:
> On Sat, 1 Nov 2008 18:53:52 +0100
> "Mikael Magnusson" <mikachu@gmail.com> wrote:
>> GNU gdb 6.8
>> This GDB was configured as "i686-pc-linux-gnu"...
>> (gdb) run
>> Starting program: /usr/local/bin/zsh -f
>> % autoload compinit;compinit
>> % zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
>> +'r:|[._-]=* r:|=*' +'l:|=* r:|=*'
>> % touch $'\u51fa'{a,b}
>> % ls <tab>出<tab>
>> Program received signal SIGSEGV, Segmentation fault.
>
> This is going to be a complete hotch-potch until I take a week out of my
> life to convert the whole thing to do multibyte character properly, but
> the following ought to be safer and more future-proof.  The characters
> stored in the matcher are not handled as multibyte characters, so this
> is not likely to handle completion for multibyte characters any better
> yet.

Thanks, this fixes it for me too (ie with my full .zshrc, in case that
could have caused some additional problems).

btw, i noticed $ZSH_VERSION is 4.3.9 in cvs, ie not -dev-0.

-- 
Mikael Magnusson

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

end of thread, other threads:[~2008-11-02 17:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-01 17:53 crash with multibyte and matcher-list Mikael Magnusson
2008-11-02 17:20 ` Peter Stephenson
2008-11-02 17:58   ` Mikael Magnusson

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