-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
pihole-FTL test causes SEGV_MAPERR when shutting down #1063
Comments
pihole-FTL test
causes SEGV_MAPERR when shutting down
Thanks for your report. Please try if my proposed fix (#1067) works for you as well. diff --git a/dockertest.sh b/dockertest_mod.sh
index 72c234c..a300014 100644
--- a/dockertest.sh
+++ b/dockertest_mod.sh
@@ -6,7 +6,7 @@ docker run --rm -i --entrypoint="bash" "pihole/pihole:${tag}" <<'EOF'
set -e
ATTEMPTS=20
-DELAY=0.1
+DELAY=0.5
LOG_CRASH=1
cleanup() {
@@ -31,7 +31,7 @@ detect_crash() {
attempt_crash() {
echo -n "Crash attempt with 'pihole-FTL ${1}'... "
cleanup || true
- pihole-FTL ${1} 1> /dev/null
+ ./pihole-FTL ${1} 1> /dev/null
sleep ${DELAY}
pkill pihole-FTL || true
sleep ${DELAY}
@@ -42,6 +42,9 @@ echo "----"
pihole version
echo
+wget https://ftl.pi-hole.net/fix/test_crash/pihole-FTL-linux-x86_64 -O pihole-FTL
+chmod +x ./pihole-FTL
+
i=0
while [ ${i} -lt ${ATTEMPTS} ]; do
attempt_crash |
@Beanow It'd be great if you could confirm my fix actually fixing the misbehavior whenever possible |
Thanks @DL6ER! I've tried your version of the script, and it comes back OK 👍. Updated script#!/bin/bash
# Build the suggested fix from source.
cat - > ./Dockerfile <<'EOF'
FROM pihole/ftl-build:x86_64 as build
RUN mkdir /repo
WORKDIR /repo
RUN git clone --depth 1 --branch fix/test_crash https://github.com/pi-hole/FTL.git .
ENV STATIC=""
ENV BRANCH="fix/test_crash"
ENV CIRCLE_JOB="x86_64"
RUN bash .circleci/build-CI.sh "-DSTATIC=${STATIC}" "${BRANCH}" "" "${CIRCLE_JOB}"
RUN bash test/arch_test.sh
FROM pihole/pihole:v5.7
COPY --from=build /repo/pihole-FTL /usr/bin/pihole-FTL
EOF
docker build -t pihole/pihole:fix_test_crash .
# Run for several targets.
TARGETS=(v5.7 fix_test_crash)
for tag in ${TARGETS[@]}; do
docker run --rm -i --entrypoint="bash" "pihole/pihole:${tag}" <<'EOF'
set -e
ATTEMPTS=20
DELAY=0.3
LOG_CRASH=1
cleanup() {
rm -f /dev/shm/FTL-* 2> /dev/null
rm /run/pihole/FTL.sock 2> /dev/null
echo "" > /var/log/pihole-FTL.log
}
detect_crash() {
FOUND=$(cat /var/log/pihole-FTL.log | grep -c "Segmentation fault" || true)
if [ "${FOUND}" -gt 0 ]; then
echo "CRASH"
if [ ${LOG_CRASH} ]; then
cat /var/log/pihole-FTL.log | grep -A2 "Segmentation fault"
echo
fi
else
echo "OK"
fi
}
attempt_crash() {
echo -n "Crash attempt with 'pihole-FTL ${1}'... "
cleanup || true
pihole-FTL ${1} 1> /dev/null
sleep ${DELAY}
pkill pihole-FTL || true
sleep ${DELAY}
detect_crash
}
echo "----"
VERSION=$(pihole-FTL version)
if [ "${VERSION}" == "v5.7" ]; then
echo "Replacing with prebuilt fix https://ftl.pi-hole.net/fix/test_crash/pihole-FTL-linux-x86_64"
wget -q https://ftl.pi-hole.net/fix/test_crash/pihole-FTL-linux-x86_64 -O pihole-FTL
chmod +x ./pihole-FTL
mv ./pihole-FTL "$(which pihole-FTL)"
fi
pihole version
echo
i=0
while [ ${i} -lt ${ATTEMPTS} ]; do
attempt_crash
let "i+=1"
done
i=0
while [ ${i} -lt ${ATTEMPTS} ]; do
attempt_crash test
let "i+=1"
done
EOF
done After the docker build they both come back OK as well 👍.
|
The next version of FTL has been released. Please update and run
to get back on-track if you switched to a custom branch. The fix/feature branch you switched to will not receive any further updates. Thanks for helping us to make Pi-hole better for us all! If you have any issues, please either reopen this ticket or (preferably) create a new ticket describing the issues in further detail and only reference this ticket. This will help us to help you best. |
Versions
Platform
Expected behavior
pihole-FTL test
will shut down cleanly.Actual behavior / bug
pihole-FTL test
will send:Steps to reproduce
(This will take a minute to run)
Run the following reproduction script with bash:
An example of it's output
Note that:
test
command was not used (running normal daemon mode) the crash doesn't occur.pihole/pihole:4.2.1
does not crash over 20 attempts.pihole/pihole:4.2.2
andpihole/pihole:v5.6
do crash over 20 attempts.Additional context
I first noticed the segfault as part of this issue: pi-hole/docker-pi-hole#794 (comment)
The Docker image uses
pihole-FTL test
every time during it's startup logic.But used to not care about the segfault, because earlier versions of
pihole-FTL
worked even after an unclean shutdown.The text was updated successfully, but these errors were encountered: