Skip to content

Commit

Permalink
lets try to capture from stack traces
Browse files Browse the repository at this point in the history
  • Loading branch information
torokati44 committed Aug 21, 2024
1 parent 5cb366d commit b87a5f0
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/test_rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 render
cat $(find . -name gdb.bt)
env:
# This is to counteract the disabling by rust-cache.
# See: https://github.com/Swatinem/rust-cache/issues/43
Expand All @@ -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
Expand Down
25 changes: 25 additions & 0 deletions bt.sh
Original file line number Diff line number Diff line change
@@ -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 off"
-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 "$@"

0 comments on commit b87a5f0

Please sign in to comment.