Open nolanderc opened 2 years ago
I have a hunch that this might be related to #8205, since all sources live in WSL and thus use UNC paths when creating the stack trace.
Now that https://github.com/ziglang/zig/pull/15768 is merged, could anyone using WSL2 test to see if this was fixed by it?
Now that #15768 is merged, could anyone using WSL2 test to see if this was fixed by it?
Stack traces are still broken like that on WSL2:
???:?:?: 0x7ff77c7d33a2 in ??? (test.exe)
I looked into this, and it's happening because the PDB path is of the form /home/kcbanner/temp/12729/zig-cache/o/84727f745cb2d4778303a1b5b8068004/12729.pdb
.
After the call to fs.path.resolve
in readCoffDebugInfo
, path
is \home\kcbanner\temp\12729\zig-cache\o\84727f745cb2d4778303a1b5b8068004\12729.pdb
. This then fails to open in the call to openFile
in Pdb.init
.
There is an additional problem, even if you do find the PDB by doing something like:
const pdb_paths = [_][]const u8{
path,
fs.path.basename(path),
};
di.debug_data = PdbOrDwarf{ .pdb = undefined };
di.debug_data.pdb = for (pdb_paths) |pdb_path| {
break pdb.Pdb.init(allocator, pdb_path) catch |err| switch (err) {
error.FileNotFound, error.IsDir => continue,
else => return err,
};
} else return error.MissingDebugInfo;
All the source paths are also unix-style, ie:
So to support this we'd need to have some path-mapping heuristic for source files as well.
Zig Version
0.10.0-dev.3857+10e11b60e
Steps to Reproduce
and replace
src/main.zig
with the following:Then build the program on a non-windows OS (tested using Ubuntu 20.04 through WSL2):
Expected Behavior
The program should terminate with a message containing the error and a stack trace showing where the error originated from. For example, this is the result when on WSL2 using
zig build run
:Actual Behavior
Attempting to run this program on a Windows machine (tested on Windows 11 build 22000.856) produces the following output: