diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-03-10 19:28:05 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-03-10 19:28:05 -0400 |
| commit | 9abee660dce3b43b9ac3b8260fbf269532d6c7f5 (patch) | |
| tree | 3ca43e7feef531f6b898e8977e4e752cce56d1b3 /lib/std/debug.zig | |
| parent | cd26d3b0bb2b32f1daf1d3d46bb53731dd54afec (diff) | |
| download | zig-9abee660dce3b43b9ac3b8260fbf269532d6c7f5.tar.gz zig-9abee660dce3b43b9ac3b8260fbf269532d6c7f5.zip | |
fix stack trace code not opening files in forced blocking mode
Diffstat (limited to 'lib/std/debug.zig')
| -rw-r--r-- | lib/std/debug.zig | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig index b27b1caa68..e849d72bcf 100644 --- a/lib/std/debug.zig +++ b/lib/std/debug.zig @@ -964,7 +964,9 @@ fn openMachODebugInfo(allocator: *mem.Allocator, macho_file_path: []const u8) !M } fn printLineFromFileAnyOs(out_stream: var, line_info: LineInfo) !void { - var f = try fs.cwd().openFile(line_info.file_name, .{}); + // Need this to always block even in async I/O mode, because this could potentially + // be called from e.g. the event loop code crashing. + var f = try fs.cwd().openFile(line_info.file_name, .{ .always_blocking = true }); defer f.close(); // TODO fstat and make sure that the file has the correct size |
