Skip to content

Commit

Permalink
Merge branch 'master' into cfg-test
Browse files Browse the repository at this point in the history
  • Loading branch information
sim642 committed Feb 21, 2024
2 parents 3f20225 + 3dc5fc6 commit 5e65e22
Show file tree
Hide file tree
Showing 55 changed files with 1,417 additions and 442 deletions.
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ ec8611a3a72ae0d95ec82ffee16c5c4785111aa1

# fix indentation in baseInvariant
f3ffd5e45c034574020f56519ccdb021da2a1479

# Fix indentation in various non-legacy code
c3e2cc848479ae86de5542b6ab0e75a74e9cf8c9
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
run: opam exec -- dune build @doc

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
uses: actions/upload-pages-artifact@v3
with:
path: _build/default/_doc/_html/

Expand All @@ -68,4 +68,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v3
uses: actions/deploy-pages@v4
2 changes: 1 addition & 1 deletion .github/workflows/locked.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ jobs:
run: ./make.sh nat

- name: Build Gobview
run: opam exec -- dune build gobview
run: ./make.sh view

- name: Install selenium
run: pip3 install selenium webdriver-manager
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/unlocked.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ jobs:
- os: ubuntu-latest
ocaml-compiler: 4.14.x
z3: true
- os: ubuntu-latest
ocaml-compiler: 5.0.0
apron: false

# customize name to use readable string for apron instead of just a boolean
# workaround for missing ternary operator: https://github.com/actions/runner/issues/409
Expand Down Expand Up @@ -65,7 +62,7 @@ jobs:
if: ${{ matrix.apron }}
run: |
opam depext apron
opam install apron
opam install apron mlgmpidl.1.2.15
- name: Install Z3 dependencies
if: ${{ matrix.z3 }}
Expand Down Expand Up @@ -159,7 +156,7 @@ jobs:
- name: Install Apron dependencies
run: |
opam depext apron
opam install apron
opam install apron mlgmpidl.1.2.15
- name: Build
if: ${{ false }}
Expand Down Expand Up @@ -280,7 +277,7 @@ jobs:
- name: Install Apron dependencies
run: |
opam depext apron
opam install apron
opam install apron mlgmpidl.1.2.15
- name: Symlink installed goblint to repository # because tests want to use locally built one
run: ln -s $(opam exec -- which goblint) goblint
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ goblint
goblint.byte
goblint.json
goblint.domaintest
goblint_http.exe
src/config*.ml
tests/bench.txt
.DS_Store
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/annotating.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,4 @@ Include `goblint.h` when using these.
* `__goblint_assume_join(id)` is like `pthread_join(id, NULL)`, but considers the given thread IDs must-joined even if Goblint cannot, e.g. due to non-uniqueness.
Notably, this annotation can be used after a threads joining loop to make the assumption that the loop correctly joined all those threads.
_Misuse of this annotation can cause unsoundness._
* `__goblint_globalize(ptr)` forces all data potentially pointed to by `ptr` to be treated as global by simulating it escaping the thread.
9 changes: 4 additions & 5 deletions docs/user-guide/inspecting.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ For the initial setup:

To build GobView (also for development):

1. Run `dune build gobview` in the analyzer directory to build the web UI
2. The executable for the http-server can then be found in the directory `./_build/default/gobview/goblint-http-server`. It takes the analyzer directory and additional Goblint configurations such as the files to be analyzed as parameters. Run it e.g. with the following command:\
`./_build/default/gobview/goblint-http-server/goblint_http.exe -with-goblint ../analyzer/goblint -goblint --set files[+] "../analyzer/tests/regression/00-sanity/01-assert.c"`

4. Visit <http://localhost:8080>
1. Run `make view` in the analyzer directory to build the web UI
2. The executable `goblint_http.exe` takes the analyzer directory and additional Goblint configurations such as the files to be analyzed as parameters. Run it e.g. with the following command:\
`./goblint_http.exe tests/regression/00-sanity/01-assert.c`
3. Visit <http://localhost:8080>

## Witnesses

