Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
Zipr Toolchain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open Source Software
Zipr Toolchain
Commits
7eeee774
Commit
7eeee774
authored
14 years ago
by
an7s
Browse files
Options
Downloads
Patches
Plain Diff
backing up
parent
bd2b292f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitattributes
+2
-0
2 additions, 0 deletions
.gitattributes
tools/p1xform.doxform.sh
+68
-0
68 additions, 0 deletions
tools/p1xform.doxform.sh
tools/p1xform.pbed.sh
+68
-0
68 additions, 0 deletions
tools/p1xform.pbed.sh
tools/p1xform.sh
+29
-24
29 additions, 24 deletions
tools/p1xform.sh
with
167 additions
and
24 deletions
.gitattributes
+
2
−
0
View file @
7eeee774
...
...
@@ -45,6 +45,8 @@ examples/recover_example.c -text
tools/do_concolic.sh -text
tools/generate_exe.sh -text
tools/getsyms.sh -text
tools/p1xform.doxform.sh -text
tools/p1xform.pbed.sh -text
tools/p1xform.sh -text
tools/peasoup_link -text
tools/peasoup_link++ -text
...
...
This diff is collapsed.
Click to expand it.
tools/p1xform.doxform.sh
0 → 100755
+
68
−
0
View file @
7eeee774
#!/bin/sh
#
# $1 is a file containing list of functions to test
# $2 specifies directory with the inputs found by GrACE
# $3 specifies directory containing all the assembly SPRI rules
# $4 specifies directory containing all the binary SPRI rules
#
# Output:
# Binary spri file specification for P1 xform
#
echo
"=========================================="
echo
"Running p1xform.pbed.sh"
echo
"=========================================="
P1DIR
=
$1
# top-level P1 xform directory
FNS
=
$2
# file containing name of functions to evaluate
CONCOLIC
=
$3
# directory with inputs
ASPRI
=
$4
# directory with assembly SPRI rules
BSPRI
=
$5
# directory with binary SPRI rules
P1_GOOD_FILE
=
$P1DIR
/a.ncexe.p1.final
touch
$P1_GOOD_FILE
while
read
fn
;
do
DIVERGE
=
"no"
BSPRI_GOOD
=
"
$P1DIR
/
$BSPRI
/a.ncexe.xform.p1.
$fn
.bspri"
for
i
in
`
ls
$CONCOLIC
/input
*
.json
`
do
echo
"Doing BED on function
$fn
"
input
=
`
basename
$i
.json
`
echo
"p1xform.pbed.sh: cmd: STRATA_SPRI_FILE=
$BSPRI_GOOD
$GRACE_HOME
/concolic/bin/replayer --symbols=a.sym --stdout=stdout.
$input
.
$fn
--stderr=stderr.
$input
.
$fn
--engine=sdt ./a.stratafied
$i
"
STRATA_SPRI_FILE
=
"
$BSPRI_GOOD
"
$GRACE_HOME
/concolic/bin/replayer
--symbols
=
a.sym
--stdout
=
stdout.
$input
.
$fn
--stderr
=
stderr.
$input
.
$fn
--engine
=
sdt ./a.stratafied
$i
# if the output differs, stop right away, move to next function
if
[
!
-z
replay.baseline/stdout.
$input
]
;
then
echo
"Diffing stdout.
$input
.
$fn
vs. replay.baseline/stdout.
$input
"
diff stdout.
$input
.
$fn
replay.baseline/stdout.
$input
if
[
!
$?
-eq
0
]
;
then
echo
"BED: divergence detected for fn:
$fn
on input
$i
"
echo
"Baseline file:"
cat
replay.baseline/stdout.
$input
echo
"Output stdout:
$input
.
$fn
:"
cat
stdout.
$input
.
$fn
rm
stdout.
$input
.
$fn
2>/dev/null
rm
stderr.
$input
.
$fn
2>/dev/null
DIVERGE
=
"yes"
break
fi
fi
done
# remove tmp files
rm
stdout.
$input
.
$fn
2>/dev/null
rm
stderr.
$input
.
$fn
2>/dev/null
if
[
"
$DIVERGE
"
=
"no"
]
;
then
echo
$fn
>>
$P1_GOOD_FILE
fi
done
<
$FNS
This diff is collapsed.
Click to expand it.
tools/p1xform.pbed.sh
0 → 100755
+
68
−
0
View file @
7eeee774
#!/bin/sh
#
# $1 is a file containing list of functions to test
# $2 specifies directory with the inputs found by GrACE
# $3 specifies directory containing all the assembly SPRI rules
# $4 specifies directory containing all the binary SPRI rules
#
# Output:
# Binary spri file specification for P1 xform
#
echo
"=========================================="
echo
"Running p1xform.pbed.sh"
echo
"=========================================="
P1DIR
=
$1
# top-level P1 xform directory
FNS
=
$2
# file containing name of functions to evaluate
CONCOLIC
=
$3
# directory with inputs
ASPRI
=
$4
# directory with assembly SPRI rules
BSPRI
=
$5
# directory with binary SPRI rules
P1_GOOD_FILE
=
$P1DIR
/a.ncexe.p1.final
touch
$P1_GOOD_FILE
while
read
fn
;
do
DIVERGE
=
"no"
BSPRI_GOOD
=
"
$P1DIR
/
$BSPRI
/a.ncexe.xform.p1.
$fn
.bspri"
for
i
in
`
ls
$CONCOLIC
/input
*
.json
`
do
echo
"Doing BED on function
$fn
"
input
=
`
basename
$i
.json
`
echo
"p1xform.pbed.sh: cmd: STRATA_SPRI_FILE=
$BSPRI_GOOD
$GRACE_HOME
/concolic/bin/replayer --symbols=a.sym --stdout=stdout.
$input
.
$fn
--stderr=stderr.
$input
.
$fn
--engine=sdt ./a.stratafied
$i
"
STRATA_SPRI_FILE
=
"
$BSPRI_GOOD
"
$GRACE_HOME
/concolic/bin/replayer
--symbols
=
a.sym
--stdout
=
stdout.
$input
.
$fn
--stderr
=
stderr.
$input
.
$fn
--engine
=
sdt ./a.stratafied
$i
# if the output differs, stop right away, move to next function
if
[
!
-z
replay.baseline/stdout.
$input
]
;
then
echo
"Diffing stdout.
$input
.
$fn
vs. replay.baseline/stdout.
$input
"
diff stdout.
$input
.
$fn
replay.baseline/stdout.
$input
if
[
!
$?
-eq
0
]
;
then
echo
"BED: divergence detected for fn:
$fn
on input
$i
"
echo
"Baseline file:"
cat
replay.baseline/stdout.
$input
echo
"Output stdout:
$input
.
$fn
:"
cat
stdout.
$input
.
$fn
rm
stdout.
$input
.
$fn
2>/dev/null
rm
stderr.
$input
.
$fn
2>/dev/null
DIVERGE
=
"yes"
break
fi
fi
done
# remove tmp files
rm
stdout.
$input
.
$fn
2>/dev/null
rm
stderr.
$input
.
$fn
2>/dev/null
if
[
"
$DIVERGE
"
=
"no"
]
;
then
echo
$fn
>>
$P1_GOOD_FILE
fi
done
<
$FNS
This diff is collapsed.
Click to expand it.
tools/p1xform.sh
+
29
−
24
View file @
7eeee774
...
...
@@ -10,22 +10,24 @@
# produce good asm SPRI rules for candidate functions
$STRATA_REWRITE
/tools/transforms/p1transform a.ncexe a.ncexe.annot
P1_DIR
=
p1.xform
ASPRI
=
aspri
BSPRI
=
bspri
#
# Create binary SPRI files for bad transformation
# Split out into own scripts
# Create binary SPRI files for good & bad transformation
#
cd
p1.xform
mkdir
bspri
mkdir
aspri
for
i
in
`
ls
*
p1
*
bad
*
.aspri
`
cd
$P1_DIR
mkdir
$BSPRI
mkdir
$ASPRI
for
i
in
`
ls
*
p1
*
.aspri
`
do
base
=
`
basename
$i
.aspri
`
$STRATA_REWRITE
/tools/spasm/spasm
$i
bspri/
"
$base
"
.bspri
mv
$i
aspri
done
# Also move the good aspri files
mv
*
.aspri aspri
cd
-
echo
Current
dir
:
...
...
@@ -43,23 +45,28 @@ do
$GRACE_HOME
/concolic/bin/replayer
--stdout
=
replay.baseline/stdout.
$input
--stderr
=
replay.baseline/stderr.
$input
--engine
=
ptrace ./a.ncexe
$i
done
P1_DIR
=
p1.xform
# remove any candidate functions not covered
CANDIDATE_FNS
=
$P1_DIR
/a.ncexe.p1.candidates
FILTERED_OUT
=
$P1_DIR
/a.ncexe.p1.filteredout
touch
$FILTERED_OUT
KEEPS
=
$P1_DIR
/a.ncexe.p1.keep
touch
$KEEPS
while
read
fn
;
do
DIVERGE
=
"no"
echo
"Evaluating candidate fn:
$fn
"
BSPRI_BAD
=
$P1_DIR
/bspri/a.ncexe.xform.p1.bad.
$fn
.bspri
BSPRI_BAD
=
"
$P1_DIR
/bspri/a.ncexe.xform.p1.bad.
$fn
.bspri"
echo
"BSPRI_BAD=
$BSPRI_BAD
"
for
i
in
`
ls
$CONCOLIC
/input
*
.json
`
do
# run with bad SPRI transform to produce output
input
=
`
basename
$i
.json
`
STRATA_SPRI_FILE
=
$BSPRI_BAD
$GRACE_HOME
/concolic/bin/replayer
--symbols
=
a.sym
--stdout
=
stdout.
$input
.
$fn
--stderr
=
stderr.
$input
.
$fn
--engine
=
sdt ./a.stratafied
$i
echo
"cmd: STRATA_SPRI_FILE=
$BSPRI_BAD
$GRACE_HOME
/concolic/bin/replayer --symbols=a.sym --stdout=stdout.
$input
.
$fn
--stderr=stderr.
$input
.
$fn
--engine=sdt ./a.stratafied
$i
"
STRATA_SPRI_FILE
=
"
$BSPRI_BAD
"
$GRACE_HOME
/concolic/bin/replayer
--symbols
=
a.sym
--stdout
=
stdout.
$input
.
$fn
--stderr
=
stderr.
$input
.
$fn
--engine
=
sdt ./a.stratafied
$i
# if the output differs, stop right away, move to next function
if
[
!
-z
replay.baseline/stdout.
$input
]
;
...
...
@@ -68,13 +75,7 @@ do
diff stdout.
$input
.
$fn
replay.baseline/stdout.
$input
if
[
!
$?
-eq
0
]
;
then
echo
"Evaluating candidate fn:
$fn
BED detected divergence -- good"
echo
"original"
cat
replay.baseline/stdout.
$input
echo
"bad"
cat
stdout.
$input
.
$fn
rm
stdout.
$input
.
$fn
rm
stdout.
$input
.
$fn
2>/dev/null
rm
stderr.
$input
.
$fn
2>/dev/null
DIVERGE
=
"yes"
...
...
@@ -93,16 +94,20 @@ do
# fi
# fi
rm
stdout.
$input
.
$fn
rm
stderr.
$input
.
$fn
rm
stdout.
$input
.
$fn
2>/dev/null
rm
stderr.
$input
.
$fn
2>/dev/null
done
if
[
"
$DIVERGE
"
=
=
"no"
]
;
then
if
[
"
$DIVERGE
"
=
"no"
]
;
then
echo
"Evaluating candidate fn:
$fn
BED detected no divergence -- remove fn from candidate set"
echo
$fn
>>
$FILTERED_OUT
rm
p1.xform/aspri/a.ncexe.xform.p1.
$fn
.aspri
rm
p1.xform/aspri/a.ncexe.xform.p1.bad.
$fn
.aspri
else
echo
$fn
>>
$KEEPS
fi
done
<
$CANDIDATE_FNS
$PEASOUP_HOME
/tools/p1xform.pbed.sh
$P1_DIR
$CANDIDATE_FNS
$CONCOLIC
$ASPRI
$BSPRI
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment