diff --git a/.github/workflows/splice-diag.yml b/.github/workflows/splice-diag.yml new file mode 100644 index 000000000..e1b8d246c --- /dev/null +++ b/.github/workflows/splice-diag.yml @@ -0,0 +1,110 @@ +# Diagnostics for array_class_splice.ts (-mm=rc, debug JIT) crashing with no output on the release runs of +# 2026-11-26 (45878505115): runs the packages of that run on several runners, records the CPU, and runs the +# test again and again, a crash under gdb. Temporary: delete with the fix. +name: Splice crash diagnostics + +on: + pull_request: + paths: + - '.github/workflows/splice-diag.yml' + workflow_dispatch: + +permissions: + contents: read + actions: read + +jobs: + diag: + name: Splice (${{ matrix.os }}, ${{ matrix.rep }}) + strategy: + fail-fast: false + matrix: + os: [ubuntu-22.04, ubuntu-24.04] + rep: [1, 2, 3, 4] + runs-on: ${{ matrix.os }} + timeout-minutes: 60 + env: + TOOL_PATH: ${{ github.workspace }}/__tslang + GC_LIB_PATH: ${{ github.workspace }}/__tslang + LLVM_LIB_PATH: ${{ github.workspace }}/__tslang + TSLANG_LIB_PATH: ${{ github.workspace }}/__tslang + steps: + - name: CPU + shell: bash + run: | + lscpu | grep -E "Model name|^CPU\(s\)" + echo "AVX-512/AMX: $(grep -o -w -E 'avx512[a-z0-9_]*|amx[a-z0-9_]*' /proc/cpuinfo | sort -u | tr '\n' ' ')" + ldd --version | head -1 + free -m + + - name: Install dependencies + shell: bash + run: | + printf 'nameserver 8.8.8.8\nnameserver 1.1.1.1\n' | sudo tee /etc/resolv.conf > /dev/null + for i in 1 2 3 4 5; do + sudo apt-get -o Acquire::Retries=3 update && sudo apt-get -o Acquire::Retries=3 install -y libcurl4-openssl-dev gdb && exit 0 + echo "apt-get failed (attempt $i), retrying in 30 s"; sleep 30 + done + exit 1 + + - name: Clone Default Library (the release run's commit, tests.sh with crash diagnostics) + shell: bash + run: | + set -e + git clone https://github.com/ASDAlexander77/TypeScriptCompilerDefaultLib.git + cd TypeScriptCompilerDefaultLib + git checkout --detach 760e34f + git fetch origin tests-crash-diagnostics + git checkout FETCH_HEAD -- tests.sh + + - name: Download the release run's package + uses: actions/download-artifact@v4 + with: + name: tslang-${{ matrix.os }}-asset + run-id: 45878505115 + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Unpack the package + shell: bash + run: | + set -e + mkdir -p "$TOOL_PATH" + tar -xzf tslang-*-${{ matrix.os }}-x64.tar.gz -C "$TOOL_PATH" + mkdir -p TypeScriptCompilerDefaultLib/__build + mv "$TOOL_PATH/defaultlib" TypeScriptCompilerDefaultLib/__build/defaultlib + "$TOOL_PATH/tslang" --version + + - name: The test alone, 20 times (debug JIT, -mm=rc) + shell: bash + working-directory: ${{ github.workspace }}/TypeScriptCompilerDefaultLib + run: | + export DEFAULT_LIB_PATH=./__build + R="$TOOL_PATH/libTypeScriptRuntime.so" + [ -f "$R" ] || R="$TSLANG_LIB_PATH/libTypeScriptRuntime.so" + cmd=( "$TOOL_PATH/tslang" --di --opt_level=0 --nowarn -mm=rc --shared-libs="$R" --emit=jit tests/array_class_splice.ts ) + fails=0 + for i in $(seq 1 20); do + out=$( "${cmd[@]}" 2>&1 < /dev/null ); code=$? + if [[ "$out" != *"ALL DONE"* ]]; then + fails=$((fails+1)); echo "run $i: exit $code, output: [$out]" + fi + done + echo "alone: $fails of 20 failed" + echo "--- under gdb" + timeout 300 gdb -q -batch -ex "set pagination off" -ex run -ex "info registers rip" -ex "x/6i \$pc" -ex "thread apply all bt 30" --args "${cmd[@]}" < /dev/null 2>&1 | tail -n 150 + echo "--- compiled (debug exe)" + "$TOOL_PATH/tslang" --di --opt_level=0 --nowarn -mm=rc --shared-libs="$R" --emit=exe tests/array_class_splice.ts && { ./tests/array_class_splice; echo "exe exit $?"; } + ls -la ~/.cache 2>/dev/null; find . -maxdepth 2 -name "__jit*" | head + + - name: The whole suite (tests.sh rc) + shell: bash + working-directory: ${{ github.workspace }}/TypeScriptCompilerDefaultLib + continue-on-error: true + run: | + chmod +x ./tests.sh + ./tests.sh rc + + - name: Kernel log + if: always() + shell: bash + run: sudo dmesg | tail -n 30 || true