Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SV-COMP fixes #157

Merged
merged 14 commits into from
Jan 17, 2022
Merged

SV-COMP fixes #157

merged 14 commits into from
Jan 17, 2022

Commits on Jan 14, 2022

  1. Update CBMC prerequisites

    viktormalik committed Jan 14, 2022
    Configuration menu
    Copy the full SHA
    deceb82 View commit details
    Browse the repository at this point in the history
  2. Fix dynobj_instance_analysis

    The merge function needs to set has_values to unknown, otherwise the
    analysis fails to run.
    viktormalik committed Jan 14, 2022
    Configuration menu
    Copy the full SHA
    6318811 View commit details
    Browse the repository at this point in the history
  3. Workaround problem with GOTO targets

    If a single SKIP instruction is a target of both a forward and a
    backward GOTO, a malformed SSA is generated.
    
    This commit introduces a workaround that splits such GOTOs into two and
    redirects all backwards GOTOs to the second SKIP.
    
    This changes an SSA index in one test.
    viktormalik committed Jan 14, 2022
    Configuration menu
    Copy the full SHA
    eff6f0f View commit details
    Browse the repository at this point in the history
  4. SSA: drop conditional update of dynamic objects

    When assigning into a dereference, we allowed not to update the pointed
    dynamic object to simulate the fact that the dynamic object may be
    abstract (i.e. it may represent more concrete objects).
    
    This shouldn't be necessary anymore since we're using dynamic object
    instances, which should ensure soundness.
    viktormalik committed Jan 14, 2022
    Configuration menu
    Copy the full SHA
    c88cdd7 View commit details
    Browse the repository at this point in the history
  5. Correctly add allocation guards

    In new CBMC, there is a case-split in the malloc function implementation
    for detecting malloc failures. This however resulted in SSA not being
    constructed correctly, since it expected the last definition of a symbol
    to be its allocation and not a phi node.
    
    Signed-off-by: František Nečas <[email protected]>
    FrNecas authored and viktormalik committed Jan 14, 2022
    Configuration menu
    Copy the full SHA
    090c38d View commit details
    Browse the repository at this point in the history
  6. Heap: improve obtaining pointed object from solver

    If the solver returns &(X.field) where field has offset 0, this is
    equivalent to &X.
    
    This commit handles the above situation in the heap domain so that the
    points-to relation to X is properly established in the domain value.
    viktormalik committed Jan 14, 2022
    Configuration menu
    Copy the full SHA
    bc5b1da View commit details
    Browse the repository at this point in the history
  7. Fix collection of free::record vars

    These are non-deterministic boolean variables used to control assignment
    to CPROVER-specific values during free.
    
    They used to be declared-only, now they are explicitly assigned a nondet
    value, which broke our code that searched for declarations only.
    
    Fixing this problem re-enables two true memsafety regression tests.
    viktormalik committed Jan 14, 2022
    Configuration menu
    Copy the full SHA
    646ac5d View commit details
    Browse the repository at this point in the history
  8. malloc: fix getting malloc size

    After the rebase to new CBMC, constant propagation does not work in some
    cases. This is a problem for our malloc handling as we require to see:
    
      malloc_size = sizeof(...)
    
    This commit fixes the problem by recursively searching for the malloc
    size expression to handle cases like:
    
      size = sizeof(...)
      malloc_size = size
    
    Also adds a regression test for this case.
    viktormalik committed Jan 14, 2022
    Configuration menu
    Copy the full SHA
    25f05f5 View commit details
    Browse the repository at this point in the history
  9. Fix assert to limit array size

    CBMC has changed the representation of numerical values in
    constant_expr (at least for array sizes) - instead of base 2, it now
    uses base 16.
    
    We have to fix this in our assertion that limits the size of arrays in
    competition mode due to solver unsoundness that appears for arrays of
    size >=50000.
    viktormalik committed Jan 14, 2022
    Configuration menu
    Copy the full SHA
    5a63242 View commit details
    Browse the repository at this point in the history
  10. Disable unsupported operations in competition mode

    For now, we disable memcpy as it is implemented via a CBMC built-in
    operation that we do not support in 2LS, yet.
    viktormalik committed Jan 14, 2022
    Configuration menu
    Copy the full SHA
    2c45caf View commit details
    Browse the repository at this point in the history
  11. Configure gcc preprocessing to fix linking

    Signed-off-by: František Nečas <[email protected]>
    FrNecas authored and viktormalik committed Jan 14, 2022
    Configuration menu
    Copy the full SHA
    11606bc View commit details
    Browse the repository at this point in the history
  12. Correctly guard hoisted assertions

    If there are multiple loops in the program, the assertions after the
    loops are reachable only if both of the loops exit their execution.
    Previously, exiting the first loop was sufficient due to the disjunction
    making the analysis unsound (producing incorrect true results in some
    cases, including SV-comp benchmarks).
    
    Signed-off-by: František Nečas <[email protected]>
    FrNecas authored and viktormalik committed Jan 14, 2022
    Configuration menu
    Copy the full SHA
    12cc730 View commit details
    Browse the repository at this point in the history
  13. Fix workaround for signed shl

    The format of the guard changed making the hack not work and causing
    incorrect true results in bitvector category in SV-comp due to the
    hoisted assertion being added. Fix this hack.
    
    Signed-off-by: František Nečas <[email protected]>
    FrNecas authored and viktormalik committed Jan 14, 2022
    Configuration menu
    Copy the full SHA
    3f21ab9 View commit details
    Browse the repository at this point in the history
  14. Propagate #concrete for byte-array dynamic objs

    Byte arrays are produced when malloc(N) is used where N is an integer
    and not a sizeof operator. We still need to propagate the '#concrete'
    flag to make the memsafety analysis sound.
    viktormalik committed Jan 14, 2022
    Configuration menu
    Copy the full SHA
    9071c90 View commit details
    Browse the repository at this point in the history