breadbug: native crash capture (segfault/abort in C libs) via systemd-coredump or crash handler #16

Open
opened 2026-10-08 20:14:12 +08:00 by Breadway · 5 comments
Owner

Part of ECO-EP1 (see ECO-66).

Rust panic hooks do not catch segfaults and aborts from GTK/GLib/Mesa and other C code. Cover them.

Options to evaluate (pick one in the PR, document why)

  • Subscribe to systemd-coredump events (coredumpctl metadata) from breadd and extract frames.
  • In-process crash-handler / minidump-style crate in bread-client.

Requirements

  • Output is frames only (module + offset + build-id), signal, and timestamp. NO memory contents, registers beyond the instruction pointer, or environment. Raw core files are never read into a report and never uploaded.
  • Record a crash marker in the breadd store tagged to the app.
  • Must not require elevated privileges for the user's own processes.
  • Graceful degrade when neither mechanism is available.

Acceptance

  • Induced SIGSEGV in a test app yields a store entry with usable frames.
  • Verified that no memory content appears in the report payload.
Part of ECO-EP1 (see ECO-66). Rust panic hooks do not catch segfaults and aborts from GTK/GLib/Mesa and other C code. Cover them. ## Options to evaluate (pick one in the PR, document why) - Subscribe to systemd-coredump events (coredumpctl metadata) from breadd and extract frames. - In-process crash-handler / minidump-style crate in bread-client. ## Requirements - Output is frames only (module + offset + build-id), signal, and timestamp. NO memory contents, registers beyond the instruction pointer, or environment. Raw core files are never read into a report and never uploaded. - Record a crash marker in the breadd store tagged to the app. - Must not require elevated privileges for the user's own processes. - Graceful degrade when neither mechanism is available. ## Acceptance - Induced SIGSEGV in a test app yields a store entry with usable frames. - Verified that no memory content appears in the report payload.
Author
Owner

Implemented in bread-ecosystem PR #68 as an in-process signal handler (chosen over systemd-coredump: no privileges or system setup, works in any user session). Verified end to end with a real SIGSEGV in a child process: the crash marker arrives with signal and a stack through the faulting function, frames contain only module/offset/build_id, and the process still dies of SIGSEGV. Limits: glibc only, libraries loaded after install are not in the module snapshot, other threads need their own alternate stack for stack-overflow reporting.

Implemented in bread-ecosystem PR #68 as an in-process signal handler (chosen over systemd-coredump: no privileges or system setup, works in any user session). Verified end to end with a real SIGSEGV in a child process: the crash marker arrives with signal and a stack through the faulting function, frames contain only module/offset/build_id, and the process still dies of SIGSEGV. Limits: glibc only, libraries loaded after install are not in the module snapshot, other threads need their own alternate stack for stack-overflow reporting.
Author
Owner

Independent changes_requested at b2614ba0e1b48f25cd40a09e184b721f512f5408. Full BREAD-17 criteria and file/line repair checklist: Breadway/bread-ecosystem#68 (comment). ECO-76 tracks defects. Native handler calls glibc backtrace without async-signal-safe guarantee (native.rs:176-185); install discards prior handlers/alt stack and syscall errors (264-290). Exact-crate probe raise(SIGSEGV) survives exit0; prior SIG_IGN overwritten. Raw module paths sent without scrubbing. Debug/release real synchronous SIGSEGV fixtures pass with frame-only payload, no memory fields, but real store entry/timestamp and assembled report acceptance unverified: bread PR22 unmerged. check/check(push) success Actions297 at exact SHA; targeted tests/clippy/GTK check pass. Move todo for coordinator repair on existing PR68, preserve branch, fresh exact-head review. No merge/tag/release/done.

Independent changes_requested at b2614ba0e1b48f25cd40a09e184b721f512f5408. Full BREAD-17 criteria and file/line repair checklist: https://git.breadway.dev/Breadway/bread-ecosystem/pulls/68#issuecomment-4431. ECO-76 tracks defects. Native handler calls glibc backtrace without async-signal-safe guarantee (native.rs:176-185); install discards prior handlers/alt stack and syscall errors (264-290). Exact-crate probe raise(SIGSEGV) survives exit0; prior SIG_IGN overwritten. Raw module paths sent without scrubbing. Debug/release real synchronous SIGSEGV fixtures pass with frame-only payload, no memory fields, but real store entry/timestamp and assembled report acceptance unverified: bread PR22 unmerged. check/check(push) success Actions297 at exact SHA; targeted tests/clippy/GTK check pass. Move todo for coordinator repair on existing PR68, preserve branch, fresh exact-head review. No merge/tag/release/done.
Author
Owner

