ci: force reinstall of kernel headers in asan
What changed, and why it matters
This commit changes a Bitcoin Core continuous integration (CI) test script. It forces a re-install of Linux kernel headers when running an AddressSanitizer (ASan) test in a Docker container. The goal is to avoid CI failures when the host runner's Linux kernel is updated but a cached Docker image still contains older kernel headers. This is a build/test infrastructure fix, not a change to the Bitcoin software users run.
No security action required. This is a CI reliability improvement. Reviewers may verify that apt-get install uses only the intended $PACKAGES list and that the change does not introduce unintended package upgrades.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch adds a conditional block in ci/test/03_test_script.sh for the ci_native_asan container. It runs apt-get update and apt-get install for the packages listed in $PACKAGES, using the CI retry wrapper. The intent is to ensure the container’s linux-headers package matches the host kernel, preventing ASan CI jobs from failing due to kernel header mismatches on cached Docker images. No Bitcoin node code, consensus logic, networking, wallet, or RPC code is modified.
Changed components
ci/test/03_test_script.shInspect captured patch +8 / −0
diff --git a/ci/test/03_test_script.sh b/ci/test/03_test_script.sh
index a0676c6a..b3968aaa 100755
--- a/ci/test/03_test_script.sh
+++ b/ci/test/03_test_script.sh
@@ -24,6 +24,14 @@ fi
echo "Free disk space:"
df -h
+# We force an install of linux-headers again here via $PACKAGES to fix any
+# kernel mismatch between a cached docker image and the underlying host.
+# This can happen occasionally on hosted runners if the runner image is updated.
+if [[ "$CONTAINER_NAME" == "ci_native_asan" ]]; then
+ $CI_RETRY_EXE apt-get update
+ ${CI_RETRY_EXE} bash -c "apt-get install --no-install-recommends --no-upgrade -y $PACKAGES"
+fi
+
# What host to compile for. See also ./depends/README.md
# Tests that need cross-compilation export the appropriate HOST.
# Tests that run natively guess the host
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.