zsh-autocomplete
zsh-autocomplete copied to clipboard
zsh crashes with file completion
Environment
apple darwin21.0 /bin/zsh -zsh zsh-5.8.1-0-g1a490c7
/Users/okuramasafumi/.local/share/zinit/zinit.git/zinit.zsh:1643
/Users/okuramasafumi/.local/share/zinit/zinit.git/zinit.zsh:1281
/Users/okuramasafumi/.local/share/zinit/zinit.git/zinit.zsh:2759
/Users/okuramasafumi/.zshrc:52
- Operating system: macOS 12.4
- Terminal emulator: Build 3.5.0beta5
Steps to reproduce
I found it only happens in certain directory.
git clone https://github.com/okuramasafumi/xa
cd xa
nvim gemm<TAB>
Typing tab after gemm
causes zsh crash. I suspect it's because the repository contains Gemfile
but other repositories with Gemfile
doesn't cause crashes.
I think you may come across the same bug as I have (do not have any workaround or anything, sorry), could you please check your dmesg output?
I got following message:
[ 3252.749812] zsh[25844]: segfault at 1000000a2 ip 00007f7429f8e926 sp 00007ffe0613daa0 error 4 in complist.so[7f7429f8b000+a000] [ 3252.749820] Code: 83 7c 24 08 01 0f 84 ac 0e 00 00 48 8b 05 92 95 00 00 c7 00 01 00 00 00 31 ff ff 15 7c 95 00 00 49 8b 47 08 83 c9 ff 48 8b 00 <8b> 80 94 00 00 00 c7 44 24 30 01 00 00 00 c7 05 06 99 00 00 ff ff
When I do
pacman -S libmesa<TAB>
[1] 28688 segmentation fault (core dumped) zsh
With only zsh-autocomplete enabled.
I think somehow need to file a report to zsh also as it is segv in complete.so of zsh itself.
In my case the candidate from zsh-autocomplete have only
packages
libmesode libmesode-doc
only triggering the segv when press <TAB> before the candidates are printed by zsh-autocomplete.
I found no segfault
in dmesg output.
I got the error report from console.app, here's the content.
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------
Process: zsh [89221]
Path: /bin/zsh
Identifier: zsh
Version: ???
Code Type: X86-64 (Native)
Parent Process: Exited process [89220]
Responsible: iTerm2 [406]
User ID: 501
Date/Time: 2022-06-19 18:24:27.8751 +0900
OS Version: macOS 12.4 (21F79)
Report Version: 12
Bridge OS Version: 6.5 (19P5071)
Anonymous UUID: 353BD5A4-B430-3E8C-E345-C290091E445C
Sleep/Wake UUID: E63869BF-BCA9-4BDB-936D-EB7306ED000D
Time Awake Since Boot: 150000 seconds
Time Since Wake: 2535 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x000018e61ce39280
Exception Codes: 0x0000000000000001, 0x000018e61ce39280
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process: exc handler [89221]
VM Region Info: 0x18e61ce39280 is not in any region. Bytes after previous region: 27372118778497 Bytes before following region: 78176510045568
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
VM_ALLOCATE (reserved) 10b78c000-10b78f000 [ 12K] r--/r-- SM=NUL ...(unallocated)
---> GAP OF 0x5ffef4871000 BYTES
MALLOC_NANO 600000000000-600008000000 [128.0M] rw-/rwx SM=COW
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 complist.so 0x1037aafc9 0x1037a5000 + 24521
1 complist.so 0x1037a876e 0x1037a5000 + 14190
2 zle.so 0x1037240d7 completecall + 52
3 zle.so 0x1037167d2 execzlefunc + 779
4 zle.so 0x103723d1b 0x10370b000 + 101659
5 zsh 0x10341e7b1 execbuiltin + 1818
6 zsh 0x10343893b 0x10341d000 + 112955
7 zsh 0x10343545f 0x10341d000 + 99423
8 zsh 0x103430a53 0x10341d000 + 80467
9 zsh 0x10343048e execlist + 1855
10 zsh 0x10342fd30 execode + 207
11 zsh 0x103433f53 runshfunc + 170
12 private.so 0x103756d78 wrap_private + 105
13 zsh 0x103433f10 runshfunc + 103
14 zsh 0x103433ac8 doshfunc + 1322
15 zsh 0x103434eb0 0x10341d000 + 97968
16 zsh 0x103438363 0x10341d000 + 111459
17 zsh 0x10343545f 0x10341d000 + 99423
18 zsh 0x103430a53 0x10341d000 + 80467
19 zsh 0x10343048e execlist + 1855
20 zsh 0x103456cf6 execif + 320
21 zsh 0x1034380cb 0x10341d000 + 110795
22 zsh 0x10343545f 0x10341d000 + 99423
23 zsh 0x103430a53 0x10341d000 + 80467
24 zsh 0x10343048e execlist + 1855
25 zsh 0x10342fd30 execode + 207
26 zsh 0x103433f53 runshfunc + 170
27 private.so 0x103756d78 wrap_private + 105
28 zsh 0x103433f10 runshfunc + 103
29 zsh 0x103433ac8 doshfunc + 1322
30 zsh 0x103434eb0 0x10341d000 + 97968
31 zsh 0x103438363 0x10341d000 + 111459
32 zsh 0x10343545f 0x10341d000 + 99423
33 zsh 0x103430a53 0x10341d000 + 80467
34 zsh 0x10343048e execlist + 1855
35 zsh 0x10342fd30 execode + 207
36 zsh 0x103433f53 runshfunc + 170
37 private.so 0x103756d78 wrap_private + 105
38 zsh 0x103433f10 runshfunc + 103
39 zsh 0x103433ac8 doshfunc + 1322
40 zsh 0x103434eb0 0x10341d000 + 97968
41 zsh 0x103438363 0x10341d000 + 111459
42 zsh 0x10343545f 0x10341d000 + 99423
43 zsh 0x103430a53 0x10341d000 + 80467
44 zsh 0x10343048e execlist + 1855
45 zsh 0x10342fd30 execode + 207
46 zsh 0x103433f53 runshfunc + 170
47 private.so 0x103756d78 wrap_private + 105
48 zsh 0x103433f10 runshfunc + 103
49 zsh 0x103433ac8 doshfunc + 1322
50 zsh 0x103434eb0 0x10341d000 + 97968
51 zsh 0x103438363 0x10341d000 + 111459
52 zsh 0x10343545f 0x10341d000 + 99423
53 zsh 0x103430a53 0x10341d000 + 80467
54 zsh 0x10343048e execlist + 1855
55 zsh 0x10342fd30 execode + 207
56 zsh 0x103433f53 runshfunc + 170
57 private.so 0x103756d78 wrap_private + 105
58 zsh 0x103433f10 runshfunc + 103
59 zsh 0x103433ac8 doshfunc + 1322
60 zle.so 0x1037168a7 execzlefunc + 992
61 zle.so 0x103723d1b 0x10370b000 + 101659
62 zsh 0x10341e7b1 execbuiltin + 1818
63 zsh 0x10343893b 0x10341d000 + 112955
64 zsh 0x10343545f 0x10341d000 + 99423
65 zsh 0x103430a53 0x10341d000 + 80467
66 zsh 0x10343048e execlist + 1855
67 zsh 0x10342fd30 execode + 207
68 zsh 0x103433f53 runshfunc + 170
69 private.so 0x103756d78 wrap_private + 105
70 zsh 0x103433f10 runshfunc + 103
71 zsh 0x103433ac8 doshfunc + 1322
72 zsh 0x103434eb0 0x10341d000 + 97968
73 zsh 0x103438363 0x10341d000 + 111459
74 zsh 0x10343545f 0x10341d000 + 99423
75 zsh 0x103430a53 0x10341d000 + 80467
76 zsh 0x10343048e execlist + 1855
77 zsh 0x103456cf6 execif + 320
78 zsh 0x1034380cb 0x10341d000 + 110795
79 zsh 0x10343545f 0x10341d000 + 99423
80 zsh 0x103430a53 0x10341d000 + 80467
81 zsh 0x10343048e execlist + 1855
82 zsh 0x10342fd30 execode + 207
83 zsh 0x103433f53 runshfunc + 170
84 private.so 0x103756d78 wrap_private + 105
85 zsh 0x103433f10 runshfunc + 103
86 zsh 0x103433ac8 doshfunc + 1322
87 zsh 0x103434eb0 0x10341d000 + 97968
88 zsh 0x103438363 0x10341d000 + 111459
89 zsh 0x10343545f 0x10341d000 + 99423
90 zsh 0x103430a53 0x10341d000 + 80467
91 zsh 0x10343048e execlist + 1855
92 zsh 0x10345727b exectry + 108
93 zsh 0x1034380cb 0x10341d000 + 110795
94 zsh 0x10343545f 0x10341d000 + 99423
95 zsh 0x103430a53 0x10341d000 + 80467
96 zsh 0x10343048e execlist + 1855
97 zsh 0x10342fd30 execode + 207
98 zsh 0x103433f53 runshfunc + 170
99 private.so 0x103756d78 wrap_private + 105
100 zsh 0x103433f10 runshfunc + 103
101 zsh 0x103433ac8 doshfunc + 1322
102 zle.so 0x1037168a7 execzlefunc + 992
103 zle.so 0x103723d1b 0x10370b000 + 101659
104 zsh 0x10341e7b1 execbuiltin + 1818
105 zsh 0x10343893b 0x10341d000 + 112955
106 zsh 0x10343545f 0x10341d000 + 99423
107 zsh 0x103430a53 0x10341d000 + 80467
108 zsh 0x10343048e execlist + 1855
109 zsh 0x103456cf6 execif + 320
110 zsh 0x1034380cb 0x10341d000 + 110795
111 zsh 0x10343545f 0x10341d000 + 99423
112 zsh 0x103430a53 0x10341d000 + 80467
113 zsh 0x10343048e execlist + 1855
114 zsh 0x10342fd30 execode + 207
115 zsh 0x103433f53 runshfunc + 170
116 private.so 0x103756d78 wrap_private + 105
117 zsh 0x103433f10 runshfunc + 103
118 zsh 0x103433ac8 doshfunc + 1322
119 zsh 0x103434eb0 0x10341d000 + 97968
120 zsh 0x103438363 0x10341d000 + 111459
121 zsh 0x10343545f 0x10341d000 + 99423
122 zsh 0x103430a53 0x10341d000 + 80467
123 zsh 0x10343048e execlist + 1855
124 zsh 0x10342fd30 execode + 207
125 zsh 0x103433f53 runshfunc + 170
126 private.so 0x103756d78 wrap_private + 105
127 zsh 0x103433f10 runshfunc + 103
128 zsh 0x103433ac8 doshfunc + 1322
129 zsh 0x103434eb0 0x10341d000 + 97968
130 zsh 0x103438363 0x10341d000 + 111459
131 zsh 0x10343545f 0x10341d000 + 99423
132 zsh 0x103430a53 0x10341d000 + 80467
133 zsh 0x10343048e execlist + 1855
134 zsh 0x10342fd30 execode + 207
135 zsh 0x103433f53 runshfunc + 170
136 private.so 0x103756d78 wrap_private + 105
137 zsh 0x103433f10 runshfunc + 103
138 zsh 0x103433ac8 doshfunc + 1322
139 zsh 0x103434eb0 0x10341d000 + 97968
140 zsh 0x103438363 0x10341d000 + 111459
141 zsh 0x10343545f 0x10341d000 + 99423
142 zsh 0x103430a53 0x10341d000 + 80467
143 zsh 0x10343048e execlist + 1855
144 zsh 0x10342fd30 execode + 207
145 zsh 0x103433f53 runshfunc + 170
146 private.so 0x103756d78 wrap_private + 105
147 zsh 0x103433f10 runshfunc + 103
148 zsh 0x103433ac8 doshfunc + 1322
149 zle.so 0x1037168a7 execzlefunc + 992
150 zle.so 0x103716ccb zlecore + 320
151 zle.so 0x1037172fa zleread + 1152
152 zsh 0x10344bf28 zleentry + 384
153 zsh 0x10344cb42 ingetc + 359
154 zsh 0x10344434e 0x10341d000 + 160590
155 zsh 0x1034522c6 zshlex + 136
156 zsh 0x103468f12 parse_event + 53
157 zsh 0x10344953a loop + 241
158 zsh 0x10344c42a zsh_main + 1159
159 dyld 0x10b6dc51e start + 462
Thread 0 crashed with X86 Thread State (64-bit):
rax: 0x000018e61ce39220 rbx: 0x000000010380d920 rcx: 0x000000000000001a rdx: 0x0000000000000003
rdi: 0x00007f7feb00ba00 rsi: 0x00000001037b0cca rbp: 0x00007ff7bcab87f0 rsp: 0x00007ff7bcab8400
r8: 0x0000000000000000 r9: 0x0000000000000330 r10: 0x0000000000000700 r11: 0xffffa00101e5edc0
r12: 0x000000010380d8a0 r13: 0x00000000000003ee r14: 0x0000000000000001 r15: 0x00000001034a7d3c
rip: 0x00000001037aafc9 rfl: 0x0000000000010246 cr2: 0x000018e61ce39280
Logical CPU: 5
Error Code: 0x00000004 (no mapping for user data read)
Trap Number: 14
Thread 0 instruction stream:
3b 0f 75 bc 48 8b 05 bd-a3 00 00 48 8b 95 40 fe ;.u.H......H..@.
ff ff 48 85 c0 74 08 80-38 00 0f 95 c0 eb 02 31 ..H..t..8......1
c0 4c 8b b5 f0 fd ff ff-0f b6 c0 89 05 37 a1 00 .L...........7..
00 48 89 15 c8 a3 00 00-e8 96 30 00 00 48 8b 3d .H........0..H.=
e4 a3 00 00 e8 df 5b 00-00 c7 05 f5 a0 00 00 01 ......[.........
00 00 00 48 8b 1d be 62-00 00 4c 8b 25 df 62 00 ...H...b..L.%.b.
00 83 3b 00 74 1b 49 8b-44 24 08 49 8b 74 24 28 ..;.t.I.D$.I.t$(
48 8b 38 49 8b 54 24 30-e8 09 5b 00 00 85 c0 74 H.8I.T$0..[....t
26 49 8b 44 24 08 48 8b-00[8b]48 60 0f ba e1 0e &I.D$.H...H`.... <==
72 15 f7 c1 20 08 00 00-74 16 48 8b 08 48 85 c9 r... ...t.H..H..
74 05 80 39 00 75 09 31-ff e8 66 5a 00 00 eb b1 t..9.u.1..fZ....
b9 f0 0f 00 00 48 03 0d-6c 64 00 00 48 89 8d 20 .....H..ld..H..
Binary Images:
0x1037a5000 - 0x1037b0fff complist.so (*) <548d681b-b1bb-308b-9fc4-46b9349a598a> /usr/lib/zsh/5.8.1/zsh/complist.so
0x10370b000 - 0x103732fff zle.so (*) <404f32ff-1bc6-35b0-bd14-13315f01d1c3> /usr/lib/zsh/5.8.1/zsh/zle.so
0x10341d000 - 0x10349cfff zsh (*) <01a61f75-32b1-388a-9c76-89af23773325> /bin/zsh
0x103753000 - 0x103756fff private.so (*) <e0f7b839-6dde-3cfa-b1a7-7047eb83a89a> /usr/lib/zsh/5.8.1/zsh/param/private.so
0x10b6d7000 - 0x10b742fff dyld (*) <b70ce1ec-b902-3852-8268-05de00bfa8d5> /usr/lib/dyld
0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ???
External Modification Summary:
Calls made by other processes targeting this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
Calls made by this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
Calls made by all processes on this machine:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
VM Region Summary:
ReadOnly portion of Libraries: Total=347.6M resident=0K(0%) swapped_out_or_unallocated=347.6M(100%)
Writable regions: Total=1.2G written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=1.2G(100%)
VIRTUAL REGION
REGION TYPE SIZE COUNT (non-coalesced)
=========== ======= =======
Activity Tracing 256K 1
Kernel Alloc Once 8K 1
MALLOC 240.1M 30
MALLOC guard page 24K 5
MALLOC_MEDIUM (reserved) 600.0M 5 reserved VM address space (unallocated)
MALLOC_NANO (reserved) 384.0M 1 reserved VM address space (unallocated)
ObjC additional data 15K 1
STACK GUARD 56.0M 1
Stack 8192K 1
VM_ALLOCATE 616K 14
__DATA 610K 63
__DATA_CONST 646K 57
__DATA_DIRTY 58K 22
__LINKEDIT 340.6M 27
__TEXT 7140K 67
dyld private memory 1024K 1
mapped file 172K 3
shared memory 12K 2
=========== ======= =======
TOTAL 1.6G 302
TOTAL, minus reserved VM space 655.1M 302
-----------
Full Report
-----------
{"app_name":"zsh","timestamp":"2022-06-19 18:24:27.00 +0900","app_version":"","slice_uuid":"01a61f75-32b1-388a-9c76-89af23773325","build_version":"","platform":1,"share_with_app_devs":1,"is_first_party":1,"bug_type":"309","os_version":"macOS 12.4 (21F79)","incident_id":"59199F4A-FCF7-479E-B886-6E855F2C755F","name":"zsh"}
{
"uptime" : 150000,
"procLaunch" : "2022-06-15 22:01:29.3131 +0900",
"procRole" : "Unspecified",
"version" : 2,
"userID" : 501,
"deployVersion" : 210,
"modelCode" : "MacBookPro16,2",
"procStartAbsTime" : 101698890124682,
"coalitionID" : 452,
"osVersion" : {
"train" : "macOS 12.4",
"build" : "21F79",
"releaseType" : "User"
},
"captureTime" : "2022-06-19 18:24:27.8751 +0900",
"incident" : "59199F4A-FCF7-479E-B886-6E855F2C755F",
"bug_type" : "309",
"pid" : 89221,
"procExitAbsTime" : 157879079194959,
"cpuType" : "X86-64",
"procName" : "zsh",
"procPath" : "\/bin\/zsh",
"parentProc" : "Exited process",
"parentPid" : 89220,
"coalitionName" : "com.googlecode.iterm2",
"crashReporterKey" : "353BD5A4-B430-3E8C-E345-C290091E445C",
"responsiblePid" : 406,
"responsibleProc" : "iTerm2",
"wakeTime" : 2535,
"bridgeVersion" : {"build":"19P5071","train":"6.5"},
"sleepWakeUUID" : "E63869BF-BCA9-4BDB-936D-EB7306ED000D",
"sip" : "enabled",
"vmRegionInfo" : "0x18e61ce39280 is not in any region. Bytes after previous region: 27372118778497 Bytes before following region: 78176510045568\n REGION TYPE START - END [ VSIZE] PRT\/MAX SHRMOD REGION DETAIL\n VM_ALLOCATE (reserved) 10b78c000-10b78f000 [ 12K] r--\/r-- SM=NUL ...(unallocated)\n---> GAP OF 0x5ffef4871000 BYTES\n MALLOC_NANO 600000000000-600008000000 [128.0M] rw-\/rwx SM=COW ",
"isCorpse" : 1,
"exception" : {"codes":"0x0000000000000001, 0x000018e61ce39280","rawCodes":[1,27376606220928],"type":"EXC_BAD_ACCESS","signal":"SIGSEGV","subtype":"KERN_INVALID_ADDRESS at 0x000018e61ce39280"},
"termination" : {"flags":0,"code":11,"namespace":"SIGNAL","indicator":"Segmentation fault: 11","byProc":"exc handler","byPid":89221},
"vmregioninfo" : "0x18e61ce39280 is not in any region. Bytes after previous region: 27372118778497 Bytes before following region: 78176510045568\n REGION TYPE START - END [ VSIZE] PRT\/MAX SHRMOD REGION DETAIL\n VM_ALLOCATE (reserved) 10b78c000-10b78f000 [ 12K] r--\/r-- SM=NUL ...(unallocated)\n---> GAP OF 0x5ffef4871000 BYTES\n MALLOC_NANO 600000000000-600008000000 [128.0M] rw-\/rwx SM=COW ",
"extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0},
"faultingThread" : 0,
"threads" : [{"triggered":true,"id":2875871,"instructionState":{"instructionStream":{"bytes":[59,15,117,188,72,139,5,189,163,0,0,72,139,149,64,254,255,255,72,133,192,116,8,128,56,0,15,149,192,235,2,49,192,76,139,181,240,253,255,255,15,182,192,137,5,55,161,0,0,72,137,21,200,163,0,0,232,150,48,0,0,72,139,61,228,163,0,0,232,223,91,0,0,199,5,245,160,0,0,1,0,0,0,72,139,29,190,98,0,0,76,139,37,223,98,0,0,131,59,0,116,27,73,139,68,36,8,73,139,116,36,40,72,139,56,73,139,84,36,48,232,9,91,0,0,133,192,116,38,73,139,68,36,8,72,139,0,139,72,96,15,186,225,14,114,21,247,193,32,8,0,0,116,22,72,139,8,72,133,201,116,5,128,57,0,117,9,49,255,232,102,90,0,0,235,177,185,240,15,0,0,72,3,13,108,100,0,0,72,137,141,32],"offset":137}},"threadState":{"r13":{"value":1006},"rax":{"value":27376606220832},"rflags":{"value":66118},"cpu":{"value":5},"r14":{"value":1},"rsi":{"value":4353363146},"r8":{"value":0},"cr2":{"value":27376606220928},"rdx":{"value":3},"r10":{"value":1792},"r9":{"value":816},"r15":{"value":4350180668,"symbolLocation":0,"symbol":"queue_rear"},"rbx":{"value":4353743136,"symbolLocation":0,"symbol":"menuacc"},"trap":{"value":14,"description":"(no mapping for user data read)"},"err":{"value":4},"r11":{"value":18446638524920098240},"rip":{"value":4353339337,"matchesCrashFrame":1},"rbp":{"value":140701999007728},"rsp":{"value":140701999006720},"r12":{"value":4353743008,"symbolLocation":0,"symbol":"minfo"},"rcx":{"value":26},"flavor":"x86_THREAD_STATE","rdi":{"value":140187380267520}},"queue":"com.apple.main-thread","frames":[{"imageOffset":24521,"imageIndex":0},{"imageOffset":14190,"imageIndex":0},{"imageOffset":102615,"symbol":"completecall","symbolLocation":52,"imageIndex":1},{"imageOffset":47058,"symbol":"execzlefunc","symbolLocation":779,"imageIndex":1},{"imageOffset":101659,"imageIndex":1},{"imageOffset":6065,"symbol":"execbuiltin","symbolLocation":1818,"imageIndex":2},{"imageOffset":112955,"imageIndex":2},{"imageOffset":99423,"imageIndex":2},{"imageOffset":80467,"imageIndex":2},{"imageOffset":78990,"symbol":"execlist","symbolLocation":1855,"imageIndex":2},{"imageOffset":77104,"symbol":"execode","symbolLocation":207,"imageIndex":2},{"imageOffset":94035,"symbol":"runshfunc","symbolLocation":170,"imageIndex":2},{"imageOffset":15736,"symbol":"wrap_private","symbolLocation":105,"imageIndex":3},{"imageOffset":93968,"symbol":"runshfunc","symbolLocation":103,"imageIndex":2},{"imageOffset":92872,"symbol":"doshfunc","symbolLocation":1322,"imageIndex":2},{"imageOffset":97968,"imageIndex":2},{"imageOffset":111459,"imageIndex":2},{"imageOffset":99423,"imageIndex":2},{"imageOffset":80467,"imageIndex":2},{"imageOffset":78990,"symbol":"execlist","symbolLocation":1855,"imageIndex":2},{"imageOffset":236790,"symbol":"execif","symbolLocation":320,"imageIndex":2},{"imageOffset":110795,"imageIndex":2},{"imageOffset":99423,"imageIndex":2},{"imageOffset":80467,"imageIndex":2},{"imageOffset":78990,"symbol":"execlist","symbolLocation":1855,"imageIndex":2},{"imageOffset":77104,"symbol":"execode","symbolLocation":207,"imageIndex":2},{"imageOffset":94035,"symbol":"runshfunc","symbolLocation":170,"imageIndex":2},{"imageOffset":15736,"symbol":"wrap_private","symbolLocation":105,"imageIndex":3},{"imageOffset":93968,"symbol":"runshfunc","symbolLocation":103,"imageIndex":2},{"imageOffset":92872,"symbol":"doshfunc","symbolLocation":1322,"imageIndex":2},{"imageOffset":97968,"imageIndex":2},{"imageOffset":111459,"imageIndex":2},{"imageOffset":99423,"imageIndex":2},{"imageOffset":80467,"imageIndex":2},{"imageOffset":78990,"symbol":"execlist","symbolLocation":1855,"imageIndex":2},{"imageOffset":77104,"symbol":"execode","symbolLocation":207,"imageIndex":2},{"imageOffset":94035,"symbol":"runshfunc","symbolLocation":170,"imageIndex":2},{"imageOffset":15736,"symbol":"wrap_private","symbolLocation":105,"imageIndex":3},{"imageOffset":93968,"symbol":"runshfunc","symbolLocation":103,"imageIndex":2},{"imageOffset":92872,"symbol":"doshfunc","symbolLocation":1322,"imageIndex":2},{"imageOffset":97968,"imageIndex":2},{"imageOffset":111459,"imageIndex":2},{"imageOffset":99423,"imageIndex":2},{"imageOffset":80467,"imageIndex":2},{"imageOffset":78990,"symbol":"execlist","symbolLocation":1855,"imageIndex":2},{"imageOffset":77104,"symbol":"execode","symbolLocation":207,"imageIndex":2},{"imageOffset":94035,"symbol":"runshfunc","symbolLocation":170,"imageIndex":2},{"imageOffset":15736,"symbol":"wrap_private","symbolLocation":105,"imageIndex":3},{"imageOffset":93968,"symbol":"runshfunc","symbolLocation":103,"imageIndex":2},{"imageOffset":92872,"symbol":"doshfunc","symbolLocation":1322,"imageIndex":2},{"imageOffset":97968,"imageIndex":2},{"imageOffset":111459,"imageIndex":2},{"imageOffset":99423,"imageIndex":2},{"imageOffset":80467,"imageIndex":2},{"imageOffset":78990,"symbol":"execlist","symbolLocation":1855,"imageIndex":2},{"imageOffset":77104,"symbol":"execode","symbolLocation":207,"imageIndex":2},{"imageOffset":94035,"symbol":"runshfunc","symbolLocation":170,"imageIndex":2},{"imageOffset":15736,"symbol":"wrap_private","symbolLocation":105,"imageIndex":3},{"imageOffset":93968,"symbol":"runshfunc","symbolLocation":103,"imageIndex":2},{"imageOffset":92872,"symbol":"doshfunc","symbolLocation":1322,"imageIndex":2},{"imageOffset":47271,"symbol":"execzlefunc","symbolLocation":992,"imageIndex":1},{"imageOffset":101659,"imageIndex":1},{"imageOffset":6065,"symbol":"execbuiltin","symbolLocation":1818,"imageIndex":2},{"imageOffset":112955,"imageIndex":2},{"imageOffset":99423,"imageIndex":2},{"imageOffset":80467,"imageIndex":2},{"imageOffset":78990,"symbol":"execlist","symbolLocation":1855,"imageIndex":2},{"imageOffset":77104,"symbol":"execode","symbolLocation":207,"imageIndex":2},{"imageOffset":94035,"symbol":"runshfunc","symbolLocation":170,"imageIndex":2},{"imageOffset":15736,"symbol":"wrap_private","symbolLocation":105,"imageIndex":3},{"imageOffset":93968,"symbol":"runshfunc","symbolLocation":103,"imageIndex":2},{"imageOffset":92872,"symbol":"doshfunc","symbolLocation":1322,"imageIndex":2},{"imageOffset":97968,"imageIndex":2},{"imageOffset":111459,"imageIndex":2},{"imageOffset":99423,"imageIndex":2},{"imageOffset":80467,"imageIndex":2},{"imageOffset":78990,"symbol":"execlist","symbolLocation":1855,"imageIndex":2},{"imageOffset":236790,"symbol":"execif","symbolLocation":320,"imageIndex":2},{"imageOffset":110795,"imageIndex":2},{"imageOffset":99423,"imageIndex":2},{"imageOffset":80467,"imageIndex":2},{"imageOffset":78990,"symbol":"execlist","symbolLocation":1855,"imageIndex":2},{"imageOffset":77104,"symbol":"execode","symbolLocation":207,"imageIndex":2},{"imageOffset":94035,"symbol":"runshfunc","symbolLocation":170,"imageIndex":2},{"imageOffset":15736,"symbol":"wrap_private","symbolLocation":105,"imageIndex":3},{"imageOffset":93968,"symbol":"runshfunc","symbolLocation":103,"imageIndex":2},{"imageOffset":92872,"symbol":"doshfunc","symbolLocation":1322,"imageIndex":2},{"imageOffset":97968,"imageIndex":2},{"imageOffset":111459,"imageIndex":2},{"imageOffset":99423,"imageIndex":2},{"imageOffset":80467,"imageIndex":2},{"imageOffset":78990,"symbol":"execlist","symbolLocation":1855,"imageIndex":2},{"imageOffset":238203,"symbol":"exectry","symbolLocation":108,"imageIndex":2},{"imageOffset":110795,"imageIndex":2},{"imageOffset":99423,"imageIndex":2},{"imageOffset":80467,"imageIndex":2},{"imageOffset":78990,"symbol":"execlist","symbolLocation":1855,"imageIndex":2},{"imageOffset":77104,"symbol":"execode","symbolLocation":207,"imageIndex":2},{"imageOffset":94035,"symbol":"runshfunc","symbolLocation":170,"imageIndex":2},{"imageOffset":15736,"symbol":"wrap_private","symbolLocation":105,"imageIndex":3},{"imageOffset":93968,"symbol":"runshfunc","symbolLocation":103,"imageIndex":2},{"imageOffset":92872,"symbol":"doshfunc","symbolLocation":1322,"imageIndex":2},{"imageOffset":47271,"symbol":"execzlefunc","symbolLocation":992,"imageIndex":1},{"imageOffset":101659,"imageIndex":1},{"imageOffset":6065,"symbol":"execbuiltin","symbolLocation":1818,"imageIndex":2},{"imageOffset":112955,"imageIndex":2},{"imageOffset":99423,"imageIndex":2},{"imageOffset":80467,"imageIndex":2},{"imageOffset":78990,"symbol":"execlist","symbolLocation":1855,"imageIndex":2},{"imageOffset":236790,"symbol":"execif","symbolLocation":320,"imageIndex":2},{"imageOffset":110795,"imageIndex":2},{"imageOffset":99423,"imageIndex":2},{"imageOffset":80467,"imageIndex":2},{"imageOffset":78990,"symbol":"execlist","symbolLocation":1855,"imageIndex":2},{"imageOffset":77104,"symbol":"execode","symbolLocation":207,"imageIndex":2},{"imageOffset":94035,"symbol":"runshfunc","symbolLocation":170,"imageIndex":2},{"imageOffset":15736,"symbol":"wrap_private","symbolLocation":105,"imageIndex":3},{"imageOffset":93968,"symbol":"runshfunc","symbolLocation":103,"imageIndex":2},{"imageOffset":92872,"symbol":"doshfunc","symbolLocation":1322,"imageIndex":2},{"imageOffset":97968,"imageIndex":2},{"imageOffset":111459,"imageIndex":2},{"imageOffset":99423,"imageIndex":2},{"imageOffset":80467,"imageIndex":2},{"imageOffset":78990,"symbol":"execlist","symbolLocation":1855,"imageIndex":2},{"imageOffset":77104,"symbol":"execode","symbolLocation":207,"imageIndex":2},{"imageOffset":94035,"symbol":"runshfunc","symbolLocation":170,"imageIndex":2},{"imageOffset":15736,"symbol":"wrap_private","symbolLocation":105,"imageIndex":3},{"imageOffset":93968,"symbol":"runshfunc","symbolLocation":103,"imageIndex":2},{"imageOffset":92872,"symbol":"doshfunc","symbolLocation":1322,"imageIndex":2},{"imageOffset":97968,"imageIndex":2},{"imageOffset":111459,"imageIndex":2},{"imageOffset":99423,"imageIndex":2},{"imageOffset":80467,"imageIndex":2},{"imageOffset":78990,"symbol":"execlist","symbolLocation":1855,"imageIndex":2},{"imageOffset":77104,"symbol":"execode","symbolLocation":207,"imageIndex":2},{"imageOffset":94035,"symbol":"runshfunc","symbolLocation":170,"imageIndex":2},{"imageOffset":15736,"symbol":"wrap_private","symbolLocation":105,"imageIndex":3},{"imageOffset":93968,"symbol":"runshfunc","symbolLocation":103,"imageIndex":2},{"imageOffset":92872,"symbol":"doshfunc","symbolLocation":1322,"imageIndex":2},{"imageOffset":97968,"imageIndex":2},{"imageOffset":111459,"imageIndex":2},{"imageOffset":99423,"imageIndex":2},{"imageOffset":80467,"imageIndex":2},{"imageOffset":78990,"symbol":"execlist","symbolLocation":1855,"imageIndex":2},{"imageOffset":77104,"symbol":"execode","symbolLocation":207,"imageIndex":2},{"imageOffset":94035,"symbol":"runshfunc","symbolLocation":170,"imageIndex":2},{"imageOffset":15736,"symbol":"wrap_private","symbolLocation":105,"imageIndex":3},{"imageOffset":93968,"symbol":"runshfunc","symbolLocation":103,"imageIndex":2},{"imageOffset":92872,"symbol":"doshfunc","symbolLocation":1322,"imageIndex":2},{"imageOffset":47271,"symbol":"execzlefunc","symbolLocation":992,"imageIndex":1},{"imageOffset":48331,"symbol":"zlecore","symbolLocation":320,"imageIndex":1},{"imageOffset":49914,"symbol":"zleread","symbolLocation":1152,"imageIndex":1},{"imageOffset":192296,"symbol":"zleentry","symbolLocation":384,"imageIndex":2},{"imageOffset":195394,"symbol":"ingetc","symbolLocation":359,"imageIndex":2},{"imageOffset":160590,"imageIndex":2},{"imageOffset":217798,"symbol":"zshlex","symbolLocation":136,"imageIndex":2},{"imageOffset":311058,"symbol":"parse_event","symbolLocation":53,"imageIndex":2},{"imageOffset":181562,"symbol":"loop","symbolLocation":241,"imageIndex":2},{"imageOffset":193578,"symbol":"zsh_main","symbolLocation":1159,"imageIndex":2},{"imageOffset":21790,"symbol":"start","symbolLocation":462,"imageIndex":4}]}],
"usedImages" : [
{
"source" : "P",
"arch" : "x86_64",
"base" : 4353314816,
"size" : 49152,
"uuid" : "548d681b-b1bb-308b-9fc4-46b9349a598a",
"path" : "\/usr\/lib\/zsh\/5.8.1\/zsh\/complist.so",
"name" : "complist.so"
},
{
"source" : "P",
"arch" : "x86_64",
"base" : 4352684032,
"size" : 163840,
"uuid" : "404f32ff-1bc6-35b0-bd14-13315f01d1c3",
"path" : "\/usr\/lib\/zsh\/5.8.1\/zsh\/zle.so",
"name" : "zle.so"
},
{
"source" : "P",
"arch" : "x86_64",
"base" : 4349612032,
"size" : 524288,
"uuid" : "01a61f75-32b1-388a-9c76-89af23773325",
"path" : "\/bin\/zsh",
"name" : "zsh"
},
{
"source" : "P",
"arch" : "x86_64",
"base" : 4352978944,
"size" : 16384,
"uuid" : "e0f7b839-6dde-3cfa-b1a7-7047eb83a89a",
"path" : "\/usr\/lib\/zsh\/5.8.1\/zsh\/param\/private.so",
"name" : "private.so"
},
{
"source" : "P",
"arch" : "x86_64",
"base" : 4486688768,
"size" : 442368,
"uuid" : "b70ce1ec-b902-3852-8268-05de00bfa8d5",
"path" : "\/usr\/lib\/dyld",
"name" : "dyld"
},
{
"size" : 0,
"source" : "A",
"base" : 0,
"uuid" : "00000000-0000-0000-0000-000000000000"
}
],
"sharedCache" : {
"base" : 140703251447808,
"size" : 15220686848,
"uuid" : "398acfb4-57f6-31e0-bc82-e9959e5c92ce"
},
"vmSummary" : "ReadOnly portion of Libraries: Total=347.6M resident=0K(0%) swapped_out_or_unallocated=347.6M(100%)\nWritable regions: Total=1.2G written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=1.2G(100%)\n\n VIRTUAL REGION \nREGION TYPE SIZE COUNT (non-coalesced) \n=========== ======= ======= \nActivity Tracing 256K 1 \nKernel Alloc Once 8K 1 \nMALLOC 240.1M 30 \nMALLOC guard page 24K 5 \nMALLOC_MEDIUM (reserved) 600.0M 5 reserved VM address space (unallocated)\nMALLOC_NANO (reserved) 384.0M 1 reserved VM address space (unallocated)\nObjC additional data 15K 1 \nSTACK GUARD 56.0M 1 \nStack 8192K 1 \nVM_ALLOCATE 616K 14 \n__DATA 610K 63 \n__DATA_CONST 646K 57 \n__DATA_DIRTY 58K 22 \n__LINKEDIT 340.6M 27 \n__TEXT 7140K 67 \ndyld private memory 1024K 1 \nmapped file 172K 3 \nshared memory 12K 2 \n=========== ======= ======= \nTOTAL 1.6G 302 \nTOTAL, minus reserved VM space 655.1M 302 \n",
"legacyInfo" : {
"threadTriggered" : {
"queue" : "com.apple.main-thread"
}
},
"trialInfo" : {
"rollouts" : [
{
"rolloutId" : "607844aa04477260f58a8077",
"factorPackIds" : {
"SIRI_MORPHUN_ASSETS" : "6103050cbfe6dc472e1c982a"
},
"deploymentId" : 240000066
},
{
"rolloutId" : "5fc94383418129005b4e9ae0",
"factorPackIds" : {
},
"deploymentId" : 240000370
}
],
"experiments" : [
]
}
}
I think it is the same, with zsh-autocomplete: if you press the TAB before the select menu got printed out, and the actual select menu turned out to be empty, this may trigger a crash. There is comment in the scripts/.autocomplete.async:372
# Refresh if and only if our widget got called. Otherwise, Zsh will crash (eventually).
builtin zle -R
Maybe related to the crash.
Maybe related to https://stackoverflow.com/questions/26526175/zsh-menu-completion-causes-problems-after-zle-reset-prompt
@okuramasafumi @EdwarDu
Can you please try the following?
- On the command line, run
functions -t $_autocomplete__log_functions[@]
- Start your steps to reproduce the problem, but stop just before the final keystroke that induces the crash.
- In another shell session, run
rm -rf $_autocomplete__log $_autocomplete__log_async $_autocomplete__log_pty
- In your previous shell session, now press the final keystroke that makes
zsh
crash. - Attach in a comment here the files referenced by
$_autocomplete__log
,$_autocomplete__log_async
and$_autocomplete__log_pty
Then also try the following:
- Add
zstyle ':autocomplete:' async no
to your.zshrc
file. - Start a new
zsh
. - Try to reproduce the crash.
- Does it still occur?
Only $_autocomplete__log_pty has content, the other two are empty: more $_autocomplete__log_pty I zshexit: write error: Input/output error zshexit: write error: Input/output error zshexit: write error: Input/output error zshexit: write error: Input/output error zshexit: write error: Input/output error zshexit: write error: Input/output error zshexit: write error: Input/output error zshexit: write error: Input/output error zshexit: write error: Input/output error zshexit: write error: Input/output error zshexit: write error: Input/output error zshexit: write error: Input/output error zshexit: write error: Input/output error zshexit: write error: Input/output error zshexit: write error: Input/output error zshexit: write error: Input/output error zshexit: write error: Input/output error zshexit: write error: Input/output error
-- with zstyle ':autocomplete:' async no still crashing.
with this commented out, seems to be okay now.
#zstyle ':autocomplete:*' insert-unambiguous yes
@marlonrichert commented out line 168, 169 in .autocomplete.async, with zstyle ':autocomplete:*' insert-unambiguous yes
seems to be okay.
Anything to help please do let me know.
@EdwarDu Thanks! Now at least know at which point the crash occurs. However, I'm still not able to reproduce this.
@EdwarDu @okuramasafumi Can both of you please try to run your test case in the following setup? Does the crash then still occur?
cd $(mktemp -d)
> .zshrc <<EOF
PS1='%# ' PS2= RPS2='%^'; setopt transientrprompt interactivecomments
source /path/to/zsh-autocomplete.plugin.zsh
EOF
env -i HOME=$PWD PATH=$PATH TERM=$TERM ${TERMINFO:+TERMINFO=$TERMINFO} zsh -d
@EdwarDu Thanks! Now at least know at which point the crash occurs. However, I'm still not able to reproduce this.
@EdwarDu @okuramasafumi Can both of you please try to run your test case in the following setup? Does the crash then still occur?
cd $(mktemp -d) > .zshrc <<EOF PS1='%# ' PS2= RPS2='%^'; setopt transientrprompt interactivecomments source /path/to/zsh-autocomplete.plugin.zsh EOF env -i HOME=$PWD PATH=$PATH TERM=$TERM ${TERMINFO:+TERMINFO=$TERMINFO} zsh -d
If I add
zstyle ':autocomplete:*' widget-style menu-select
zstyle ':autocomplete:*' insert-unambiguous yes
to the profile above, I can reproduce the crash
@marlonrichert I cannot reproduce with this setup. I also set
zstyle ':autocomplete:*' widget-style menu-select
zstyle ':autocomplete:*' insert-unambiguous yes
so that might be related as @EdwarDu pointed.
I'm unable to reproduce this:
% cd $(mktemp -d)
% > .zshrc <<EOF
PS1='%# ' PS2= RPS2='%^'; setopt transientrprompt interactivecomments
zstyle ':autocomplete:*' widget-style menu-select
zstyle ':autocomplete:*' insert-unambiguous yes
source /path/to/zsh-autocomplete.plugin.zsh
EOF
% env -i HOME=$PWD PATH=$PATH TERM=$TERM ${TERMINFO:+TERMINFO=$TERMINFO} zsh -d
% git clone https://github.com/okuramasafumi/xa
Cloning into 'xa'...
remote: Enumerating objects: 168, done.
remote: Counting objects: 100% (168/168), done.
remote: Compressing objects: 100% (111/111), done.
remote: Total 168 (delta 72), reused 141 (delta 49), pack-reused 0
Receiving objects: 100% (168/168), 25.44 KiB | 2.54 MiB/s, done.
Resolving deltas: 100% (72/72), done.
% cd xa
% nvim gemm<TAB>Gemfile
Been getting a lot of segfaults too lately. I am ssh-ing to the server running zsh-autocomplete and it kills my connection. Syslog has this line - kernel: [355798.498214] zsh[35107]: segfault at 55f6f05de2a0 ip 00007f5e130b9d3c sp 00007fff822674f0 error 4 in complist.so[7f5e130b7000+b000]
@YenLegion If you could make me a minimal, reproducible test case, that would help a lot. I cannot fix the problem if I cannot reproduce it.
I think somehow need to file a report to zsh also as it is segv in complete.so of zsh itself.
@EdwarDu That is correct, but they won’t be able to do anything about it until we figure what code is actually causing it to crash. If you can find out what it is, that would be super helpful to both me and the Zsh team.
Can you git pull
and try again? Does the bug still occur with the latest version?
I have been using custom build zsh-5.8.1 + git version of this plugin for some time now, have not come across the same issue recently.
OK, I’m gonna close it, then. If someone still experiences this, let me know.
I got a bit time recently to hunt this, and I'm able to reproduce it constantly with my work environment (cd to a slow nfs directory with an invalid subdirectory will crash most times, e.g. cd <slow_nfs_path_dir>/dirab where dirab does not exist, just press tab fast enough before the menu shows up, segfault will happen). I tried to build zsh with debug symbols and try to catch in gdb to see what part is causing this problem. Though I don't know the root-cause yet, I found that in zsh/Zle itself there is do_ambiguous function handle the matching and insertion, then there are two lines in .autocomplete.async
[[ $_lastcomp[insert] == *unambiguous ]] && builtin zle .auto-suffix-retain # Make the cursor stay in the right place.
seems to in conflict of Zle's internal management.
If I comment out these two lines, then I can't reproduce the segfault doing the same thing above.
@marlonrichert : Are those two lines actually necessary? What is behavior without/with thse two lines? (I can't observe behavior change without them)
Comment out thse two lines may not be the correct solution (may just lower the rate of segment that my tab pressing is not faster enough to reproduce).
I agree that it is partially a design flaw at Zle's side, it should not crash on segfault even client side has wrong settings etc.
Thanks for investigating! Do you think you could make a small, reproducible test case for this without using Autocomplete and submit it as a bug report to the official zsh-workers
mailing list? That would help a lot.
Are those two lines actually necessary? What is behavior without/with thse two lines? (I can't observe behavior change without them)
Without these, the cursor sometimes jumps to an unexpected position when using insert-unambiguous
. Since this happens during autocompletion, it can be quite confusing.
Thanks for investigating! Do you think you could make a small, reproducible test case for this without using Autocomplete and submit it as a bug report to the official
zsh-workers
mailing list? That would help a lot.Are those two lines actually necessary? What is behavior without/with thse two lines? (I can't observe behavior change without them)
Without these, the cursor sometimes jumps to an unexpected position when using
insert-unambiguous
. Since this happens during autocompletion, it can be quite confusing.
sorr y for the late reply. I will try, but I'm not familiar with the widget scripting part, and I can't reproduce reliably on my own desktop.
@EdwarDu Give it a try and if you run into problems or have questions, I’ll be happy to help. 🙂