Skip to content

zls crashes every time on start. (.OBJECT_NAME_INVALID => unreachable) #158

@doongjohn

Description

@doongjohn

This happens every time when I start vscode.

crash output:

reached unreachable code
D:\zig\lib\zig\std\os\windows.zig:113:37: 0x7ff6c75b7839 in std.os.windows.OpenFile (zls.obj)
            .OBJECT_NAME_INVALID => unreachable,
                                    ^
D:\zig\lib\zig\std\os.zig:4092:31: 0x7ff6c75bdd80 in std.os.realpathW (zls.obj)
        const res = w.OpenFile(pathname, .{
                              ^
D:\zig\lib\zig\std\os.zig:4040:25: 0x7ff6c75ae87d in std.os.realpath (zls.obj)
        return realpathW(pathname_w.span(), out_buffer);
                        ^
D:\zls\src\main.zig:1593:75: 0x7ff6c759481b in main (zls.obj)
            zig_exe_path = try std.mem.dupe(allocator, u8, std.os.realpath(full_path, &buf) catch continue);
                                                                          ^
D:\zig\lib\zig\std\start.zig:154:65: 0x7ff6c7591f1e in std.start.WinMainCRTStartup (zls.obj)
    std.os.windows.kernel32.ExitProcess(initEventLoopAndCallMain());
                                                                ^
Unable to dump stack trace: FileNotFound

platform: Windows 10
zls client: zls-vscode
zig version: master (0.6.0+9fe4c8923) (used to build zls)
zig is in my PATH

Edit:
Fixed by using zls.json and providing the path to zig.

I think this happened because of my antivirus software. It was not related to antivirus software.

Edit:

zls.json

{
    "zig_exe_path": "D:\\zig\\zig.exe"
}

└> this works.

{
    "zig_exe_path": "D:\\zig"
}

└> this works but can't start zig fmt process.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions