macaw-symbolic
: Fine-grained tracking of machine code–specific bad behavior (à la HasLLVMAnn
)
#429
Labels
macaw-symbolic
: Fine-grained tracking of machine code–specific bad behavior (à la HasLLVMAnn
)
#429
macaw-symbolic
is built on top of thecrucible-llvm
memory model, which means that it has the ability to report instances of C-oriented bad behavior (assuming that the underlying machine code adheres to C's memory model conventions). These instances of bad behavior are tracked via theHasLLVMAnn
constraint that is threaded throughoutmacaw-symbolic
.In addition to C memory model checks,
macaw-symbolic
also adds a variety of additional assertions that are specific to machine code. These include (but are likely not limited to):Checking if reads from and writes to the global address space are within bounds:
macaw/symbolic/src/Data/Macaw/Symbolic/Memory/Common.hs
Lines 172 to 175 in 186c35d
macaw/symbolic/src/Data/Macaw/Symbolic/Memory/Common.hs
Lines 181 to 187 in 186c35d
Using a default value when a conditional read's condition does not hold:
macaw/symbolic/src/Data/Macaw/Symbolic/MemOps.hs
Lines 1095 to 1099 in 186c35d
A variety of checks when performing memory operations involving pointers:
macaw/symbolic/src/Data/Macaw/Symbolic/MemOps.hs
Lines 502 to 506 in 186c35d
The
attn
signal (inmacaw-ppc-symbolic
):macaw/macaw-ppc-symbolic/src/Data/Macaw/PPC/Symbolic/Functions.hs
Lines 82 to 84 in 186c35d
Loss of floating-point precision (in
macaw-ppc-symbolic
):macaw/macaw-ppc-symbolic/src/Data/Macaw/PPC/Symbolic/Functions.hs
Lines 235 to 246 in 186c35d
Dividing by zero in a division-related instruction (in
macaw-x86-symbolic
):macaw/x86_symbolic/src/Data/Macaw/X86/Crucible.hs
Lines 725 to 729 in 186c35d
A quotient overflowing in a division-related instruction (in
macaw-x86-symbolic
):macaw/x86_symbolic/src/Data/Macaw/X86/Crucible.hs
Lines 767 to 769 in 186c35d
macaw/x86_symbolic/src/Data/Macaw/X86/Crucible.hs
Lines 807 to 809 in 186c35d
Unlike the checks in the
crucible-llvm
memory model, however, these assertions are all performed viaGenericSimError
orAssertFailureSimError
. As a result, it is not straightforward to catch these assertions and perform subsequent analysis on them after simulation fails.I propose that
macaw-symbolic
add a constraint similar toHasLLVMAnn
(perhapsHasMacawAnn
, for lack of a better name) and use it to track the What4 annotations of each of the terms that give rise to these assertion failures. That way, one can consult theMap
of badmacaw-symbolic
behaviors afterwards and match the annotations to the corresponding terms. This would require a fair bit of API churn in order to thread the newHasMacawAnn
constraint through to the relevant functions, however.The text was updated successfully, but these errors were encountered: