Skip to content
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

tools/syz-reproducers.sh: use new archive structure #5504

Merged
merged 2 commits into from
Nov 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions tools/syz-reproducers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# Copyright 2024 syzkaller project authors. All rights reserved.
# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.

# This tool uses syz-db-export artifacts.
# See https://github.com/google/syzkaller/tree/master/tools/syz-db-export documentation.

# Check if the target directory is provided as a command line argument.
if [ -z "$1" ]; then
echo "Usage: $0 <target_directory>"
Expand All @@ -23,7 +26,7 @@ tar -xzf "$target_dir/upstream.tar.gz" -C "$target_dir" && rm "$target_dir/upstr
mkdir -p "$target_dir/bin"

# Compile the programs and count the successfully built ones.
built_count=$(find "$target_dir/repros" -name "*.c" -print0 | \
built_count=$(find "$target_dir/export/bugs" -name "*.c" -print0 | \
tarasmadan marked this conversation as resolved.
Show resolved Hide resolved
xargs -0 -P 128 -I {} sh -c '
filename=$(basename {} .c)
flags=""
Expand All @@ -38,7 +41,7 @@ built_count=$(find "$target_dir/repros" -name "*.c" -print0 | \
' | grep "1" | wc -l)

# Count the number of .c files (reproducers).
reproducer_count=$(find "$target_dir/repros" -name "*.c" -print0 | xargs -0 -n1 echo | wc -l)
reproducer_count=$(find "$target_dir/export/bugs" -name "*.c" -print0 | xargs -0 -n1 echo | wc -l)

echo "Downloaded $reproducer_count reproducers."
echo "Successfully built $built_count programs."
Loading