authorgravatar for justus@klausecker.deJustus Klausecker <justus@klausecker.de> 2026-03-20 17:19:28+01:00
committergravatar for justus@klausecker.deJustus Klausecker <justus@klausecker.de> 2026-03-20 17:19:28+01:00
log79f8cf1326d63fd4e355aa0c0856617698afd867
treeb362a5aa2acba7b0048ab23ab0830f1398649d67
parent06b85a4fd00bee590ec908d9f32c0263982f13c3

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.

1 files changed, 4 insertions(+), 0 deletions(-)

lib/std/debug/Info.zig+4
......@@ -99,6 +99,10 @@ pub fn resolveAddresses(
9999 // due to split debug information. For now, we'll just resolve the addreses one by one.
100100 for (sorted_pc_addrs, output) |pc_addr, *src_loc| {
101101 const dwarf, const dwarf_pc_addr = mf.getDwarfForAddress(gpa, io, pc_addr) catch |err| switch (err) {
102 error.MissingDebugInfo => {
103 src_loc.* = .invalid;
104 continue;
105 },
102106 error.InvalidMachO, error.InvalidDwarf => return error.InvalidDebugInfo,
103107 else => |e| return e,
104108 };