Skip to content

Add a regression test for static-build backtrace crash (#53) - #67

Merged
ShawnChen-Sirius merged 1 commit into
mainfrom
test/issue-53-host-backtrace
Nov 11, 2026
Merged

ShawnChen-Sirius merged 1 commit into
mainfrom
test/issue-53-host-backtrace

Conversation

@auxten

@auxten auxten commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Adds the regression test for #53 (a static build crashed when Rust captured a backtrace) to tests/runtime_faces.rs. The test comes from #64, which was closed as superseded; this PR carries over that one test and nothing else.

What the test does

In a static build, the new runtime case host_backtrace_and_panic:

  1. turns off chDB's signal handlers,
  2. runs a query that fails,
  3. captures a std::backtrace::Backtrace,
  4. catches a panic.

Like the other runtime cases, it runs in a child process, so a crash shows up as a failed case instead of taking down the whole suite. bundled_runtime_hidden already checks the archive for the cause of #53; this test checks the symptom a user actually hits.

Change from #64

In #64 the case only ran when CHDB_CHECK_HOST_UNWIND was set, because the engine pinned at the time did not have the fix yet. The current pin (v26.11.0-rc.2) has it (on Linux, the prelinked archive from chdb-core#261), so this PR runs the case in every static build and drops the variable. An opt-in test would never run in CI.

Verification (Linux x86_64)

  • cargo test --features static --test runtime_faces against v26.11.0-rc.2: 17/17 runtime cases pass, including host_backtrace_and_panic.
  • The same command with CHDB_ENGINE_VERSION=v26.7.3, an engine from before the fix: host_backtrace_and_panic crashes with SIGSEGV, which is Static linking breaks backtrace #53. So the test detects the bug.
  • Default features: cargo test --test runtime_faces passes (16 cases; this case is static-only), and cargo fmt --check and cargo clippy --all-targets -- --deny warnings pass.

macOS and Linux aarch64 are covered by the static CI jobs on this PR. I did not run them locally.

Note

Add static-build regression test for host backtrace and panic

  • Adds host_backtrace_and_panic to tests/runtime_faces.rs, gated by the static feature, to guard against the crash tracked in Static linking breaks backtrace #53. The test disables engine signal handlers, runs a query against a missing table, and confirms it returns an error.
  • Also verifies a forced Rust backtrace is captured and non-empty, and that a deliberate panic is caught.
  • Registers the test in the cases registry with a comment distinguishing it from the archive inspection done by bundled_runtime_hidden.

Macroscope summarized 2b1e92c.

Regression test for #53: with the static archive linked, a failing engine
query followed by std::backtrace::Backtrace::force_capture and a caught
panic crashed with SIGSEGV, because the bundled libunwind took over
Rust's unwinder. bundled_runtime_hidden checks the archive for that
cause; this runs the case a user hits, isolated like the other runtime
cases so a crash cannot hide their results.

Taken from #64, where it was opt-in because the engine pinned then
predated the fix. The current pin carries it, so the case now runs in
every static build. Measured on Linux x86_64: it crashes with SIGSEGV
against v26.7.3 and passes against v26.11.0-rc.2.

@ShawnChen-Sirius ShawnChen-Sirius left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, approve to merge.

@ShawnChen-Sirius
ShawnChen-Sirius merged commit b9c1803 into main Nov 11, 2026
11 checks passed
@ShawnChen-Sirius

Copy link
Copy Markdown
Contributor

LGTM, approved and merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants