Skip to content

Commit 8010d24

Browse files
committed
lets try to capture from stack traces
1 parent 5cb366d commit 8010d24

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

.github/workflows/test_rust.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,10 @@ jobs:
8181

8282
- name: Run tests with image tests
8383
if: runner.os != 'macOS'
84-
run: cargo nextest run --profile ci --cargo-profile ci --workspace --locked --no-fail-fast -j 4 --features imgtests,lzma,jpegxr
84+
run: |
85+
set +e
86+
cargo nextest run --profile ci --cargo-profile ci --workspace --locked -j 4 --features imgtests,lzma,jpegxr
87+
cat $(find . -name gdb.bt)
8588
env:
8689
# This is to counteract the disabling by rust-cache.
8790
# See: https://github.com/Swatinem/rust-cache/issues/43
@@ -92,6 +95,7 @@ jobs:
9295
# Workaround for: https://github.com/nextest-rs/nextest/issues/1493
9396
# See also: https://github.com/rust-lang/rustup/issues/3825
9497
RUSTUP_WINDOWS_PATH_ADD_BIN: '1'
98+
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER: "./bt.sh"
9599
XDG_RUNTIME_DIR: '' # dummy value, just to silence warnings about it missing
96100

97101
- name: Run tests without image tests

bt.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
3+
# sauce : https://stackoverflow.com/a/63901492
4+
# kredit: https://blog.cryptomilk.org/2010/12/23/gdb-backtrace-to-file/
5+
6+
ex=(
7+
-ex "run"
8+
-ex "set logging overwrite on"
9+
-ex "set logging file gdb.bt"
10+
-ex "set logging on"
11+
-ex "set pagination off"
12+
-ex "handle SIG33 pass nostop noprint"
13+
-ex "echo backtrace:\n"
14+
-ex "backtrace full"
15+
-ex "echo \n\nregisters:\n"
16+
-ex "info registers"
17+
-ex "echo \n\ncurrent instructions:\n"
18+
-ex "x/16i \$pc"
19+
-ex "echo \n\nthreads backtrace:\n"
20+
-ex "thread apply all backtrace"
21+
-ex "set logging off"
22+
-ex "quit"
23+
)
24+
echo 0 | gdb -batch-silent "${ex[@]}" --args "$@"
25+

0 commit comments

Comments
 (0)