Closed
Description
This branch contains the problematic model https://github.com/remi-delmas-3000/cbmc/tree/record-write-v-minimized
The s2n_record_writev.c
model reveals several problems, described in regression/contracts/s2n_record_writev/RUNME.sh
.
In short:
- translating the model with
goto-cc s2n_record_writev.c
produces a modela.out
that can be analysed directly bycbmc
with pointer checks and pointer primitive checks without problems. - running a single pass of
goto-instrument a.out b.out
without options turnsa.out
into a slightly different modelb.out
that makescbmc --pointer-checks --pointer-primitive-checks b.out
explode in size during CNF translation - A nondet pointer assignment to a pointer packed in a
struct s2n_hash_state
seems to have a side effect on another pointer of the struct (removing the nondet assignment from the C file solves all performance problems); - Slight alterations of the PO formulation
assert(pointer_offset(object) >= constant)
instead ofassert(!(pointer_offset(object) < constant))
seems to result in large CNF size differences; - Possibly lacking common subexpression reuse in automatically generated
rw_ok
checks and pointer checks (the expression of the pointer being checked contains byte_extracts and has multiple individual occurrences in the check expression.); - What could also be happening is that the
goto-instrument
pass expands therw_ok
assertion contained ina.out
and that the resulting expressions inb.out
get themselves instrumented as if they were user code. (this could explain the difference in number of generated POs betweena.out
(Generated 445 VCC(s), 19 remaining after simplification) andb.out
(Generated 529 VCC(s), 103 remaining after simplification)).
It could be possible to add disable:pointer-check
, disable:pointer-primitive-check
, disable:pointer-overflow-check
pragmas to avoid the expanded expression being itself instrumented in later passes (if this is what happens).
CBMC version: 5.70 +
Operating system: linux, macOS
Exact command line resulting in the issue: see regression/contracts/s2n_record_writev/RUNME.sh
What behaviour did you expect: analysis terminates
What happened instead: analysis saturates RAM (128gigs)