From 79f8cf1326d63fd4e355aa0c0856617698afd867 Mon Sep 17 00:00:00 2001 From: Justus Klausecker Date: Fri, 20 Mar 2026 17:19:28 +0100 Subject: [PATCH] std.debug.Info: make Mach-O source location resolution more resilient `resolveAddresses` now also works if some calls to `getDwarfForAddress` fail with `error.MissingDebugInfo`; the affected source location is set to `.invalid`. This makes fuzzing work with `ReleaseSafe` for Mach-O. --- lib/std/debug/Info.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/std/debug/Info.zig b/lib/std/debug/Info.zig index d16db5d695..e614700e00 100644 --- a/lib/std/debug/Info.zig +++ b/lib/std/debug/Info.zig @@ -99,6 +99,10 @@ pub fn resolveAddresses( // due to split debug information. For now, we'll just resolve the addreses one by one. for (sorted_pc_addrs, output) |pc_addr, *src_loc| { const dwarf, const dwarf_pc_addr = mf.getDwarfForAddress(gpa, io, pc_addr) catch |err| switch (err) { + error.MissingDebugInfo => { + src_loc.* = .invalid; + continue; + }, error.InvalidMachO, error.InvalidDwarf => return error.InvalidDebugInfo, else => |e| return e, };