Skip to content

Commit 29ab877

Browse files
committed
debug: widen the net — more iterations plus concurrent binary invocations
1 parent 102ac22 commit 29ab877

1 file changed

Lines changed: 34 additions & 22 deletions

File tree

.github/workflows/debug-mysql-e2e-segfault.yml

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -51,34 +51,46 @@ jobs:
5151
env:
5252
BUSBAR_TEST_MYSQL_URL: mysql://busbar:busbar@127.0.0.1:3306/busbar_test
5353

54-
- name: run e2e repeatedly to catch the SIGSEGV, then backtrace the core
54+
- name: run e2e repeatedly (parallel bursts) to catch the SIGSEGV, then backtrace the core
5555
working-directory: plugin
5656
env:
5757
BUSBAR_TEST_MYSQL_URL: mysql://busbar:busbar@127.0.0.1:3306/busbar_test
5858
RUST_BACKTRACE: full
5959
run: |
6060
set +e
6161
ulimit -c unlimited
62-
for i in $(seq 1 10); do
63-
echo "=== attempt $i ==="
62+
BIN=$(find target/debug/deps -maxdepth 1 -name "e2e-*" -type f -executable | head -1)
63+
echo "BIN=$BIN"
64+
find_core() { find . -maxdepth 2 -iname "core.*" 2>/dev/null | head -1; }
65+
backtrace_and_exit() {
66+
CORE="$1"
67+
echo "CORE FOUND: $CORE"
68+
gdb --batch \
69+
-ex "bt full" \
70+
-ex "info registers" \
71+
-ex "thread apply all bt" \
72+
-ex "info sharedlibrary" \
73+
"$BIN" "$CORE" 2>&1
74+
exit 0
75+
}
76+
# Phase 1: default `cargo test` parallelism, repeated (matches real CI shape exactly).
77+
for i in $(seq 1 15); do
78+
echo "=== phase1 attempt $i (cargo test, default parallelism) ==="
6479
cargo test -p busbar-store-mysql-plugin --test e2e -- --nocapture
65-
rc=$?
66-
echo "exit code: $rc"
67-
CORE=$(find . -maxdepth 2 -iname "core.*" 2>/dev/null | head -1)
68-
if [ -n "$CORE" ]; then
69-
echo "CORE FOUND: $CORE"
70-
BIN=$(find target/debug/deps -maxdepth 1 -name "e2e-*" -type f -executable | head -1)
71-
echo "BIN=$BIN"
72-
gdb --batch \
73-
-ex "bt full" \
74-
-ex "info registers" \
75-
-ex "thread apply all bt" \
76-
-ex "info sharedlibrary" \
77-
"$BIN" "$CORE" 2>&1
78-
exit 0
79-
fi
80-
if [ "$rc" != "0" ]; then
81-
echo "non-zero exit but no core file found yet, continuing loop"
82-
fi
80+
echo "exit code: $?"
81+
CORE=$(find_core); [ -n "$CORE" ] && backtrace_and_exit "$CORE"
8382
done
84-
echo "no crash reproduced after 10 attempts"
83+
# Phase 2: run the compiled binary directly, several copies AT ONCE, to stress concurrent
84+
# dlopen/dlclose of the same cdylib harder than the default single-process parallelism does.
85+
for i in $(seq 1 15); do
86+
echo "=== phase2 burst $i (4x concurrent binary invocations) ==="
87+
for j in 1 2 3 4; do
88+
"$BIN" --nocapture > "burst_${i}_${j}.log" 2>&1 &
89+
done
90+
wait
91+
for j in 1 2 3 4; do
92+
echo "--- burst $i copy $j tail ---"; tail -15 "burst_${i}_${j}.log"
93+
done
94+
CORE=$(find_core); [ -n "$CORE" ] && backtrace_and_exit "$CORE"
95+
done
96+
echo "no crash reproduced after 15+15 attempts"

0 commit comments

Comments
 (0)