authorgravatar for goon.pri.low@gmail.comKendall Condon <goon.pri.low@gmail.com> 2026-04-22 20:53:33-04:00
committergravatar for goon.pri.low@gmail.comKendall Condon <goon.pri.low@gmail.com> 2026-04-22 20:54:17-04:00
log332d632ccceb65d2b28cceee740d794d6d7c4c2a
tree391dbcf68883e56d6020c5f7fc631ac49246fa91
parent122e0c26f23e765d91f0ff15533aeac2f4bc8f65

collect all stderr on fuzzing crash


1 files changed, 7 insertions(+), 3 deletions(-)

lib/std/Build/Step/Run.zig+7-3
......@@ -2166,11 +2166,15 @@ const FuzzTestRunner = struct {
21662166 const result = completion.result;
21672167 switch (completion.index % 3) {
21682168 0 => try f.completeStdinWrite(id, result.file_write_streaming catch |e| switch (e) {
2169 error.BrokenPipe => return f.instanceEos(id),
2169 // Avoid calling `instanceEos` until EndOfStream is seen with stderr so
2170 // that all stderr is collected.
2171 error.BrokenPipe => continue,
21702172 else => |write_e| return write_e,
21712173 }),
21722174 1 => try f.completeStdoutRead(id, result.file_read_streaming catch |e| switch (e) {
2173 error.EndOfStream => return f.instanceEos(id),
2175 // Avoid calling `instanceEos` until EndOfStream is seen with stderr so
2176 // that all stderr is collected.
2177 error.EndOfStream => continue,
21742178 else => |read_e| return read_e,
21752179 }),
21762180 2 => try f.completeStderrRead(id, result.file_read_streaming catch |e| switch (e) {
......@@ -2480,7 +2484,7 @@ const FuzzTestRunner = struct {
24802484 const step_owner = f.run.step.owner;
24812485 const arena = step_owner.allocator;
24822486
2483 // Collect any remaining stderr
2487 // Collect any available stderr
24842488 while (f.batch.next()) |completion| {
24852489 if (completion.index % 3 != 2) continue;
24862490 const len = completion.result.file_read_streaming catch continue;