Skip to content

rust/tools/sanitize: Capture a backtrace when OBS hangs on shutdown - #473

Merged
zackees merged 2 commits into
masterfrom
fix/462-shutdown-backtrace
Oct 13, 2026
Merged

zackees merged 2 commits into
masterfrom
fix/462-shutdown-backtrace

Conversation

@zackees

@zackees zackees commented Oct 13, 2026

Copy link
Copy Markdown
Member

Part of #462: this is the evidence step, not the fix.

Every sanitizer pass ends with OBS hanging after output 'simple_file_output' destroyed, killed with exit 137. The harness used timeout -s INT -k <grace>, so a hang was only an exit code.

  • Launch: dbus-run-session runs in the background. The harness finds OBS (or valgrind) as its child, sends SIGINT to OBS itself after the launch time, and waits out the grace period. If OBS is still running, it writes gdb -batch -ex 'info threads' -ex 'thread apply all bt' to hang-backtrace.txt (sudo -n first, since ptrace_scope=1), then SIGKILLs it. app-exit.txt records exited or killed.
  • Triage: a killed launch counts as an OBS finding, and the summary shows the threads in a collapsed block.
  • Deps: install-ubuntu-deps.sh installs gdb.
  • Unit tests: Xvfb now starts before them. test_audio_io and other tests that start OBS were failing under the harness with Unable to open X display.

This PR touches rust/tools/sanitize/**, so the sanitizers workflow runs on it. That run should produce the first hang backtrace for #462, and I'll post the result there. The local gate passed and is stamped.

The launch ran OBS under 'timeout -s INT -k', so a shutdown hang was
only an exit code 137 (#462). The harness now sends SIGINT to OBS
itself, waits out the grace period, and if OBS is still running dumps
'thread apply all bt' with gdb (installed by install-ubuntu-deps.sh)
before SIGKILL. app-exit.txt says exited or killed, and triage counts a
kill as a finding and shows the threads.

Xvfb now starts before the unit tests too: test_audio_io and the other
tests that start OBS failed under the harness with no X display.

Refs #462

Local-Gate: v1 tree=259a702ee324c9f8edd988ad5e89219c9c607548 secs=326 lanes=lint:run,rust-test:run,tier2-linux:run
Ci-Attestation: {"at":1791874097,"gate":"rust/all/fmt","host":"linux-x86_64","key":"784886194516e9bd38561cd81d3a091c5dda1f17ea86343295acbecd7f071abb","lane":"lint","parents":["3410e7b2bf987b111ae2e10df4af74f705de9cd6"],"secs":23,"stamp":"31a04ff371acd81fedbb97cbc6deb119","tree":"259a702ee324c9f8edd988ad5e89219c9c607548","v":1,"via":"run"}
Ci-Attestation: {"at":1791874097,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"784886194516e9bd38561cd81d3a091c5dda1f17ea86343295acbecd7f071abb","lane":"lint","parents":["3410e7b2bf987b111ae2e10df4af74f705de9cd6"],"secs":23,"stamp":"f85f07a290f2f37a8a6bceda8882a0cc","tree":"259a702ee324c9f8edd988ad5e89219c9c607548","v":1,"via":"run"}
Ci-Attestation: {"at":1791874097,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"0a354ee699fc8008f213b3e212ee3a7eb6e7c01b1ba745e2a100e6798a74806f","lane":"rust-test","parents":["3410e7b2bf987b111ae2e10df4af74f705de9cd6"],"secs":228,"stamp":"c64391e488b6ed607543eea7c19e7870","tree":"259a702ee324c9f8edd988ad5e89219c9c607548","v":1,"via":"run"}
Ci-Attestation: {"at":1791874097,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"36215dd701fa53486fc86d0d2bafb5012a7e1f0dc7565cbe712b9dcc2a127284","lane":"tier2-linux","parents":["3410e7b2bf987b111ae2e10df4af74f705de9cd6"],"secs":75,"stamp":"0e165847df2cb747b04d65b7a6910575","tree":"259a702ee324c9f8edd988ad5e89219c9c607548","v":1,"via":"run"}
dbus-run-session has two children; the first pgrep match was
dbus-daemon, so the hang backtrace showed the bus daemon.

Refs #462

Local-Gate: v1 tree=c4494da723cbc6d736ebd11a1c5d35bd6b1009ec secs=379 lanes=lint:run,rust-test:run,tier2-linux:run
Ci-Attestation: {"at":1791875233,"gate":"rust/all/fmt","host":"linux-x86_64","key":"97b04783d6ef064bf64db1138a51f072058b01c4cfb08c31c3970afceda5a353","lane":"lint","parents":["78e2b45588af151f6cc68bd2db83820db5f1c31b"],"secs":131,"stamp":"a0a4fe9e9a092cb210cd4e13374070f8","tree":"c4494da723cbc6d736ebd11a1c5d35bd6b1009ec","v":1,"via":"run"}
Ci-Attestation: {"at":1791875233,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"97b04783d6ef064bf64db1138a51f072058b01c4cfb08c31c3970afceda5a353","lane":"lint","parents":["78e2b45588af151f6cc68bd2db83820db5f1c31b"],"secs":131,"stamp":"9e4a59fbbfe9154ecb0c120c3e80faec","tree":"c4494da723cbc6d736ebd11a1c5d35bd6b1009ec","v":1,"via":"run"}
Ci-Attestation: {"at":1791875233,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"ce896f73e0a68f30b88238b04610d4fd934b692e6d12b80ebb6624e03894e317","lane":"rust-test","parents":["78e2b45588af151f6cc68bd2db83820db5f1c31b"],"secs":176,"stamp":"6c6922b46989e5b6716de1e391d807be","tree":"c4494da723cbc6d736ebd11a1c5d35bd6b1009ec","v":1,"via":"run"}
Ci-Attestation: {"at":1791875233,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"640a122f1de6bcb99f45b695bc442efe832effa0fbcb78609e113e63b6a8cbe3","lane":"tier2-linux","parents":["78e2b45588af151f6cc68bd2db83820db5f1c31b"],"secs":73,"stamp":"a7444ceb7d93c1c851a124561f221600","tree":"c4494da723cbc6d736ebd11a1c5d35bd6b1009ec","v":1,"via":"run"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant