Skip to content

perf(library): write the analysis logs only for a violation - #98

Open
GuilhermeBn198 wants to merge 1 commit into
developfrom
perf/klee-skip-unread-logs
Open

GuilhermeBn198 wants to merge 1 commit into
developfrom
perf/klee-skip-unread-logs

Conversation

@GuilhermeBn198

@GuilhermeBn198 GuilhermeBn198 commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Every path that ends calls generate_aux_files, which writes list_log.csv, heap_log.csv and allocation_log.csv. Nothing reads these three files: git grep finds no reader in the frontend, the tests or the scripts. Under KLEE, "every path" means every forked state, and the writes go through uclibc's fprintf.

Measurement

The program is Juliet CWE761_..._char_console_01 (good), run with --memtrack --model-input, KLEE only, --timeout 60. The profile comes from --debug and run.istats.

  • With input bound 2, KLEE ran 66.7 M instructions. Of those, 59.5 M (89%) were under map2check_success → generate_aux_files → analysis_generate_aux_witness_files.
input bound before after
2 TRUE, 36 s TRUE, 7 s (7.3 M instructions)
4 UNKNOWN (13 paths completed, 42 partial) TRUE, 24 s (55 paths)

Change

generate_aux_files writes the analysis logs only for a violation, where they remain a record of it. track_bb_log.st, which the witness graph reads, is still written on every path.

The change applies to every KLEE run, with or without --model-input.

Tests

Run in map2check-v9-eval against an install with this change and #99:

  • test_model_input: 10/10
  • test_modes: 16/16
  • test_testcomp_regressions: 53/53
  • test_exit_codes: 3/3
  • test_test_suite_emission: 14/14

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant