diff --git a/.github/workflows/test_rust.yml b/.github/workflows/test_rust.yml index 2e41f26852fb3..e2e499cc0073e 100644 --- a/.github/workflows/test_rust.yml +++ b/.github/workflows/test_rust.yml @@ -58,7 +58,7 @@ jobs: if: runner.os == 'Linux' run: | sudo apt-get update - sudo apt install -y libasound2-dev libxcb-shape0-dev libxcb-xfixes0-dev libgtk-3-dev mesa-vulkan-drivers libpango1.0-dev libudev-dev + sudo apt install -y libasound2-dev gdb libxcb-shape0-dev libxcb-xfixes0-dev libgtk-3-dev mesa-vulkan-drivers libpango1.0-dev libudev-dev # Needed after: https://github.com/rust-lang/rust/pull/124129 # See also: https://github.com/dtolnay/linkme/issues/94 @@ -81,7 +81,10 @@ jobs: - name: Run tests with image tests if: runner.os != 'macOS' - run: cargo nextest run --profile ci --cargo-profile ci --workspace --locked --no-fail-fast -j 4 --features imgtests,lzma,jpegxr + run: | + set +e + cargo nextest run --profile ci --cargo-profile ci --workspace --locked -j 4 --features imgtests,lzma,jpegxr + cat $(find . -name gdb.bt) env: # This is to counteract the disabling by rust-cache. # See: https://github.com/Swatinem/rust-cache/issues/43 @@ -92,6 +95,7 @@ jobs: # Workaround for: https://github.com/nextest-rs/nextest/issues/1493 # See also: https://github.com/rust-lang/rustup/issues/3825 RUSTUP_WINDOWS_PATH_ADD_BIN: '1' + CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER: "./bt.sh" XDG_RUNTIME_DIR: '' # dummy value, just to silence warnings about it missing - name: Run tests without image tests diff --git a/bt.sh b/bt.sh new file mode 100755 index 0000000000000..ece91bd74544c --- /dev/null +++ b/bt.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +# sauce : https://stackoverflow.com/a/63901492 +# kredit: https://blog.cryptomilk.org/2010/12/23/gdb-backtrace-to-file/ + +ex=( + -ex "run" + -ex "set logging overwrite on" + -ex "set logging file gdb.bt" + -ex "set logging on" + -ex "set pagination off" + -ex "handle SIG33 pass nostop noprint" + -ex "echo backtrace:\n" + -ex "backtrace full" + -ex "echo \n\nregisters:\n" + -ex "info registers" + -ex "echo \n\ncurrent instructions:\n" + -ex "x/16i \$pc" + -ex "echo \n\nthreads backtrace:\n" + -ex "thread apply all backtrace" + -ex "set logging off" + -ex "quit" +) +echo 0 | gdb -batch-silent "${ex[@]}" --args "$@" +