Skip to content
Snippets Groups Projects
Commit cd9525e2 authored by jdh8d's avatar jdh8d
Browse files

Updates to get large-only working, and fixes to cfar.sh and cfar_postgres setup to avoid raciness.

Former-commit-id: c384e5e13a59626e47a6d527f22f073bb4859680
parent 6eb671f0
No related branches found
No related tags found
No related merge requests found
#!/bin/sh
# parse first 3 parameters as fixed position params.
variants=$1
in=$2
out=$3
......@@ -7,28 +9,49 @@ shift
shift
shift
# init some variables.
share_path=/tmp
pids=
# remove any old data xfers.
rm -f $share_path/Barriers*
# pick a random seed for this run.
anyseed=$$
# create a copy of ps_analyze for each variant we want to create.
for seq in $(seq 0 $(expr $variants - 1) )
do
# the path to the "shared memory" that cfar is using.
sharepath_key="$seq:$variants:dir://$share_path "
zipr_env="ZIPR_VARID=$sharepath_key"
# optoins for zipr's large_only plugin to help create non-overlapping code segments.
large_only_options="--step-option zipr:--large_only:on --step-option zipr:true --step-option zipr:--large_only:variant --step-option zipr:$sharepath_key"
# optoins to p1 to create non-overlapping canary values.
p1options=" --step-option p1transform:--canary_value --step-option p1transform:0xFF0${seq}${seq}0FF --step-option p1transform:--random_seed --step-option p1transform:$anyseed "
cmd=" PG_DATABASE=peasoup_`whoami`_$seq $zipr_env $PEASOUP_HOME/tools/ps_analyze.sh $in $out.v$seq $@ $p1options > peasoup.v$seq 2>&1 &"
# invoke $PS.
cmd=" PGDATABASE=peasoup_${USER}_v$seq $zipr_env $PEASOUP_HOME/tools/ps_analyze.sh $in $out.v$seq $@ $p1options $large_only_options > variant_output.$seq 2>&1 &"
echo $cmd
eval $cmd
# remember the pid.
pids="$pids $!"
done
# mark that no one has detected a failure yet.
ok=1
# wait for each child. detect failures.
for i in $pids;
do
wait $i
......@@ -39,6 +62,8 @@ do
fi
done
# report success/failures.
if [ $ok = 1 ] ; then
echo "Successfully generated $variants variants"
exit 0
......@@ -50,4 +75,3 @@ else
echo
exit 1
fi
......@@ -81,6 +81,8 @@ MD5HASH=`$PS_MD5SUM $FILENAME| cut -f1 -d' '`
# -c: run command
echo PGDATABASE is $PGDATABASE
PROGRAM_ID=`psql -q -t -c "INSERT INTO variant_info (schema_version_id,name) VALUES ('2', '$PROGRAM_NAME') RETURNING variant_id;" | sed "s/^[ \t]*//"`
if [ ! $? -eq 0 ]; then
......
......@@ -130,21 +130,16 @@ check_step_option()
set_step_option()
{
step=`echo $1 | sed 's/\(.*\):.*/\1/'`
option=`echo $1 | sed 's/.*:\(.*\)/\1/'`
case "$step" in
*)
#
# this sets step_options_$step to have the new option
# you can now, when writing your step, just add $step_options_<stepname> where you want the options passed to your step.
#
var="step_options_$step"
old_value="${!var}"
eval "step_options_$step='$old_value $option'"
;;
esac
step=`echo $1 | cut -d: -f1`
option=`echo $1 | cut -d: -f2-`
#
# this sets step_options_$step to have the new option
# you can now, when writing your step, just add $step_options_<stepname> where you want the options passed to your step.
#
var="step_options_$step"
old_value="${!var}"
eval "step_options_$step='$old_value $option'"
}
usage()
......@@ -1039,7 +1034,7 @@ perform_step get_pins spasm,fast_spri $PEASOUP_HOME/tools/get_pins.sh
# zipr
perform_step zipr clone,fill_in_indtargs,fill_in_cfg,pdb_register $ZIPR_INSTALL/bin/zipr.exe --variant $cloneid --zipr:callbacks $ZIPR_INSTALL/bin/callbacks.exe --zipr:objcopy $PS_OBJCOPY
perform_step zipr clone,fill_in_indtargs,fill_in_cfg,pdb_register $ZIPR_INSTALL/bin/zipr.exe --variant $cloneid --zipr:callbacks $ZIPR_INSTALL/bin/callbacks.exe --zipr:objcopy $PS_OBJCOPY $step_options_zipr
# copy TOCTOU tool here if it exists
if [[ "$CONCURRENCY_HOME/toctou_tool" != "" && -d "$CONCURRENCY_HOME/toctou_tool" ]]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment