Skip to content

Commit d4a2d8e

Browse files
committed
Merge branch 'master' into incremental_benchmarking_scripts
2 parents 696506f + d0d5dfc commit d4a2d8e

File tree

15 files changed

+131
-32
lines changed

15 files changed

+131
-32
lines changed

Pthread.set

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pthread/*_comb.yml

gobpie-demos/chrony/chrony-4.2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"ana": {
44
"activated": [
55
"expRelation", "base", "threadid", "threadflag", "threadreturn",
6-
"escape", "mutexEvents", "mutex", "access", "mallocWrapper", "mhp",
6+
"escape", "mutexEvents", "mutex", "access", "race", "mallocWrapper", "mhp",
77
"symb_locks", "var_eq", "mallocFresh", "threadJoins"
88
],
99
"ctx_insens": [

gobpie-demos/silver-searcher/goblint.json

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"goblintConf": "goblint.json"
2+
"goblintConf": "the_silver_searcher.json"
33
}

gobpie-demos/silver-searcher/the_silver_searcher.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
2+
"files": ["the_silver_searcher"],
23
"ana": {
34
"activated": [
45
"expRelation", "base", "threadid", "threadflag", "threadreturn",
5-
"escape", "mutexEvents", "mutex", "access", "mallocWrapper", "mhp",
6+
"escape", "mutexEvents", "mutex", "access", "race", "mallocWrapper", "mhp",
67
"mallocFresh"
78
],
89
"base": {

gobpie-demos/smtprc/smtprc.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"ana": {
44
"activated": [
55
"expRelation", "base", "threadid", "threadflag", "threadreturn",
6-
"escape", "mutexEvents", "mutex", "access", "mallocWrapper", "mhp",
6+
"escape", "mutexEvents", "mutex", "access", "race", "mallocWrapper", "mhp",
77
"symb_locks", "var_eq", "mallocFresh", "threadJoins"
88
],
99
"ctx_insens": [
@@ -12,7 +12,9 @@
1212
"base": {
1313
"privatization": "none",
1414
"context": {
15-
"non-ptr": false
15+
"non-ptr": false,
16+
"int": false,
17+
"interval": false
1618
}
1719
},
1820
"thread": {
@@ -69,10 +71,12 @@
6971
"cast": false,
7072
"race": true,
7173
"deadlock": false,
72-
"deadcode": true,
74+
"deadcode": false,
7375
"analyzer": false,
7476
"unsound": false,
7577
"imprecise": false,
76-
"unknown": false
78+
"unknown": false,
79+
"race-threshold": 110,
80+
"info": false
7781
}
7882
}

juliet/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Juliet Suite
2+
3+
Assuming goblint is located at `../../analyzer/goblint`, this script should work out of the box.
4+
It downloads Juliet suite if not already available. By default it runs everything, but the result parsing only works for a few things...
5+
6+
For race detection, try `python3 juliet_summary.py C/testcases/CWE366_Race_Condition_Within_Thread`.
7+
8+
This simply runs the Juliet suite by executing commands for the positive and negative cases. These can also be called manually, such as:
9+
* `goblint C/testcases/CWE366_Race_Condition_Within_Thread/CWE366_Race_Condition_Within_Thread__global_int_01.c C/testcasesupport/*.c -I C/testcasesupport --sets "mainfun[+]" CWE366_Race_Condition_Within_Thread__global_int_01_good`
10+
* `goblint C/testcases/CWE366_Race_Condition_Within_Thread/CWE366_Race_Condition_Within_Thread__global_int_01.c C/testcasesupport/*.c -I C/testcasesupport --sets "mainfun[+]" CWE366_Race_Condition_Within_Thread__global_int_01_bad`
11+
12+
The script creates a summary table in this root directory,
13+
and the result files are stored inside `C/juliet_summary_fileoutputs/`.

juliet/juliet_summary.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import zipfile
77

88
# Used to access Juliet Suite or to confirm its existence in the current dir
9-
juliet_url = 'https://samate.nist.gov/SRD/testsuites/juliet/Juliet_Test_Suite_v1.3_for_C_Cpp.zip'
9+
juliet_url = 'https://samate.nist.gov/SARD/downloads/test-suites/2017-10-01-juliet-test-suite-for-c-cplusplus-v1-3.zip'
1010
juliet_path = 'C/testcases'
1111

1212
# Checking if the testcases path exists, if not the script will download the Juliet Suite
@@ -74,7 +74,7 @@ def check_path(filepath):
7474
# '_good' or '_bad' determined by input parameter 'mode'
7575
def goblint_cmd(filepath, filename, mode):
7676
func = re.sub('a?\.c$', mode, filename) # File ending is cut and replaced by mode
77-
cmd = goblint_path + ' ' + filepath + ' ' + testsupport_files + ' -I ' + testsupport_path + ' --sets "mainfun[+]" ' + func + ' --enable dbg.debug --enable dbg.timing.enabled'
77+
cmd = goblint_path + ' ' + filepath + ' ' + testsupport_files + ' -I ' + testsupport_path + ' --set "mainfun[+]" ' + func + ' --set ana.malloc.unique_address_count 1 --enable dbg.debug --enable dbg.timing.enabled'
7878
print(filename + ' -- ' + mode[1:] + ' ', end='\r')
7979
process = subprocess.run(cmd, shell=True, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
8080
#title = '#####################\n' + mode.upper() + '\n#####################\n\n'
@@ -135,7 +135,7 @@ def files_output_to_HTML(testcases, filepath, html_table):
135135
# # # MAIN PROCEDURES # # #
136136

137137
# Regex string that is used to confirm that vulnerabilities were detected
138-
v_detection = 'is dead!|Summary for all memory locations:'
138+
v_detection = 'is dead!|\[Warning\]\[Race\]'
139139

140140
# Blanks for HTML content
141141
# '' - empty string for HTML table that will contain results from Goblint

pthread/aget_comb.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
format_version: '2.0'
2+
3+
input_files: 'aget_comb.c'

pthread/ctrace_comb.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
format_version: '2.0'
2+
3+
input_files: 'ctrace_comb.c'

0 commit comments

Comments
 (0)