From 87fc392db3836ba9fced146522f5f247b2aa3565 Mon Sep 17 00:00:00 2001 From: Guilherme Bernardo Date: Mon, 30 Nov 2026 21:54:48 -0400 Subject: [PATCH] perf(library): write the analysis logs only for a violation list_log.csv, heap_log.csv and allocation_log.csv are read by nothing, yet every path that ends writes them. Under KLEE that is every forked state, through uclibc's fprintf: on a Juliet CWE-761 good program it was 59.5 M of 66.7 M instructions (run.istats), and KLEE ran out of time before it finished the paths. Measured on that program (KLEE only, --timeout 60, --model-input): bound 2 went from TRUE in 36 s to TRUE in 7 s, bound 4 from UNKNOWN (13 paths completed) to TRUE in 24 s (55 paths). track_bb_log.st, which the witness graph reads, is still written on every path. --- modules/backend/library/lib/WitnessGeneration.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/backend/library/lib/WitnessGeneration.c b/modules/backend/library/lib/WitnessGeneration.c index 330f3876b..d25cbbfc1 100644 --- a/modules/backend/library/lib/WitnessGeneration.c +++ b/modules/backend/library/lib/WitnessGeneration.c @@ -14,7 +14,12 @@ void generate_aux_files(MAP2CHECK_CONTAINER *trackbb_log, Bool violation) { trackbb_log_to_file(trackbb_log); - analysis_generate_aux_witness_files(); + /* The analysis logs (list_log.csv, heap_log.csv, allocation_log.csv) are + * read by nothing; they are kept only as a record of a violation. Under + * KLEE every path that ends writes them otherwise, through uclibc's fprintf: + * 9 of every 10 instructions KLEE ran on a Juliet program (CWE-761 good, + * --model-input), which left it no time to finish the paths. */ + if (violation) analysis_generate_aux_witness_files(); /* Only a violating execution has an input vector worth recording, and under * KLEE every forked state reaches this point. They all write the same file, * so without the guard a state that took a different branch clobbers the