Expand Down
1 change: 1 addition & 0 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
)
(conflicts
(result (< 1.5)) ; transitive dependency, overrides standard Result module and doesn't have map_error, bind
(ez-conf-lib (= 1)) ; https://github.com/nberth/ez-conf-lib/issues/3
)
(sites
(share lib)
Expand Down
1 change: 1 addition & 0 deletions goblint.opam
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ depends: [
depopts: ["apron" "z3"]
conflicts: [
"result" {< "1.5"}
"ez-conf-lib" {= "1"}
]
build: [
["dune" "subst"] {dev}
Expand Down
1 change: 1 addition & 0 deletions goblint.opam.locked
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ dev-repo: "git+https://github.com/goblint/analyzer.git"
available: os-distribution != "alpine" & arch != "arm64"
conflicts: [
"result" {< "1.5"}
"ez-conf-lib" {= "1"}
]
post-messages: [
"Do not benchmark Goblint on OCaml 5 (https://goblint.readthedocs.io/en/latest/user-guide/benchmarking/)." {ocaml:version >= "5.0.0"}
Expand Down
2 changes: 1 addition & 1 deletion gobview
1 change: 1 addition & 0 deletions lib/goblint/runtime/include/goblint.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ void __goblint_assume(int exp);
void __goblint_assert(int exp);

void __goblint_assume_join(/* pthread_t thread */); // undeclared argument to avoid pthread.h interfering with Linux kernel headers
void __goblint_globalize(void *ptr);

void __goblint_split_begin(int exp);
void __goblint_split_end(int exp);
Expand Down
24 changes: 3 additions & 21 deletions make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ rule() {
clean)
git clean -X -f
dune clean
;; gen) gen
;; nat*)
eval $(opam config env)
dune build $TARGET.exe &&
Expand All @@ -33,10 +32,9 @@ rule() {
dune build --profile=release $TARGET.exe &&
rm -f goblint &&
cp _build/default/$TARGET.exe goblint
# alternatives to .exe: .bc (bytecode), .bc.js (js_of_ocaml), see https://dune.readthedocs.io/en/stable/dune-files.html#executable
;; js) # https://dune.readthedocs.io/en/stable/jsoo.html
dune build $TARGET.bc.js &&
node _build/default/$TARGET.bc.js
;; view)
eval $(opam config env)
dune build gobview
;; watch)
eval $(opam config env)
# dune build -w $TARGET.exe
Expand All @@ -61,8 +59,6 @@ rule() {
dune build goblint.byte &&
rm -f goblint.byte &&
cp _build/default/goblint.byte goblint.byte
# ;; tag*)
# otags -vi `find src/ -iregex [^.]*\.mli?`

# setup, dependencies
;; deps)
Expand Down Expand Up @@ -98,8 +94,6 @@ rule() {
tar xf master.tar.gz && rm master.tar.gz
rm -rf linux-headers && mv linux-headers-master linux-headers
for n in $(compgen -c gcc- | sed 's/gcc-//'); do if [ $n != 5 ]; then cp -n linux-headers/include/linux/compiler-gcc{5,$n}.h; fi; done
;; lock)
opam lock
;; npm)
if test ! -e "webapp/package.json"; then
git submodule update --init --recursive webapp
Expand All @@ -115,8 +109,6 @@ rule() {
;; setup_gobview )
[[ -f gobview/gobview.opam ]] || git submodule update --init gobview
opam install --deps-only --locked gobview/
# ;; watch)
# fswatch --event Updated -e $TARGET.ml src/ | xargs -n1 -I{} make
;; install)
eval $(opam config env)
dune build @install
Expand Down Expand Up @@ -148,16 +140,6 @@ rule() {
./scripts/update_suite.rb # run regression tests
;; testci)
ruby scripts/update_suite.rb -s -d # -s: run tests sequentially instead of in parallel such that output is not scrambled, -d shows some stats?
;; travis) # run a travis docker container with the files tracked by git - intended to debug setup problems on travis-ci.com
echo "run ./scripts/travis-ci.sh to setup ocaml"
# echo "bind-mount cwd: beware that cwd of host can be modified and IO is very slow!"
# docker run -it -u travis -v $(pwd):$(pwd):delegated -w $(pwd) travisci/ci-garnet:packer-1515445631-7dfb2e1 bash
echo "copy cwd w/o git-ignored files: changes in container won't affect host's cwd."
# cp cwd (with .git, _opam, _build): 1m51s, cp ls-files: 0.5s
docker run -it -u travis -v `pwd`:/analyzer:ro,delegated -w /home/travis travisci/ci-garnet:packer-1515445631-7dfb2e1 bash -c 'cd /analyzer; mkdir ~/a; cp --parents $(git ls-files) ~/a; cd ~/a; bash'
;; server)
rsync -avz --delete --exclude='/.git' --exclude='server.sh' --exclude-from="$(git ls-files --exclude-standard -oi --directory > /tmp/excludes; echo /tmp/excludes)" . serverseidl6.informatik.tu-muenchen.de:~/analyzer2
ssh serverseidl6.informatik.tu-muenchen.de 'cd ~/analyzer2; make nat && make test'

;; *)
echo "Unknown action '$1'. Try clean, native, byte, profile or doc.";;
Expand Down
6 changes: 2 additions & 4 deletions scripts/test-gobview.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ def cleanup(browser, thread):
# serve GobView in different thread so it does not block the testing
def serve():
global p
goblint_http_path = '_build/default/gobview/goblint-http-server/goblint_http.exe'
p = subprocess.Popen(['./' + goblint_http_path,
'-with-goblint', '../analyzer/goblint',
'-goblint', '--set', 'files[+]', '"../analyzer/tests/regression/00-sanity/01-assert.c"'])
goblint_http_path = './goblint_http.exe'
p = subprocess.Popen([goblint_http_path, 'tests/regression/00-sanity/01-assert.c'])

print("serving at port", PORT)
thread = Thread(target=serve, args=())
Expand Down
Loading

0 comments on commit 5e65e22

Please sign in to comment.