Skip to content

linuxci: test compiling linux #5

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

Open
wants to merge 34 commits into
base: develop
Choose a base branch
from
Open

linuxci: test compiling linux #5

wants to merge 34 commits into from

Conversation

nmanthey
Copy link
Owner

Similarly to Xen, CBMC should be able to compile the linux kernel. As
compiling the full kernel is very time consuming, and with CBMC also
space consuming, only compile a single file and all its dependencies,
with the smalles configuration possible.

Once this is working, the configuration, as well as targets to be
compiled can be increased.

Signed-off-by: Norbert Manthey nmanthey@amazon.de

  • Each commit message has a non-empty body, explaining why the change was made.
  • [N/A] Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • [N/A] The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • [N/A] Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • [N/A] My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@codecov-io
Copy link

codecov-io commented Mar 11, 2021

Codecov Report

❗ No coverage uploaded for pull request base (develop@5d83cc4). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             develop       #5   +/-   ##
==========================================
  Coverage           ?   75.02%           
==========================================
  Files              ?     1431           
  Lines              ?   155295           
  Branches           ?        0           
==========================================
  Hits               ?   116504           
  Misses             ?    38791           
  Partials           ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5d83cc4...35d395e. Read the comment docs.

@nmanthey nmanthey force-pushed the linux-github-ci branch 4 times, most recently from a852e84 to 254acbd Compare March 12, 2021 08:08
Moving them to cbmc-cpp as they test VERIFICATION results, with few
exceptions that were safe to be placed in the cpp folder. Adding
`#include <cassert>` as needed.
@nmanthey nmanthey force-pushed the linux-github-ci branch 3 times, most recently from 38e59d2 to ffc036a Compare March 18, 2021 12:27
tautschnig and others added 3 commits March 18, 2021 13:39
As part of the regular release process.
@nmanthey nmanthey force-pushed the linux-github-ci branch 3 times, most recently from 8c88986 to b16829e Compare March 18, 2021 15:44
feliperodri and others added 6 commits March 18, 2021 14:26
…n-reg-tests

Adds code contracts regression tests that involve function calls
Commit 879afa2 introduced tests that result in name conflicts
on non-case-sensitive file systems.

Signed-off-by: Felipe R. Monteiro <felisous@amazon.com>
Properly rename regression tests from cbmc-cpp
We have these tests in the repository, but did not include them in
either Makefile or CMake configurations. They can't work right now as
the "--incremental" command-line option doesn't yet exist, thus marking
them as "FUTURE."
For as long as goto-programs/ uses util/c_types.h, expression types
generated during goto-program construction rely on bit widths to be
configured.
The Python script silently failed when invoked from run_diff.sh, which
redirects stdout to a file, when unidiff was not available.
tautschnig and others added 15 commits March 19, 2021 14:29
Using Python 3 (as is the default GitHub's Ubuntu 20.04) requires
merging changes from https://github.com/cpplint/cpplint, which is a
larger undertaking.
We have regression tests for cpplint.py, and should perhaps have used
them to avoid silently failing.
…ests

Add cbmc --incremental regression tests as FUTURE
The `__CPROVER_loop_invariant` contract used to incorrectly havoc the underlying pointer location instead of just havocing the value at the memory location. This commit fixes this.
Store the elements to be removed in a set until after the iteration is
done, and then remove the chosen elements. The more standard approach
could be returning the iterator to the next element in the
remove-an-element function, but this requires larger changes here. Thus
keeping it small and simple for now.
These regression tests are a selected subset (cf. README.txt) of the
full set of available tests (stored in goto-instrument-wmm-full.tgz),
and will ensure basic testing of the functionality implemented in
goto-instrument. Test specifications were updated to work with current
infrastructure.
Make all regression tests from the archive available (yet marking them as
THOROUGH or KNOWNBUG to avoid including them by default). This avoids having an
unused archive file bit-rotting in the repository. This commit was generated as
follows:

```

set -e

cd regression/goto-instrument-wmm-core/
tar xzf ../goto-instrument-wmm-full.tgz --strip-components=1
for f in $(tar tzf ../goto-instrument-wmm-full.tgz | sed 's#^goto-instrument-wmm-full/##')
do
  [ -f $f ] || continue
  if git status --porcelain $f | grep -q '^?'
  then
    if [[ $(basename $f) == "test.desc" ]]
    then
      sed -i '1s/^CORE$/THOROUGH/' $f
      if ! grep -q EXIT $f
      then
        if grep -q "VERIFICATION FAILED" $f
        then
          sed -i '/SIGNAL=0/ i ^EXIT=10$' $f
        else
          sed -i '/SIGNAL=0/ i ^EXIT=0$' $f
        fi
      fi
    elif [[ $f =~ \.c$ ]]
    then
      clang-format -i $f
    fi
    git add $f
  else
    git checkout -- $f
  fi
done
git rm ../goto-instrument-wmm-full.tgz

git commit -F - <<EOF
Add regression tests from goto-instrument-wmm-full.tgz

Make all regression tests from the archive available (yet marking them as
THOROUGH or KNOWNBUG to avoid including them by default). This avoids having an
unused archive file bit-rotting in the repository. This commit was generated as
follows:

\`\`\`
$(<../../script.sh)
\`\`\`
EOF
```
Tag all *_OPT tests "glpk" and exclude them from test runs by default as
we don't currently build with glpk by default.
Some of the tests that were previously imported as THOROUGH from the tar
archive actually are failing and require further investigation.
These tests currently pass and each of them completes in under 1 second.
Enable regression tests of weak memory model instrumentation
Script the steps required to build linux, so that they can also be
executed locally.

Signed-off-by: Norbert Manthey <nmanthey@amazon.de>

Signed-off-by: Norbert Manthey <nmanthey@amazon.de>
Similarly to Xen, CBMC should be able to compile the linux kernel. As
compiling the full kernel is very time consuming, and with CBMC also
space consuming, only compile a core part all its dependencies, with
the smalles configuration possible. For this core part, we select the
KVM hypervisor.

Once this is working, the configuration, as well as targets to be
compiled can be increased.

When the linuxci fails, we want to be able to easily understand the
failure. The used one-line-scan tool already captures input files that
cannot be handled by goto-cc. Hence, also archives these files for easy
access in the web UI.

Signed-off-by: Norbert Manthey <nmanthey@amazon.de>
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.

8 participants