debugging
БесплатноБез исполняемых скриптовНе проверенHow to debug tursodb using bytecode comparison, logging, ThreadSanitizer, deterministic simulation, stack usage scripts, and corruption analysis tools
от tursodatabase★ 25 410 звёзд на GitHubОб этом скилле
Debugging Guide
Bytecode Comparison
When Turso and SQLite give different results, run EXPLAIN on both:
sqlite3 :memory: "EXPLAIN SELECT 1 + 1;"
cargo run --bin tursodb :memory: "EXPLAIN SELECT 1 + 1;"
Different bytecode means a bug in code generation (core/translate/). Same bytecode
with different results means a bug in the VM or storage layer.
Logging
tursodb logs with tracing. It reads RUST_LOG (default level: warn) and writes to
stderr, or to a file with -t <file> (--tracing-output).
RUST_LOG=turso_core=trace cargo run --bin tursodb -- -t /tmp/turso.log :memory: 'SELECT 1;'
Logs can reach megabytes. make test sets RUST_LOG=off, so use cargo run or cargo test to get logs.
Threading Issues
Run the stress test under ThreadSanitizer. It needs a nightly toolchain with the rust-src component, and --target set to the host target (x86_64-unknown-linux-gnu on Linux, aarch64-apple-darwin on Apple Silicon):
RUSTFLAGS="-Zsanitizer=thread" cargo +nightly run -Zbuild-std --target x86_64-unknown-linux-gnu \
-p turso_stress -- --vfs syscall --nr-threads 4 --nr-iterations 1000
Flags: --vfs, --nr-threads (-t), --nr-iterations (-i); see --help for the rest.
Deterministic Simulation
Replay a failure with its seed. The simulator binary is named limbo_sim.
RUST_LOG=limbo_sim=debug cargo run --bin limbo_sim -- -s <seed>
# Whopper (concurrent simulator). Repeat a run with the same seed and flags.
SEED=1234 ./testing/concurrent-simulator/bin/run
See testing/concurrent-simulator/README.md for flags such as --mode and --swarm.
Stack Usage
Parsing and translating an expression recurse once per level of nesting, so frame
size limits how deep an expression can be. Scripts in scripts/stack/ measure it
(-h lists options). Use a release build (cargo build --release --bin tursodb);
debug builds do not reuse stack slots, so their frames say little about what users run.
scripts/stack/frame-sizes.sh '<function name pattern>' # frame size per function; -c compares two binaries
scripts/stack/min-stack.sh -S -b target/release/tursodb deep.sql # smallest stack that runs a script
scripts/stack/stack-profile.sh deep.sql # functions on the stack at its deepest point (lldb)
Functions that recurse per level should be small. Move rare and large paths into
#[inline(never)] helpers, like SQLite's SQLITE_NOINLINE. LLVM reserves the full
frame when a function starts, so a large value in any branch counts at each level.
Move the work before and after the recursive call into #[inline(never)] helpers,
and keep large values (plans, contexts, AST nodes) in a Box.
sqlite/conformance/turso-sqltests/nesting-limits.sqltest runs queries at the
nesting limits, and one level past them, on the CLI backend. CI runs it with a
release build and an 8 MiB stack. A debug build skips it. When you add a kind of
nesting, add a query there.
Corruption
For WAL corruption and integrity failures, use scripts/corruption-debug-tools/.
See references/CORRUPTION-TOOLS.md.
Установить debugging в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл debugging?
How to debug tursodb using bytecode comparison, logging, ThreadSanitizer, deterministic simulation, stack usage scripts, and corruption analysis tools
Как установить скилл debugging?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл debugging запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic