zls icon indicating copy to clipboard operation
zls copied to clipboard

Crash if %LOCALAPPDATA%\Temp does not exist

Open MaxGilmore opened this issue 4 years ago • 0 comments

This occurs on windows. If the %LOCALAPPDATA%\Temp directory does not exist and "global_cache_path" is not set in zls.json then zls crashes on launch with no useful error messages.

PS D:\Code\Zig\Compiler\zls\zls\zig-out\bin> .\zls.exe
info : (config): Using zig executable D:\Code\Zig\Compiler\zig.exe
info : (config): Using zig lib path 'D:\Code\Zig\Compiler\lib'
error: ( gpa  ): memory address 0x230c4d50020 leaked:


error: ( gpa  ): memory address 0x230c4d50080 leaked:


error: ( gpa  ): memory address 0x230c5130000 leaked:


error: ( gpa  ): memory address 0x230c5130080 leaked:


error: (default): FileNotFound
D:\Code\Zig\Compiler\lib\std\os\windows.zig:132:35: 0x7ff65445d186 in std.os.windows.OpenFile (zls.obj)
        .PIPE_BUSY => return error.PipeBusy,
                                  ^
D:\Code\Zig\Compiler\zls\zls\src\Config.zig:216:31: 0x7ff654412289 in Config.configChanged (zls.obj)
        std.fs.makeDirAbsolute(config.global_cache_path.?) catch |err| switch(err) {
                              ^
D:\Code\Zig\Compiler\zls\zls\src\Config.zig:216:31: 0x7ff654412291 in Config.configChanged (zls.obj)
        std.fs.makeDirAbsolute(config.global_cache_path.?) catch |err| switch(err) {
                              ^
D:\Code\Zig\Compiler\zls\zls\src\Config.zig:216:31: 0x7ff654412299 in Config.configChanged (zls.obj)
        std.fs.makeDirAbsolute(config.global_cache_path.?) catch |err| switch(err) {
                              ^
D:\Code\Zig\Compiler\zls\zls\src\Config.zig:189:29: 0x7ff6544123f8 in Config.configChanged (zls.obj)
        defer allocator.free(result.stdout);
                            ^
D:\Code\Zig\Compiler\zls\zls\src\main.zig:259:11: 0x7ff6543e7217 in main (zls.obj)
    defer if (config.config_path) |path| allocator.free(path);
          ^
D:\Code\Zig\Compiler\zls\zls\src\main.zig:259:56: 0x7ff6543e60a0 in main (zls.obj)
    defer if (config.config_path) |path| allocator.free(path);
                                                       ^

MaxGilmore avatar Sep 20 '22 18:09 MaxGilmore