Skip to content

SIGTRAP in Obsidian renderer at node::sqlite::UserDefinedFunction::xDestroy during c-ares finalization (request: experimentalNativeSqlite opt-out) #586

@apptb

Description

@apptb

Summary

Claudian v2.0.8 / v2.0.9 triggers repeated Obsidian renderer crashes (Obsidian Helper (Renderer)) on macOS via a node:sqlite finalization race. Three crashes today in a 42-minute window (08:09, 08:29, 08:51 EDT). Patching out the node:sqlite import to force JSONL-direct session reads has fully stopped the crashes (0 in 70+ minutes since patch landed).

Request: please add a setting like experimentalNativeSqlite: false so users can opt out of node:sqlite while a real fix lands.

Environment

  • macOS 26.2 (25C56), Apple Silicon
  • Obsidian Helper (Renderer) 0.14.8 (Electron-based)
  • Claudian: confirmed on v2.0.8 and v2.0.9
  • Claude Code CLI: ~/.local/bin/claude (managed install)
  • Vault has 299 session JSONL files in ~/.claude/projects/<encoded-vault-path>/

Crash signature

exception: EXC_BREAKPOINT  signal: SIGTRAP  code: 0x0000000000000001
=== Faulting thread 0 ===
  Electron Framework  ares_dns_rr_get_ttl
  Electron Framework  ares_dns_rr_get_ttl
  Electron Framework  ares_dns_rr_get_ttl
  Electron Framework  ares_dns_rr_get_ttl
  Electron Framework  node::sqlite::UserDefinedFunction::xDestroy(void*)
  Electron Framework  v8::PropertyDescriptor::set() const
  Electron Framework  v8::PropertyDescriptor::set() const
  Electron Framework  v8::String::ContainsOnlyOneByte() const
  Electron Framework  v8::Promise::Resolver::GetPromise()
  ...

The c-ares DNS resolver and node:sqlite UserDefinedFunction destructor stack-on each other during V8 GC, leading to a V8 invariant violation. Pattern is consistent across all three crash dumps.

Reproduction

Hard to reduce, since it depends on:

  • Open Obsidian + Claudian
  • Have a Claude Code session active that performs network I/O (any tool call that hits external services)
  • During GC of a Claude Code session that accessed sqlite session storage
  • Crash hits when sqlite UDF destructor is invoked while c-ares is mid-callback

In our environment with active Claude Code work it reliably hits within a working session — three crashes in ~40 minutes.

Workaround applied locally

In .obsidian/plugins/claudian/main.js, the runtime check that does import("node:sqlite") is replaced so it falls through to the JSONL-direct read path that already exists:

  • Patch byte-exact: count("node:sqlite") = 0 in main.js after patch
  • Plugin loads cleanly (obsidian dev:errors reports none)
  • 299 sessions still discoverable + readable (verified via parsed JSONL)
  • 0 renderer crashes for 70+ minutes since patch
  • BRAT auto-update from v2.0.8 → v2.0.9 clobbered the patch within ~2 minutes; the patch had to be re-applied to v2.0.9 and the plugin pinned in BRAT

I've also installed a launchd canary (com.pkm.claudian-canary, runs every 15 min) that greps for node:sqlite and warns if a future plugin update reintroduces it.

Ask

A user-facing toggle to disable node:sqlite-backed session storage and fall back to JSONL-direct reads. Suggested name: experimentalNativeSqlite: false in plugin settings, or an env var like CLAUDIAN_DISABLE_NATIVE_SQLITE=1.

This would let affected users opt out without forking the plugin or maintaining post-update patches.

Happy to provide the three full .ips dumps if useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions