From e5ebdf9e4199abc347c72d0ff00e211e858a200c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Wed, 1 Oct 2025 03:24:38 +0200 Subject: [PATCH 1/3] libc-test: disable malloc-oom.c This causes QEMU to OOM in CI. --- test/libc.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/libc.zig b/test/libc.zig index b11821534644..7b1953e2418f 100644 --- a/test/libc.zig +++ b/test/libc.zig @@ -91,7 +91,7 @@ pub fn addCases(cases: *tests.LibcContext) void { cases.addLibcTestCase("regression/lseek-large.c", false, .{}); cases.addLibcTestCase("regression/malloc-0.c", true, .{}); // "regression/malloc-brk-fail.c": QEMU OOM - cases.addLibcTestCase("regression/malloc-oom.c", false, .{}); // wasi-libc: requires t_memfill + // cases.addLibcTestCase("regression/malloc-oom.c", false, .{}); // wasi-libc: requires t_memfill; QEMU OOM cases.addLibcTestCase("regression/mbsrtowcs-overflow.c", true, .{}); cases.addLibcTestCase("regression/memmem-oob-read.c", true, .{}); cases.addLibcTestCase("regression/memmem-oob.c", true, .{}); From f049ae6d57341b4abd64fb6e65b6f9a05af1c226 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Tue, 30 Sep 2025 18:50:38 +0200 Subject: [PATCH 2/3] libc-test: set a 1.6G max_rss for each test case 1.4G was the highest value I observed for any test case on x86_64-linux. This change should prevent OOM conditions in CI. --- build.zig | 2 ++ test/src/Libc.zig | 3 +++ 2 files changed, 5 insertions(+) diff --git a/build.zig b/build.zig index 8611afabdef3..2c68e29b2472 100644 --- a/build.zig +++ b/build.zig @@ -609,6 +609,8 @@ pub fn build(b: *std.Build) !void { .optimize_modes = optimization_modes, .test_filters = test_filters, .test_target_filters = test_target_filters, + // Highest RSS observed in any test case was exactly 1465151488 on x86_64-linux CI. + .max_rss = 1758181785, })) |test_libc_step| test_step.dependOn(test_libc_step); } diff --git a/test/src/Libc.zig b/test/src/Libc.zig index 7a5801ea28b8..708e4c7bb800 100644 --- a/test/src/Libc.zig +++ b/test/src/Libc.zig @@ -10,6 +10,7 @@ pub const Options = struct { optimize_modes: []const std.builtin.OptimizeMode, test_filters: []const []const u8, test_target_filters: []const []const u8, + max_rss: usize, }; const TestCase = struct { @@ -100,6 +101,7 @@ pub fn addTarget(libc: *const Libc, target: std.Build.ResolvedTarget) void { const exe = libc.b.addExecutable(.{ .name = test_case.name, .root_module = mod, + .max_rss = libc.options.max_rss, }); const run = libc.b.addRunArtifact(exe); @@ -108,6 +110,7 @@ pub fn addTarget(libc: *const Libc, target: std.Build.ResolvedTarget) void { run.expectStdErrEqual(""); run.expectStdOutEqual(""); run.expectExitCode(0); + run.step.max_rss = libc.options.max_rss; libc.root_step.dependOn(&run.step); } From fcfdf99122b17a928c144c3d70418b35e6b1620e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Mon, 29 Sep 2025 09:12:51 +0200 Subject: [PATCH 3/3] ci: enable running libc-test on x86_64-linux-release --- ci/x86_64-linux-release.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/x86_64-linux-release.sh b/ci/x86_64-linux-release.sh index 08144ff3f076..39120b25bf0b 100755 --- a/ci/x86_64-linux-release.sh +++ b/ci/x86_64-linux-release.sh @@ -62,6 +62,7 @@ stage3-release/bin/zig build \ stage3-release/bin/zig build test docs \ --maxrss 21000000000 \ -Dlldb=$HOME/deps/lldb-zig/Release-e0a42bb34/bin/lldb \ + -Dlibc-test-path=$HOME/deps/libc-test-f2bac77 \ -fqemu \ -fwasmtime \ -Dstatic-llvm \