From 0148fb8f3f3262762f1811426ba7dcb0a484d578 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sun, 20 Sep 2026 20:03:48 +0100 Subject: [PATCH] validation: compare the pids limit by value LinuxPids.Limit became a pointer when commit b521900d186b ("go.{mod,sum}: bump runtime-spec to v1.3.0.") moved to runtime-spec v1.3.0, and the check turned into a comparison of two pointers that are never equal. The pids limit check has failed for every runtime since, and the diagnostic printed two addresses instead of the limits. Dereference both sides, and report a limit that is missing on either of them as a diagnostic rather than dereferencing a nil pointer. Signed-off-by: Daniel Golle --- validation/util/linux_resources_pids.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/validation/util/linux_resources_pids.go b/validation/util/linux_resources_pids.go index 1431efd9..66a5c3d0 100644 --- a/validation/util/linux_resources_pids.go +++ b/validation/util/linux_resources_pids.go @@ -22,8 +22,14 @@ func ValidateLinuxResourcesPids(config *rspec.Spec, t *tap.T, state *rspec.State return nil } - t.Ok(lpd.Limit == config.Linux.Resources.Pids.Limit, "pids limit is set correctly") - t.Diagnosticf("expect: %d, actual: %d", config.Linux.Resources.Pids.Limit, lpd.Limit) + expected := config.Linux.Resources.Pids.Limit + if expected == nil || lpd.Limit == nil { + t.Diagnosticf("unable to get pids limit: expect: %v, actual: %v", expected, lpd.Limit) + return nil + } + + t.Ok(*lpd.Limit == *expected, "pids limit is set correctly") + t.Diagnosticf("expect: %d, actual: %d", *expected, *lpd.Limit) return nil }