-
Notifications
You must be signed in to change notification settings - Fork 110
Adding witness generation to SymbolicListener GSoC 2024 project #104
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
kylekim72
wants to merge
31
commits into
SymbolicPathFinder:sv-comp
Choose a base branch
from
kylekim72:sv-comp
base: sv-comp
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
b545fa5
Update README.md
kylekim72 8199510
Update README.md
kylekim72 947685b
Adding witness generation to SymbolicListener GSoC 2024 project
kylekim72 3c0ef5f
Change Verifier.randomBool() to Debug.makeSymbolicBoolean to generate…
kylekim72 6574477
Adding witness generation to SymbolicListener GSoC 2024 project
kylekim72 a9b664e
Adding witness generation to SymbolicListener GSoC 2024 project
kylekim72 2ae9d6c
Adding additional header and key to be able to run on gwit
kylekim72 ed96270
Moved to src/main/resources
kylekim72 2ffdab4
Add template for witness generation
kylekim72 022c682
Adding witness generation to SymbolicListener GSoC 2024 project
kylekim72 276cc5e
Adding package for witness generation GSoC 2024 project
kylekim72 844246f
Adding package for witness generation GSoC 2024 project
kylekim72 4bf6eff
Add comments for object and methods
kylekim72 89bf697
Add comments for object and methods
kylekim72 8417ccb
Add comments for object and methods
kylekim72 1af805c
Add comments for object and methods
kylekim72 90a3d14
Add comments for object and methods
kylekim72 cfbe684
Add comments for object
kylekim72 1e91da8
Add comments for object and methods
kylekim72 4cbeb44
Fix small bug
kylekim72 7cd55ba
Add a guide to generate witness and validate it
kylekim72 67637cb
Add a guide to generate witness and validate it
kylekim72 376c2cd
Add a guide to generate witness and validate it
kylekim72 37e5e35
Add link to wit4java and sv-benchmarks and specify directory structure
kylekim72 98f2d9d
Add link to wit4java and sv-benchmarks and specify directory structure
kylekim72 4000a8b
Add link to wit4java and sv-benchmarks and specify directory structure
kylekim72 3003f17
Update README.md
kylekim72 9276524
Update README.md
kylekim72 bb6633b
Adding script to run SPF on SV-COMP benchmarks
kylekim72 5454005
Added a setting to find resource properly
kylekim72 fd6b853
Fix to load witness template dynamically
kylekim72 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| #!/bin/bash | ||
|
|
||
| # create site.properties | ||
| SITE_PROPERTIES=site.properties | ||
| echo "jpf-core = `pwd`/jpf-core" > $SITE_PROPERTIES | ||
| echo "jpf-symbc = `pwd`/jpf-symbc" >> $SITE_PROPERTIES | ||
| echo "extensions=\${jpf-core},\${jpf-symbc}" >> $SITE_PROPERTIES | ||
|
|
||
| # parse arguments | ||
| declare -a BM | ||
| BM=() | ||
| PROP_FILE="" | ||
| WITNESS_FILE="" | ||
|
|
||
| TOOL_BINARY=jpf-core/bin/jpf | ||
| FIND_OPTIONS="-name '*.java'" | ||
|
|
||
| while [ -n "$1" ] ; do | ||
| case "$1" in | ||
| --32|--64) BIT_WIDTH="${1##--}" ; shift 1 ;; | ||
| --propertyfile) PROP_FILE="$2" ; shift 2 ;; | ||
| --graphml-witness) WITNESS_FILE="$2" ; shift 2 ;; | ||
| --version) date -r jpf-symbc/build/jpf-symbc.jar ; exit 0 ;; | ||
| *) SRC=(`eval "find $1 $FIND_OPTIONS"`) ; BM=("${BM[@]}" "${SRC[@]}") ; shift 1 ;; | ||
| esac | ||
| done | ||
|
|
||
| if [ -z "${BM[0]}" ] || [ -z "$PROP_FILE" ] ; then | ||
| echo "Missing benchmark or property file" | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [ ! -s "${BM[0]}" ] || [ ! -s "$PROP_FILE" ] ; then | ||
| echo "Empty benchmark or property file" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # we ignore the property file (there is only one property at the moment) | ||
| # we ignore the witness file (not used yet) | ||
|
|
||
| LOG=`mktemp -t jpf-log.XXXXXX` | ||
| DIR=`mktemp -d -t jpf-benchmark.XXXXXX` | ||
| trap "rm -rf $DIR" EXIT | ||
|
|
||
| # create target directory | ||
| mkdir -p $DIR/target/classes | ||
|
|
||
| # build src files from benchmark | ||
| /Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/bin/javac -g -cp $DIR/target/classes:../wit4java/sv-benchmarks/java/common:../wit4java/sv-benchmarks/java/securibench/micro:../wit4java/sv-benchmarks/java/java-ranger-regression/infusion/impl -d $DIR/target/classes "${BM[@]}" | ||
|
|
||
| # create configuration file | ||
| echo "target=Main" > $DIR/config.jpf | ||
| echo "classpath=`pwd`/jpf-symbc/build/classes:$DIR/target/classes" >> $DIR/config.jpf | ||
| echo "symbolic.dp=z3bitvector" >> $DIR/config.jpf | ||
| echo "symbolic.bvlength=64" >> $DIR/config.jpf | ||
| echo "search.depth_limit=200" >> $DIR/config.jpf | ||
| echo "symbolic.strings=true" >> $DIR/config.jpf | ||
| #echo "symbolic.optimizechoices=false" >> $DIR/config.jpf | ||
| echo "symbolic.string_dp=z3str3" >> $DIR/config.jpf | ||
| echo "symbolic.string_dp_timeout_ms=3000" >> $DIR/config.jpf | ||
| echo "symbolic.lazy=on" >> $DIR/config.jpf | ||
| echo "symbolic.arrays=true" >> $DIR/config.jpf | ||
| echo "listener = .symbc.SymbolicListener" >> $DIR/config.jpf | ||
|
|
||
| # run SPF | ||
| export DYLD_LIBRARY_PATH=`pwd`/jpf-symbc/lib:$DYLD_LIBRARY_PATH | ||
| #jpf-core/bin/jpf $DIR/config.jpf | ||
| if test -z "$JVM_FLAGS"; then | ||
| JVM_FLAGS="-Xmx1024m -ea" | ||
| fi | ||
| timeout 900 /Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/bin/java $JVM_FLAGS -jar `pwd`/jpf-core/build/RunJPF.jar $DIR/config.jpf | tee $LOG | ||
|
|
||
| if [ $? -eq 124 ]; then | ||
| echo "UNKNOWN" | ||
| exit 0 | ||
| fi | ||
|
|
||
| # check the result | ||
| grep "no errors detected" $LOG > /dev/null | ||
| if [ $? -eq 0 ]; then | ||
| echo "SAFE" | ||
| else | ||
| grep "^error.*NoUncaughtExceptionsProperty.*AssertionError" $LOG > /dev/null | ||
| if [ $? -eq 0 ]; then | ||
| echo "UNSAFE" | ||
| else | ||
| echo "UNKNOWN" | ||
| fi | ||
| fi | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.