Triage
This page is part of the agent guide. View the raw Markdown that agents read.
List the crashes
Section titled “List the crashes”stitch crashes # latest campaign other than probestitch crashes probe # the probe1 unique crash in 'probe': c1 x3 heap-use-after-free WRITE in patch suffix_object cJSON.c:1948:16 add_item_to_array cJSON.c:1999:13 example (14 calls): .stitch/campaigns/probe/w0/crashes/41f9cd94c7dfe525.stp- Crashes are grouped by kind and innermost library frames. One bug can still show as several groups: fix or explain the first, then list again. A stack overflow is grouped by its stub instead (it ends wherever the stack runs out).
- The stub named in the list comes from one example program; other programs in the group may crash in another stub.
- After you change the harness,
stitch crashesreruns the crashes with the new build, so crashes caused by fixed stubs disappear. - Ids are per campaign:
probe:c1andmain:c1are different crashes. A barec1means the latest campaign that is notprobe. Commands print which one they used. - A crash marked
[flaky: crashed 2 of 5 runs]does not reproduce every time. - A
timeoutis a program slower thantimeout_ms. It is usually a real performance bug (a quadratic loop, regex backtracking) unless the stub itself loops.
Classify each crash
Section titled “Classify each crash”stitch exec c1 --trace # every call, its arguments, then the reportstitch exec c1 --args # the same, with long arguments in fullRead the trace and the library source at the top frames. Then decide:
| Verdict | When | Next |
|---|---|---|
| harness bug | The stubs broke the API contract: a double free, wrong ownership, a missing init call, a documented precondition. | Fix the stub, stitch build, confirm stitch exec c1 no longer crashes. |
| library bug | Every call in the trace is valid use of the API. | Make a reproducer (below). |
| unsure | You cannot tell from the trace. | Read the library’s tests and docs for the functions in the trace. Decide before moving on. |
Do not add a guard to make a crash go away unless the library documents the precondition.
Make a reproducer
Section titled “Make a reproducer”For each library bug:
stitch minimize c1 # fewer calls, smaller inputs; c1 then refers to the resultstitch exec c1 --rev HEAD # still crashes on the newest library code?stitch write c1 # the crash as one source file in the harness languageShrink a copy of the written file to plain library calls. Run stitch try after every edit, and
keep only edits that print SAME CRASH:
cp .stitch/standalone/c1/repro.py .stitch/standalone/c1/min.pystitch try .stitch/standalone/c1/min.pyOptional:
stitch repro c1 # self-contained Docker folder, verified from scratchstitch bisect c1 # the commit that introduced it (needs a git source)stitch bisect c1 --fixed # the commit that fixed it, if HEAD no longer crashesThe steps and pitfalls of shrinking are in
Reproducers (stitch guide reproducers).
Done when
Section titled “Done when”Every crash is fixed in the harness, or is a library bug with a minimized reproducer and a known status at HEAD.