Independent changes_requested at exact head 63b855bce63313f789ab04ffea96f0b89fdce974, base 4f70691b33bc778294073681065665d3e2b7f559. Full mapping: Breadway/bread-ecosystem#68 (comment). Repair of comment 4431 verified for std-guard detection, SIGSEGV death (7/7 crash tests, 0 ignored), custom prior handler chaining, ucontext RIP frame, auto-connect, scrub-before-send, bounded shutdown, and measured overhead. Still failing: Queue::push (mod.rs:256-274) drops the newest line when take holds the lock, even under the 512 cap. Reproduced twice: logs_are_batched_clipped_and_leveled left 2, right 3, missing the last line. Filed ECO-77. Store entry and breadclip pilot stay unverified (CLIP-19 backlog; no tag). No merge. Move to todo for repair on existing PR 68. BREAD-17 signal semantics, frame-only payload, and no core/memory/register dump passed locally. Integrated store marker still unverified.

Independent changes_requested at exact head 63b855bce63313f789ab04ffea96f0b89fdce974, base 4f70691b33bc778294073681065665d3e2b7f559. Full mapping: https://git.breadway.dev/Breadway/bread-ecosystem/pulls/68#issuecomment-4678. Repair of comment 4431 verified for std-guard detection, SIGSEGV death (7/7 crash tests, 0 ignored), custom prior handler chaining, ucontext RIP frame, auto-connect, scrub-before-send, bounded shutdown, and measured overhead. Still failing: Queue::push (mod.rs:256-274) drops the newest line when take holds the lock, even under the 512 cap. Reproduced twice: logs_are_batched_clipped_and_leveled left 2, right 3, missing the last line. Filed ECO-77. Store entry and breadclip pilot stay unverified (CLIP-19 backlog; no tag). No merge. Move to todo for repair on existing PR 68. BREAD-17 signal semantics, frame-only payload, and no core/memory/register dump passed locally. Integrated store marker still unverified.
Author
Owner

Independent re-review PR68 at 47dbe00f5e1caf06dc3fa78d904001ba978e5b9a: changes requested. Queue::push retries for 1ms then calls blocking lock; app-thread log can stall unbounded if lock holder is preempted. No IO under lock does not bound lock wait. Replace with bounded/nonblocking enqueue preserving newest below cap; add held-lock regression verifying prompt return and retention. Full persisted verdict: PR comment Breadway/bread-ecosystem#68 (comment). Preserve CLIP-19/store/pilot gates; no tag and no done.

Independent re-review PR68 at 47dbe00f5e1caf06dc3fa78d904001ba978e5b9a: changes requested. Queue::push retries for 1ms then calls blocking lock; app-thread log can stall unbounded if lock holder is preempted. No IO under lock does not bound lock wait. Replace with bounded/nonblocking enqueue preserving newest below cap; add held-lock regression verifying prompt return and retention. Full persisted verdict: PR comment https://git.breadway.dev/Breadway/bread-ecosystem/pulls/68#issuecomment-4758. Preserve CLIP-19/store/pilot gates; no tag and no done.
Author
Owner

Independent re-review of PR68 at 711e3e8261064e066b53b8f31d0cfade94d1d8ba: ECO-77/provider implementation passes, conditional on exact-SHA CI green. Persisted verdict/evidence: Breadway/bread-ecosystem#68 (comment). Queue nonblocking/drop-oldest tests and workspace suite passed; integrated store prerequisite is present, but CLIP-19 pilot remains unmerged. This is not full BREAD-16/17 acceptance. Preserve pilot/rollout gates, keep cards in review, and do not mark done. No merge until check/check (push) is green; then re-read current head/base/reviews/mergeability and merge per authorization, no tag.

Independent re-review of PR68 at 711e3e8261064e066b53b8f31d0cfade94d1d8ba: ECO-77/provider implementation passes, conditional on exact-SHA CI green. Persisted verdict/evidence: https://git.breadway.dev/Breadway/bread-ecosystem/pulls/68#issuecomment-4795. Queue nonblocking/drop-oldest tests and workspace suite passed; integrated store prerequisite is present, but CLIP-19 pilot remains unmerged. This is not full BREAD-16/17 acceptance. Preserve pilot/rollout gates, keep cards in review, and do not mark done. No merge until check/check (push) is green; then re-read current head/base/reviews/mergeability and merge per authorization, no tag.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Breadway/bread#16
No description provided.