Repository navigation
Merge pull request #8 from aadi-joshi/docs/independent-reproduction #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: allocfault | |
| on: | |
| workflow_dispatch: | |
| push: | |
| paths: | |
| - "tools/allocfault/**" | |
| - "scripts/run-original-suite.sh" | |
| - ".github/workflows/allocfault.yml" | |
| jobs: | |
| smoke-interposer: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Zig 0.16.0 | |
| run: | | |
| curl -sL https://ziglang.org/download/0.16.0/zig-x86_64-linux-0.16.0.tar.xz | tar -xJ | |
| echo "$(pwd)/zig-x86_64-linux-0.16.0" >> "$GITHUB_PATH" | |
| - name: Build and probe interposer | |
| run: | | |
| export CACHE="$HOME/.cache/zig-tinyexpr" | |
| # Short corpus via env override: run script but the script builds its own corpus. | |
| # Probe only: compile interposer and assert counter advances on one expression. | |
| WORK=.local/allocfault | |
| mkdir -p "$WORK" | |
| cc -shared -fPIC -O2 -ldl -pthread tools/allocfault/interposer.c -o "$WORK/liballocfault.so" | |
| cc -O0 -g -I third_party/tinyexpr-c -c tools/allocfault/driver.c -o "$WORK/driver.o" | |
| cc -O0 -g -I third_party/tinyexpr-c -c third_party/tinyexpr-c/tinyexpr.c -o "$WORK/te.o" | |
| cc -O0 -g "$WORK/driver.o" "$WORK/te.o" -o "$WORK/driver-c" -ldl -lm | |
| OUT="$(LD_PRELOAD=$WORK/liballocfault.so ALLOCFAULT_COUNT_ONLY=1 ALLOCFAULT_SILENT=1 $WORK/driver-c '1+2*3')" | |
| echo "$OUT" | |
| python3 -c 'import json,sys; j=json.loads(sys.argv[1]); assert j["allocs"]>0, j' "$OUT" |