From 86bd0721ea4b1f81cf6f9d6be85247a6938db395 Mon Sep 17 00:00:00 2001 From: Richard Belleville Date: Wed, 8 Mar 2023 10:30:46 -0800 Subject: [PATCH] [fork] Generate GDB backtraces in fork tests on Kokoro (#32535) --- templates/tools/dockerfile/test/bazel/Dockerfile.template | 2 ++ tools/dockerfile/test/bazel.current_version | 2 +- tools/dockerfile/test/bazel/Dockerfile | 2 ++ tools/internal_ci/helper_scripts/prepare_build_linux_rc | 4 ++++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/templates/tools/dockerfile/test/bazel/Dockerfile.template b/templates/tools/dockerfile/test/bazel/Dockerfile.template index c241a737752..9b0186d3d9c 100644 --- a/templates/tools/dockerfile/test/bazel/Dockerfile.template +++ b/templates/tools/dockerfile/test/bazel/Dockerfile.template @@ -17,6 +17,8 @@ <%include file="../../oss_fuzz_base.include"/> <%include file="../../bazel.include"/> <%include file="../../git-jenkins.include"/> + + RUN apt-get install -y gdb RUN mkdir -p /var/local/jenkins diff --git a/tools/dockerfile/test/bazel.current_version b/tools/dockerfile/test/bazel.current_version index 6cdeb3fb21d..a0173c02a18 100644 --- a/tools/dockerfile/test/bazel.current_version +++ b/tools/dockerfile/test/bazel.current_version @@ -1 +1 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/bazel:b3e48464a04576cc42dd4f946feaf4fec1eca447@sha256:1faf10ff176c391507a5a4ed7b0c513d95bcd9f5a71877796d00a48039a67f55 \ No newline at end of file +us-docker.pkg.dev/grpc-testing/testing-images-public/bazel:b7cb23cf132daefa62a7a108271528dea0c45403@sha256:8c31d465e58102b259274f38dd688e3b570682940fa05dea1cf1b10abca02a0b diff --git a/tools/dockerfile/test/bazel/Dockerfile b/tools/dockerfile/test/bazel/Dockerfile index 0af8eeacc4a..9c6a14df768 100644 --- a/tools/dockerfile/test/bazel/Dockerfile +++ b/tools/dockerfile/test/bazel/Dockerfile @@ -64,6 +64,8 @@ RUN git config --global --add safe.directory /var/local/jenkins/grpc RUN git config --global protocol.file.allow always +RUN apt-get install -y gdb + RUN mkdir -p /var/local/jenkins # Define the default command. diff --git a/tools/internal_ci/helper_scripts/prepare_build_linux_rc b/tools/internal_ci/helper_scripts/prepare_build_linux_rc index 1825bc67312..79baf05f299 100644 --- a/tools/internal_ci/helper_scripts/prepare_build_linux_rc +++ b/tools/internal_ci/helper_scripts/prepare_build_linux_rc @@ -40,6 +40,10 @@ git submodule update --init python3 -m pip install six +# Allows the test driver to spin up a GDB subprocess and have it attach to +# another subprocess of the test driver. +sudo bash -c 'echo "0" > /proc/sys/kernel/yama/ptrace_scope' + # check whether /tmpfs is mounted correctly (mount | grep -q 'on /tmpfs ') || (mount; echo 'BAD KOKORO WORKER WARNING: it seems that /tmpfs volume with scratch disk is not mounted in the kokoro worker. This can result in unexpected "out of disk space" errors.')