Skip to content

Zig Language Server crashes #543

@DashBe

Description

@DashBe

I use zls with vscode (zls for vscode extension), but the server crashes.
OS: Windows 11
Zig: 0.10.0-dev.3023+9c66fdadc
zls: master ba68a4d
VSCode: 1.69.1
And here's the log

[Info  - 8:39:19] Connection to server got closed. Server will restart.
[Info  - 8:39:19] [info-config] Using zig executable C:\Users\fairn\zig\zig.exe
[Info  - 8:39:19] [info-config] Using zig lib path 'C:\Users\fairn\zig\lib'
[Info  - 8:39:20] [info-main] zls initialized
[Info  - 8:39:20] [info-main] ClientCapabilities{ .supports_snippets = true, .supports_semantic_tokens = true, .hover_supports_md = true, .completion_doc_supports_md = true, .label_details_support = true, .supports_configuration = true }
[Info  - 8:39:20] [info-main] Using offset encoding: utf16
[Info  - 8:39:20] [info-main] Requesting configuration!
thread 15960 panic: reached unreachable code
C:\Users\fairn\zls\src\offsets.zig:128:35: 0x7ff6e7fa36fd in ffsets.tokenRelativeLocation (zls.obj)
                const codepoint = try std.unicode.utf8Decode(source[i .. i + n]);
                                  ^
C:\Users\fairn\zls\src\semantic_tokens.zig:181:52: 0x7ff6e7fa3243 in emantic_tokens.Builder::semantic_tokens.Builder.addDirect (zls.obj)
        const delta = offsets.tokenRelativeLocation(
                                                   ^
C:\Users\fairn\zls\src\semantic_tokens.zig:176:31: 0x7ff6e7fa2e15 in emantic_tokens.Builder::semantic_tokens.Builder.handleComments (zls.obj)
            try self.addDirect(TokenType.comment, mods, comment_start, length);
                              ^
C:\Users\fairn\zls\src\semantic_tokens.zig:86:32: 0x7ff6e7fd47de in emantic_tokens.Builder::semantic_tokens.Builder.add (zls.obj)
        try self.handleComments(if (token > 0) starts[token - 1] else 0, next_start);
                               ^
C:\Users\fairn\zls\src\semantic_tokens.zig:260:26: 0x7ff6e7f9d797 in emantic_tokens.colorIdentifierBasedOnType (zls.obj)
        try writeTokenMod(builder, target_tok, .variable, tok_mod);
                         ^
C:\Users\fairn\zls\src\semantic_tokens.zig:444:51: 0x7ff6e7f9b8e1 in emantic_tokens.writeNodeTokens (zls.obj)
                    try colorIdentifierBasedOnType(builder, decl_type, main_token, .{});
                                                  ^
C:\Users\fairn\zls\src\semantic_tokens.zig:872:23: 0x7ff6e7f9844e in emantic_tokens.writeNodeTokens (zls.obj)
            try await @asyncCall(child_frame, {}, writeNodeTokens, .{ builder, arena, store, node_data[node].lhs });
                      ^
C:\Users\fairn\zls\src\semantic_tokens.zig:339:31: 0x7ff6e7f9a049 in emantic_tokens.writeNodeTokens (zls.obj)
                    try await @asyncCall(child_frame, {}, writeNodeTokens, .{ builder, arena, store, child });
                              ^
C:\Users\fairn\zls\src\semantic_tokens.zig:541:23: 0x7ff6e7f9b12f in emantic_tokens.writeNodeTokens (zls.obj)
            try await @asyncCall(child_frame, {}, writeNodeTokens, .{ builder, arena, store, switch_case.ast.target_expr });
                      ^
C:\Users\fairn\zls\src\main.zig:1889:71: 0x7ff6e7f49d06 in emanticTokensFullHandler (zls.obj)
        const token_array = try semantic_tokens.writeAllSemanticTokens(arena, &document_store, handle, offset_encoding);
                                                                      ^
C:\Users\fairn\zls\src\main.zig:2334:17: 0x7ff6e7f31443 in rocessJsonRpc (zls.obj)
                if (requests.fromDynamicTree(arena, ReqT, tree.root)) |request_obj| {
                ^
C:\Users\fairn\zls\src\main.zig:2506:27: 0x7ff6e7ed8770 in ain (zls.obj)
        try processJsonRpc(&arena, &json_parser, buf, &config);
                          ^
C:\Users\fairn\zig\lib\std\start.zig:349:65: 0x7ff6e7ed5171 in td.start.WinStartup (zls.obj)
    std.os.windows.kernel32.ExitProcess(initEventLoopAndCallMain());
                                                                ^
Unable to dump stack trace: FileNotFound
[Error - 8:39:20] The Zig Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions