zls
zls copied to clipboard
Index out of bounds panic
thread 16548 panic: index out of bounds
C:\cygwin64\home\kcbanner\kit\zls\src\analysis.zig:1624:5: 0x7ff7a03eaec7 in analysis.documentPositionContext (zls.obj)
return block: {
^
C:\cygwin64\home\kcbanner\kit\zls\src\main.zig:1719:53: 0x7ff7a03b35c8 in processJsonRpc (zls.obj)
done = extractErr(method_info[2](arena, id, request_obj, config));
^
C:\cygwin64\home\kcbanner\kit\zls\src\main.zig:1962:27: 0x7ff7a037e94a in main (zls.obj)
try processJsonRpc(&arena, &json_parser, buf, config);
^
E:\dev\zig-windows-x86_64-0.9.0-dev.315+1534cd2f8\lib\zig\std\start.zig:256:65: 0x7ff7a03765d1 in std.start.WinStartup (zls.obj)
std.os.windows.kernel32.ExitProcess(initEventLoopAndCallMain());
^
Unable to dump stack trace: FileNotFound
I think this may be related to having an @import that results in a file not found, will update with more info if I find a more specific repro.
what was the code that caused this to happen?
Also ran into this problem (or a similar problem). Here is a repo which reliably crashes ZLS for me on Windows (haven't tested on other systems): https://github.com/obiwanus/zls-crash-test
In the readme there are instructions on how to reproduce the crash.
I forgot to add that I tested it in VSCode
The provided reproduction no longer crashes with latest zls (after making the necessary changes to get zig build -h
to work with latest zig).