diff --git a/setup-test-tools.sh b/setup-test-tools.sh index 362e9ec9e..170a33d3a 100755 --- a/setup-test-tools.sh +++ b/setup-test-tools.sh @@ -20,7 +20,10 @@ linux() { install_apt() { sudo apt-get update || true - sudo apt-get install -y nasm gcc + sudo apt-get install -y \ + nasm \ + gcc \ + libc6-dev test -f /usr/bin/go || sudo apt-get install -y golang } diff --git a/tests/binaries/heap_vis.c b/tests/binaries/heap_vis.c index f8e920631..b93eb037c 100644 --- a/tests/binaries/heap_vis.c +++ b/tests/binaries/heap_vis.c @@ -1,6 +1,8 @@ #include #include +#include + void break_here() {} int main() { @@ -18,4 +20,11 @@ int main() { free(allocs[1]); break_here(); + + // We do not really need it for our test + // but we need it so that our CI test pass can get TLS variables + // See: + // - https://github.com/pwndbg/pwndbg/pull/1086 + // - https://sourceware.org/bugzilla/show_bug.cgi?id=24548 + pthread_create(0,0,0,0); } diff --git a/tests/binaries/makefile b/tests/binaries/makefile index 9fd395daa..955b797d9 100644 --- a/tests/binaries/makefile +++ b/tests/binaries/makefile @@ -81,8 +81,11 @@ heap_bins: heap_bins.c -Wl,--dynamic-linker=${GLIBC_2_33}/ld-linux-x86-64.so.2 \ -g -O0 -o heap_bins.out heap_bins.c -heap_vis: heap_vis.c - ${CC} -g -O0 -o heap_vis.out heap_vis.c +# Note: we use -pthread -lpthread because we hit this bug on CI builds: +# https://sourceware.org/bugzilla/show_bug.cgi?id=24548 +heap_vis.out: heap_vis.c + @echo "[+] Building heap_vis.out" + ${CC} -g -O0 -o heap_vis.out heap_vis.c -pthread -lpthread clean : @echo "[+] Cleaning stuff"