diff --git a/lib/std/Build/Step/Compile.zig b/lib/std/Build/Step/Compile.zig index 7dd9c17273..4ea09538c2 100644 --- a/lib/std/Build/Step/Compile.zig +++ b/lib/std/Build/Step/Compile.zig @@ -1932,6 +1932,11 @@ pub fn rebuildInFuzzMode(c: *Compile, gpa: Allocator, progress_node: std.Progres c.step.result_error_bundle.deinit(gpa); c.step.result_error_bundle = std.zig.ErrorBundle.empty; + if (c.step.result_failed_command) |cmd| { + gpa.free(cmd); + c.step.result_failed_command = null; + } + const zig_args = try getZigArgs(c, true); const maybe_output_bin_path = try c.step.evalZigProcess(zig_args, progress_node, false, null, gpa); return maybe_output_bin_path.?; diff --git a/lib/std/Build/Step/Run.zig b/lib/std/Build/Step/Run.zig index 52a690ef94..dfae77ffb5 100644 --- a/lib/std/Build/Step/Run.zig +++ b/lib/std/Build/Step/Run.zig @@ -1140,6 +1140,12 @@ pub fn rerunInFuzzMode( .output_file, .output_directory => unreachable, } } + + if (run.step.result_failed_command) |cmd| { + fuzz.gpa.free(cmd); + run.step.result_failed_command = null; + } + const has_side_effects = false; const rand_int = std.crypto.random.int(u64); const tmp_dir_path = "tmp" ++ fs.path.sep_str ++ std.fmt.hex(rand_int); @@ -1150,7 +1156,7 @@ pub fn rerunInFuzzMode( .web_server = null, // only needed for time reports .ttyconf = fuzz.ttyconf, .unit_test_timeout_ns = null, // don't time out fuzz tests for now - .gpa = undefined, // not used by `runCommand` + .gpa = fuzz.gpa, }, .{ .unit_test_index = unit_test_index, .fuzz = fuzz, @@ -1870,7 +1876,10 @@ fn pollZigTest( // test. For instance, if the test runner leaves this much time between us requesting a test to // start and it acknowledging the test starting, we terminate the child and raise an error. This // *should* never happen, but could in theory be caused by some very unlucky IB in a test. - const response_timeout_ns = @max(options.unit_test_timeout_ns orelse 0, 60 * std.time.ns_per_s); + const response_timeout_ns: ?u64 = ns: { + if (fuzz_context != null) break :ns null; // don't timeout fuzz tests + break :ns @max(options.unit_test_timeout_ns orelse 0, 60 * std.time.ns_per_s); + }; const stdout = poller.reader(.stdout); const stderr = poller.reader(.stderr);