4. Build and probe
The output on this page and the next ones was recorded by running this tutorial in the language you picked. Fuzzing is random, so your numbers and crash ids will differ.
$ stitch build[stitch] building project image stitch-kv:local (log: ~/.cache/stitch/logs/kv-local.log)ok: 4 endpoints, 1 object types, 0 datatypes [stitch-kv:local]$ stitch check4 endpoints, 1 object types, 0 datatypes harness/: 4no issues$ stitch build[stitch] building project image stitch-kv:local (log: ~/.cache/stitch/logs/kv-local.log)ok: 4 endpoints, 1 object types, 0 datatypes [stitch-kv:local]$ stitch check4 endpoints, 1 object types, 0 datatypes harness/: 4no issues$ stitch build[stitch] building project image stitch-kv:local (log: ~/.cache/stitch/logs/kv-local.log)ok: 4 endpoints, 1 object types, 0 datatypes [stitch-kv:local]$ stitch check4 endpoints, 1 object types, 0 datatypes harness/: 4no issues$ stitch build[stitch] building project image stitch-kv:local (log: ~/.cache/stitch/logs/kv-local.log)ok: 4 endpoints, 1 object types, 0 datatypes [stitch-kv:local]$ stitch check4 endpoints, 1 object types, 0 datatypes harness/: 4no issues$ stitch build[stitch] building project image stitch-kv:local (log: ~/.cache/stitch/logs/kv-local.log)ok: 4 endpoints, 1 object types, 0 datatypes [stitch-kv:local]$ stitch check4 endpoints, 1 object types, 0 datatypes harness/: 4no issues$ stitch build[stitch] building project image stitch-kv:local (log: ~/.cache/stitch/logs/kv-local.log)ok: 4 endpoints, 1 object types, 0 datatypes [stitch-kv:local]$ stitch check4 endpoints, 1 object types, 0 datatypes harness/: 4no issues$ stitch build[stitch] building project image stitch-kv:local (log: ~/.cache/stitch/logs/kv-local.log)ok: 4 endpoints, 1 object types, 0 datatypes [stitch-kv:local]$ stitch check4 endpoints, 1 object types, 0 datatypes harness/: 4no issues$ stitch build[stitch] building project image stitch-kv:local (log: ~/.cache/stitch/logs/kv-local.log)ok: 4 endpoints, 1 object types, 0 datatypes [stitch-kv:local]$ stitch check4 endpoints, 1 object types, 0 datatypes .stitch/build/app/pkg/Sources/worker/: 4no issues$ stitch build[stitch] building project image stitch-kv:local (log: ~/.cache/stitch/logs/kv-local.log)ok: 4 endpoints, 1 object types, 0 datatypes [stitch-kv:local]$ stitch check4 endpoints, 1 object types, 0 datatypes harness/: 4no issuesstitch build compiles the harness against the library image and prints compile errors with file
and line. stitch check runs static checks: stubs that can never run because nothing produces
their inputs, attributes that are read but never set, and data types with nothing to start from.
A probe is a short run with one worker, followed by a report on the stubs that are not working.
$ stitch probe --secs 30[stitch] probing for 30s of fuzzing (plus the harness build and worker start-up)...probe: 30s, 269k execs (9.0k/s), 43 edges, corpus 14, calls bailing 18% (programs with a bail 65%), 5 crash/timeout programs savedcrashes found: run `stitch crashes probe`$ stitch probe --secs 30[stitch] probing for 30s of fuzzing (plus the harness build and worker start-up)...probe: 30s, 128k execs (4.3k/s), 135/655 edges, corpus 131, calls bailing 19% (programs with a bail 56%), 5 crash/timeout programs savedcrashes found: run `stitch crashes probe`$ stitch probe --secs 30[stitch] probing for 30s of fuzzing (plus the harness build and worker start-up)...probe: 30s, 161k execs (5.4k/s), 24 edges, corpus 47, calls bailing 14% (programs with a bail 54%), 5 crash/timeout programs savedcrashes found: run `stitch crashes probe`$ stitch probe --secs 30[stitch] probing for 30s of fuzzing (plus the harness build and worker start-up)...probe: 30s, 574k execs (19.1k/s), 36 edges, corpus 41, calls bailing 26% (programs with a bail 78%), 5 crash/timeout programs saveddepends on where an input came from (the stub that made or last used that object; the fuzzer learns these pairs. Act only when the low one should work: a different kind of object behind one type gets its own type): put(st): ok 44% when st last came from put, 95% when from removecrashes found: run `stitch crashes probe`$ stitch probe --secs 30[stitch] probing for 30s of fuzzing (plus the harness build and worker start-up)...probe: 30s, 427k execs (14.2k/s), 28/61 edges, corpus 48, calls bailing 30% (programs with a bail 83%), 5 crash/timeout programs savedcrashes found: run `stitch crashes probe`$ stitch probe --secs 30[stitch] probing for 30s of fuzzing (plus the harness build and worker start-up)...probe: 30s, 124k execs (4.1k/s), 406/1831 edges, corpus 229, calls bailing 10% (programs with a bail 44%), 5 crash/timeout programs savedcrashes found: run `stitch crashes probe`$ stitch probe --secs 30[stitch] probing for 30s of fuzzing (plus the harness build and worker start-up)...probe: 30s, 171k execs (5.7k/s), 22 edges, corpus 37, calls bailing 22% (programs with a bail 59%), 5 crash/timeout programs savedcrashes found: run `stitch crashes probe`$ stitch probe --secs 30[stitch] probing for 30s of fuzzing (plus the harness build and worker start-up)...probe: 30s, 46.4k execs (1.5k/s), 248/6171 edges, corpus 135, calls bailing 22% (programs with a bail 71%), 5 crash/timeout programs savedcrashes found: run `stitch crashes probe`$ stitch probe --secs 30[stitch] probing for 30s of fuzzing (plus the harness build and worker start-up)...probe: 30s, 105k execs (3.5k/s), 26/63 edges, corpus 52, calls bailing 20% (programs with a bail 62%), 5 crash/timeout programs savedcrashes found: run `stitch crashes probe`The first line is the summary:
- execs: programs run, and how many per second.
- edges: branches of the library reached so far.
- calls bailing: the share of calls rejected as invalid input. That work is wasted.
- crash/timeout programs saved: programs that found a bug. If there are some already, leave them for page 6.
The lines below the summary name stubs to look at, such as stubs that never succeed or that are often skipped because their input object is missing.
stitch status probe --json has the numbers for each stub. The entry for load:
{"name": "load", "invoked": 503940, "ok": 331791, "bail_rate": 0.341, "bail_reasons": [{"reason": "raised ValueError", "count": 172021}]}{"name": "load", "invoked": 160955, "ok": 77807, "bail_rate": 0.51, "bail_reasons": [{"reason": "invalid text", "count": 82151}]}{"name": "load", "invoked": 232749, "ok": 135331, "bail_rate": 0.41, "bail_reasons": [{"reason": "threw RangeError", "count": 95438}]}{"name": "load", "invoked": 1137947, "ok": 505717, "bail_rate": 0.517, "bail_reasons": [{"reason": "threw IllegalArgumentException", "count": 588073}]}{"name": "load", "invoked": 970295, "ok": 258894, "bail_rate": 0.697, "bail_reasons": [{"reason": "error: no '='", "count": 563177}, {"reason": "error: bad entry", "count": 112665}]}{"name": "load", "invoked": 142266, "ok": 67578, "bail_rate": 0.373, "bail_reasons": [{"reason": "error: no '='", "count": 51255}, {"reason": "error: bad entry", "count": 1856}]}{"name": "load", "invoked": 234081, "ok": 126195, "bail_rate": 0.371, "bail_reasons": [{"reason": "raised ArgumentError", "count": 86870}]}{"name": "load", "invoked": 80284, "ok": 29454, "bail_rate": 0.607, "bail_reasons": [{"reason": "threw KVError", "count": 48723}]}{"name": "load", "invoked": 131071, "ok": 49103, "bail_rate": 0.575, "bail_reasons": [{"reason": "invalid text", "count": 75328}]}load bailed on 34% of its calls.
load bailed on 51% of its calls.
load bailed on 41% of its calls.
load bailed on 52% of its calls.
load bailed on 70% of its calls.
load bailed on 37% of its calls.
load bailed on 37% of its calls.
load bailed on 61% of its calls.
load bailed on 57% of its calls.
load is given random text. Random text rarely consists of key=value lines, so load rejects
much of it and reads few entries from the rest. The next page fixes this with a data type, and adds
a check.