uname -ra
Darwin Kernel Version root:xnu-3789.73.27~1/RELEASE_X86_64 x86_64
zig version
0.4.0+08d41da9
I created the following program;
const std = @import("std");
const os = std.os;
const warn = std.debug.warn;
pub fn main() !void {
var file = try os.File.openRead("~/nonExistent/ok.txt");
defer file.close();
var buffer: [20]u8 = undefined;
_ = try file.read(buffer[0..buffer.len]);
warn("buffer:\n");
warn("{}", buffer);
}
then I ran;
zig fmt . && zig build-exe main.zig && ./main
I got the following:
error: FileNotFound
???:?:?: 0x103ce2826 in _std.os.posixOpenC (main.o)
???:?:?: 0x103cdba65 in _std.os.file.File.openReadC (main.o)
???:?:?: 0x103cdaf48 in _std.os.file.File.openRead (main.o)
???:?:?: 0x103ce8337 in _main.0 (main.o)
the stacktrace is missing file positions and other useful details
seems that this issue was introduced with commit 6756e545f40dc7de373186a6581594e07bfd8200
I think it's finally time to introduce a stack trace regression test before closing this issue.
This is fixed now, and thanks to @mikdusan it is covered by a regression test.
Most helpful comment
I think it's finally time to introduce a stack trace regression test before closing this issue.