// Trace DSL over arbitrary text: never crashes; whatever compiles // materializes into records whose node ids parse back to their trace. #include "strawberry/learn/trace.hpp" #include #include using namespace strawberry; using namespace strawberry::learn; extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { std::vector traces; std::string error; if (!compile_traces(std::string_view(reinterpret_cast(data), size), traces, error)) { if (error.empty() || !traces.empty()) __builtin_trap(); return 0; } for (const auto& t : traces) { for (const auto& r : materialize_trace(t, 1'000'000'000, 3)) { if (r.type != store::RecordType::process_exec) continue; ProcessExecRecord e; std::string name; uint32_t instance = 0; if (!decode_process_exec(r.payload, e) || !parse_trace_node(e.process_node_id, name, instance) || name != t.name || instance != 3) { __builtin_trap(); } } } return 0; }