Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate core dumps for tests that segfault #1030

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ cd $WORKSPACE
[[ ! -d $WORKSPACE/build ]] && mkdir -p $WORKSPACE/build
cd $WORKSPACE/build
cmake $WORKSPACE/${SOFTWARE_DIR} ${BUILDING_EXTRA_CMAKE_PARAMS} \
-DCMAKE_INSTALL_PREFIX=/usr
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr
echo '# END SECTION'

echo '# BEGIN SECTION: compiling'
Expand All @@ -97,6 +97,12 @@ if $GENERIC_ENABLE_TESTS; then
init_stopwatch TEST
mkdir -p \$HOME
make test ARGS="-VV ${BUILDING_EXTRA_MAKETEST_PARAMS}" || true
if [[ -d $WORKSPACE/core_dumps ]]; then
for corefile in $WORKSPACE/core_dumps/core.*
do
gdb --batch -ex "sharedlibrary; thread apply all bt" --core \$corefile | tee \${corefile}_backtrace.txt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
gdb --batch -ex "sharedlibrary; thread apply all bt" --core \$corefile | tee \${corefile}_backtrace.txt
gdb --batch -ex "sharedlibrary; thread apply all bt" --core "\$corefile" | tee "\${corefile}_backtrace.txt"

done
fi
stop_stopwatch TEST
echo '# END SECTION'
else
Expand Down
9 changes: 9 additions & 0 deletions jenkins-scripts/docker/lib/docker_run.bash
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ mkdir -p ${PACKAGE_DIR}
sudo rm -fr ${WORKSPACE}/build
mkdir -p ${WORKSPACE}/build

# Remove old core dumps to conserve space
CORE_DUMPS_DIR="${WORKSPACE}/core_dumps"
sudo rm -rf ${CORE_DUMPS_DIR}
mkdir -p ${CORE_DUMPS_DIR}

[[ -z ${DOCKER_DO_NOT_CACHE} ]] && DOCKER_DO_NOT_CACHE=false
[[ -z ${USE_DOCKER_IN_DOCKER} ]] && export USE_DOCKER_IN_DOCKER=false

Expand Down Expand Up @@ -81,6 +86,8 @@ if [[ -d /dev/snd ]]; then
DEVICE_SND="--device /dev/snd"
fi

echo "${CORE_DUMPS_DIR}/core.%e.%p" | sudo tee /proc/sys/kernel/core_pattern

# DOCKER_FIX is for workaround https://github.com/docker/docker/issues/14203
sudo ${docker_cmd} run ${PLAFTORM_PARAM} $EXTRA_PARAMS_STR \
-e DOCKER_FIX='' \
Expand All @@ -93,6 +100,8 @@ sudo ${docker_cmd} run ${PLAFTORM_PARAM} $EXTRA_PARAMS_STR \
${DEVICE_SND} \
--tty \
--rm \
--init \
--ulimit core=-1 \
${DOCKER_TAG} \
/bin/bash build.sh

Expand Down
1 change: 1 addition & 0 deletions jenkins-scripts/lib/dependencies_archive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ fi
# gnupg apt-key requires gnupg, gnupg2 or gnupg1
BASE_DEPENDENCIES="build-essential \\
cmake \\
gdb \\
debhelper \\
mesa-utils \\
x11-utils \\
Expand Down