| author | |
| committer | |
| log | c44be99f1abff2ab67d69964efecca380b96219e |
| tree | fa23d98c084668ad9bc2eabb24b12ce206de11af |
| parent | 4de2b1ea65e6b54cedfe56268a8bf8e9446addb0 |
- patch authored by Jacob Young
- tested on alpine-aarch64, 3.21.0, qemu-system 9.2.0
- issue manifested on Alpine Linux aarch64 under qemu-system where
zig2 fails during bootstrap: error.ProcessFdQuotaExceeded2 files changed, 12 insertions(+), 0 deletions(-)
lib/std/debug.zig+1| ... | @@ -775,6 +775,7 @@ pub const StackIterator = struct { | ... | @@ -775,6 +775,7 @@ pub const StackIterator = struct { |
| 775 | } | 775 | } |
| 776 | 776 | ||
| 777 | pub fn deinit(it: *StackIterator) void { | 777 | pub fn deinit(it: *StackIterator) void { |
| 778 | it.ma.deinit(); | ||
| 778 | if (have_ucontext and it.unwind_state != null) it.unwind_state.?.dwarf_context.deinit(); | 779 | if (have_ucontext and it.unwind_state != null) it.unwind_state.?.dwarf_context.deinit(); |
| 779 | } | 780 | } |
| 780 | 781 |
lib/std/debug/MemoryAccessor.zig+11| ... | @@ -25,6 +25,17 @@ pub const init: MemoryAccessor = .{ | ... | @@ -25,6 +25,17 @@ pub const init: MemoryAccessor = .{ |
| 25 | }, | 25 | }, |
| 26 | }; | 26 | }; |
| 27 | 27 | ||
| 28 | pub fn deinit(ma: *MemoryAccessor) void { | ||
| 29 | switch (native_os) { | ||
| 30 | .linux => switch (ma.mem.handle) { | ||
| 31 | -2, -1 => {}, | ||
| 32 | else => ma.mem.close(), | ||
| 33 | }, | ||
| 34 | else => {}, | ||
| 35 | } | ||
| 36 | ma.* = undefined; | ||
| 37 | } | ||
| 38 | |||
| 28 | fn read(ma: *MemoryAccessor, address: usize, buf: []u8) bool { | 39 | fn read(ma: *MemoryAccessor, address: usize, buf: []u8) bool { |
| 29 | switch (native_os) { | 40 | switch (native_os) { |
| 30 | .linux => while (true) switch (ma.mem.handle) { | 41 | .linux => while (true) switch (ma.mem.handle) { |