Expand the amount of shells tested with

This commit is contained in:
Luke Parker
2025-12-08 21:09:09 -05:00
parent f4efa76e3f
commit 34dbfedc5a

View File

@@ -25,10 +25,6 @@ jobs:
STACK=$((8 * 1024 * 1024))
cp monerod monerod-muslstack
GOBIN=$(pwd) go install github.com/yaegashi/muslstack@d19cc5866abce3ca59dfc1666df7cc97097d0933
./muslstack -s $STACK ./monerod-muslstack
cp monerod monerod-chelf
git clone https://github.com/Gottox/chelf
cd chelf
@@ -37,34 +33,45 @@ jobs:
./chelf -s $STACK ../monerod-chelf
cd ..
if [ ! "$(sha256sum monerod-muslstack)" = "$(sha256sum monerod-chelf)" ]; then
echo "monerod-muslstack != monerod-chelf"
exit 1
fi
cp monerod monerod-muslstack
GOBIN=$(pwd) go install github.com/yaegashi/muslstack@d19cc5866abce3ca59dfc1666df7cc97097d0933
./muslstack -s $STACK ./monerod-muslstack
cp monerod monerod-idss
./orchestration/increase_default_stack_size.sh monerod-idss
sudo apt install bash dash zsh busybox
for shell in sh bash dash zsh ash; do
cp monerod monerod-idss-$shell
$shell ./orchestration/increase_default_stack_size.sh monerod-idss-$shell
done
if [ ! "$(sha256sum monerod-muslstack)" = "$(sha256sum monerod-idss)" ]; then
echo "monerod-muslstack != monerod-idss"
find . -iname "monerod-*" | while read -r bin; do
readelf $bin -l
sha256sum $bin
done
find . -iname "monerod-*" | while read -r bin; do
if [ ! $(sha256sum monerod-chelf) = $(sha256sum $bin) ]; then
exit 1
fi
done
read_stack() {
printf "%i" $((readelf $1 -l | grep STACK -A1 | tail -n1 | sed -E s/^[[:space:]]*//g | cut -f2 -d' '))
}
INITIAL_STACK=$(read_stack monerod)
if [ "$INITIAL_STACK" -ne "0" ]; then
echo "Initial \`PT_GNU_STACK\` wasn't 0"
exit 2
fi
INITIAL_STACK=$((readelf monerod -l | grep STACK -A1 | tail -n1 | sed -E s/^[[:space:]]*//g | cut -f2 -d' '))
if [ "$INITIAL_STACK" -ne "0" ]; then
echo "Initial \`PT_GNU_STACK\` wasn't 0"
UPDATED_STACK=$(read_stack monerod-chelf)
if [ "$UPDATED_STACK" -ne "$STACK" ]; then
echo "Updated \`PT_GNU_STACK\` wasn't 8 MB"
exit 3
fi
UPDATED_STACK=$((readelf monerod-idss -l | grep STACK -A1 | tail -n1 | sed -E s/^[[:space:]]*//g | cut -f2 -d' '))
if [ "$UPDATED_STACK" -ne "$STACK" ]; then
echo "Updated \`PT_GNU_STACK\` wasn't 8 MB"
exit 4
fi
# Only one byte should be different due to the bit pattern of 8 MB
BYTES_DIFFERENT=$(cmp -l monerod monerod-idss | wc -l)
BYTES_DIFFERENT=$(cmp -l monerod monerod-chelf | wc -l)
if [ "$BYTES_DIFFERENT" -ne 1 ]; then
echo "More than one byte was different between the two binaries"
exit 5
exit 4
fi