Skip to content

Commit

Permalink
std.debug: Gracefully handle process_vm_readv() EPERM in MemoryAccess…
Browse files Browse the repository at this point in the history
…or.read().

Closes #21815.
  • Loading branch information
alexrp committed Nov 20, 2024
1 parent a5d4ad1 commit f845fa0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/std/debug/MemoryAccessor.zig
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ fn read(ma: *MemoryAccessor, address: usize, buf: []u8) bool {
switch (linux.E.init(bytes_read)) {
.SUCCESS => return bytes_read == buf.len,
.FAULT => return false,
.INVAL, .PERM, .SRCH => unreachable, // own pid is always valid
.INVAL, .SRCH => unreachable, // own pid is always valid
.PERM => {}, // Known to happen in containers.
.NOMEM => {},
.NOSYS => {}, // QEMU is known not to implement this syscall.
else => unreachable, // unexpected
Expand Down

0 comments on commit f845fa0

Please sign in to comment.