diff options
| author | Nguyễn Gia Phong <cnx@loang.net> | 2025-10-24 12:54:34 +0900 |
|---|---|---|
| committer | Nguyễn Gia Phong <cnx@loang.net> | 2025-10-24 12:54:34 +0900 |
| commit | e65900a9f42cbbfa4f06e5a76505dcfb402b17b6 (patch) | |
| tree | 185e09ccc171eeffc6de1c114bb804349db7247c | |
| parent | 00e6c689330c317dfc3db9b6465a8b3445e29e3b (diff) | |
| download | taosc-e65900a9f42cbbfa4f06e5a76505dcfb402b17b6.tar.gz | |
Split collected values 0.0.3
| -rw-r--r-- | fix.m4 | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/fix.m4 b/fix.m4 index d896a5c..356db4a 100644 --- a/fix.m4 +++ b/fix.m4 @@ -111,16 +111,40 @@ rm -fr "$wd/input" mkdir -p "$wd/input/benign" cp -r "$poc" "$wd/input/malicious" find "$wd/fuzzolic" -name 'test_case_*.dat' -print0 | - xargs -I '{}' -0 -P$(nproc) -n1 \ - taosc-sort-inputs $timeout "$wd"/input/{malicious,benign} '{}' \ + xargs -P$(nproc) -0 -n1 -I @@ \ + taosc-sort-inputs $timeout "$wd"/input/{malicious,benign} @@ \ "$bin.covered" $args rm -fr "$wd/values" -mkdir -p "$wd"/values/{benign,malicious} -find "$wd/input" -print0 | - xargs -I '{}' -0 -P$(nproc) -n1 \ - taosc-collect-values $timeout $stack_size "$wd/values" '{}' \ +mkdir -p "$wd"/values/{benign,bottom,malicious,top} +find "$wd/input" -type f -print0 | + xargs -I @@ -0 -P$(nproc) -n1 \ + taosc-collect-values $timeout $stack_size "$wd/values" @@ \ "$bin.collect" $args -# TODO: split if the patch location is reached multiple times with an input -taosc-synth $stack_size "$wd"/values/{benign,malicious} > "$wd/predicates" +find "$wd/values" -type f -print0 | xargs -P$(nproc) -0 -n1 -I @@ mkdir @@.d +find "$wd/values" -maxdepth 2 -type f -print0 | + xargs -P$(nproc) -0 -n1 -I @@ \ + split -b $((stack_size + 16*8)) @@{,.d/} +find "$wd/values/benign" -mindepth 1 -type d -name '*.d' | + while read d + do + find "$d" -type f -printf '%f\0' | + xargs -P$(nproc) -0 -n1 -I @@ \ + mv "$d/@@" "$wd/values/bottom/$(basename "$d" .d).@@" + done +find "$wd/values/malicious" -mindepth 1 -type d -name '*.d' | + while read d + do + find "$d" -type f -printf '%f\0' | + sort -z | + head -n -1 -z | # all but last + xargs -P$(nproc) -0 -n1 -I @@ \ + mv "$d/@@" "$wd/values/bottom/$(basename "$d" .d).@@" + find "$d" -type f -printf '%f\0' | + sort -z | + tail -n 1 -z | # last + xargs -0 -n1 -I @@ \ + mv "$d/@@" "$wd/values/top/$(basename "$d" .d).@@" + done +taosc-synth $stack_size "$wd"/values/{bottom,top} > "$wd/predicates" # vim: filetype=sh.m4 |
