Skip to content
This repository has been archived by the owner on Oct 3, 2021. It is now read-only.

Commit

Permalink
Revert "Removed duplicate benchmark"
Browse files Browse the repository at this point in the history
This reverts commit 9182d44.
  • Loading branch information
kfriedberger committed Nov 27, 2016
1 parent a984fe7 commit 85a695e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions c/check.py
Expand Up @@ -122,6 +122,7 @@
("loop-lit", "gcnr2008_false-unreach-call_false-termination.c is not contained in any category"),
("recursive", "Addition03_false-no-overflow.c is not contained in any category"),
("ssh-simplified", "s3_clnt_3.cil_true-unreach-call_true-termination.c is not contained in any category"),
("termination-crafted", "Nyala-2lex_false-valid-deref.c is not contained in any category"),
("termination-memory-alloca", "cll_by_lseg-alloca_false-termination.c is not contained in any category"),
("termination-memory-alloca", "cll_by_lseg-alloca_true-termination.c is not contained in any category"),
("termination-memory-alloca", "cll_by_lseg_traverse-alloca_false-termination.c is not contained in any category"),
Expand Down
25 changes: 25 additions & 0 deletions c/termination-crafted/Nyala-2lex_false-valid-deref.c
@@ -0,0 +1,25 @@
/*
* Date: 2013-07-13
* Author: leike@informatik.uni-freiburg.de
*
* Simple test case for the lexicographic template.
* Has the lexicographic ranking function
* f(x, y) = <x, y>
*
*/

typedef enum {false, true} bool;

extern int __VERIFIER_nondet_int(void);

int main() {
int x, y;
while (x >= 0 && y >= 0) {
y = y - 1;
if (y < 0) {
x = x - 1;
y = __VERIFIER_nondet_int();
}
}
return 0;
}

5 comments on commit 85a695e

@dbeyer
Copy link
Member

@dbeyer dbeyer commented on 85a695e Nov 27, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added to category HeapMemSafety in commit bf78725 and
removed from check.py in commit 123c12f.

Please review @PhilippWendler

@PhilippWendler
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not an expert in this category, somebody else should do this. Not sure if access to uninitialized int variables counts as _false-valid-deref.

@tautschnig
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Citing the rules "All pointer dereferences are valid (counterexample: invalid dereference). More precisely: There exists no finite execution of the program on which an invalid pointer dereference occurs."

No, accessing an uninitialized int could hardly be considered false-valid-deref.

It is my understanding the the users of LLVM pushed most strongly for ruling out all uninitialized variables, because the front-end would possibly remove or auto-initialize them. Consequently they would never even get to see this benchmark as-is, and couldn't properly reason about it. And we could find all the cases in the repository by looking at the compiler warnings in our checks - we don't really need to run model checkers...

@dbeyer
Copy link
Member

@dbeyer dbeyer commented on 85a695e Nov 27, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But then the file name is wrong and should be fixed first.
Perhaps to include _false-no-undef-var or such.

@tautschnig
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now #262 for visibility.

Please sign in to comment.