rust-debugging

Diagnose Rust crashes, panics, and hangs on host, Android, and iOS targets.

2|1|Updated Aug 19, 2026
One-click install
npx skills add https://github.com/po4yka/rust-skills --skill rust-debugging-po4yka
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: rust-debugging
Source: https://github.com/po4yka/rust-skills/tree/main/skills/rust-debugging
Command: npx skills add https://github.com/po4yka/rust-skills --skill rust-debugging-po4yka

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Rust crashes behind JNI or UniFFI on Android and iOS arrive as raw signals, tombstones, and mangled stack traces with no panic message, making root-cause analysis slow and error-prone. This Skill provides a structured triage workflow that maps symptoms to the right debugging path, from host reproduction to device symbolication. ## Core Features & Use Cases - Panic and signal triage tables: Map SIGSEGV, SIGABRT, SIGBUS, unwrap panics, overflow panics, and mangled _RNv frames to likely causes and concrete next steps. - Host-first debugging workflow: Drive RUST_BACKTRACE, rust-lldb, rust-gdb, debug-info profiles, and tracing span timing to reproduce crashes locally before touching a device. - Android and iOS device debugging: Filter logcat, read tombstones, symbolicate with ndk-stack, llvm-addr2line, and atos, and attach LLDB from Android Studio or Xcode. - FFI and async diagnosis: Interpret UniFFI panic propagation into Kotlin and Swift, guard extern "C" exports, handle SIGPIPE, and use tokio-console for async stalls. - Use Case: Your Android app crashes with a tombstone showing signal 11 and an address in libmy_ffi.so. Use this Skill to symbolicate the address against the exact unstripped build, identify the dangling pointer, and reproduce it on the host under ASan. ## Quick Start Ask the agent to debug a Rust crash by describing the symptom, such as "my Android app crashes with SIGSEGV in libmy_ffi.so, help me symbolicate the tombstone and find the cause".

Frequently Asked Questions about rust-debugging

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug a Rust panic with a backtrace?▼

Run the binary or test with RUST_BACKTRACE=1 for a short trace or RUST_BACKTRACE=full for every frame. Set the variable before the process starts, since std caches it at the first capture, and use RUST_LIB_BACKTRACE=0 to disable error-value captures.

How to symbolicate an Android tombstone from a Rust native library?▼

Find the first frame in your .so, then run llvm-addr2line -Cfie against the unstripped Cargo output, or pipe the whole tombstone through ndk-stack. The binary must be the exact build that crashed; compare the BuildId with llvm-readelf -n to confirm.

Why does my Rust code crash with SIGABRT at an extern C function?▼

Since Rust 1.81, a panic reaching an extern "C" or extern "system" export aborts the process as defined behavior. Fix it at the export by wrapping the body in catch_unwind or using EnvUnowned::with_env on jni 0.22, not at the caller.

Can Xcode Address Sanitizer instrument a prebuilt Rust staticlib?▼

No. The Xcode ASan and TSan switches only instrument code that Xcode compiles, so a prebuilt Rust staticlib is not covered, though allocator interception catches some heap errors. Run sanitizers on a host target for full Rust coverage.

Why do Rust symbols print as _RNv mangled names in my stack trace?▼

Rust 1.97 made v0 mangling the default, and tools predating v0 support print raw _R names. Upgrade the tool (binutils 2.36+, Linux perf 6.16+) or pipe output through rustfilt; on macOS use c++filt -_.

How do I debug a tokio task that hangs or never wakes?▼

Use tokio-console with console-subscriber and the tokio_unstable cfg in a local debug build to inspect live task state. A lost-waker warning means poll returned Pending without storing cx.waker().clone(); a never-yielded warning means blocking work needs spawn_blocking.