Skip to content
Closed
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
14 changes: 13 additions & 1 deletion scripts/fuzz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Usage:
relatively verbose stderr is not redirected by -o.
-j n Number of concurrent -jobs=n. Defaults to 1.
The value 0 uses the output of the 'nproc' command.
-d Add debug optimizations and symbols to the build.
Useful for testcase reproduction.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not add these CONFIG_DEBUG* always? Are they slowing anything down?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was my thought that it would reduce the exec/s of the fuzzer. The build already has enough to get a stack trace so I didnt think it needed anymore since the automated tools don't do anything more.


Arguments after -- are passed as is to CMake (through west).
When passing conflicting -DVAR='VAL UE1' -DVAR='VAL UE2' to CMake,
Expand Down Expand Up @@ -85,16 +87,18 @@ main()
local BUILD_ONLY=false
local FUZZER_STDOUT=/dev/stdout # bashism
local TEST_DURATION=3
local DEBUG_BUILD=false

# Parse "$@". getopts stops after '--'
while getopts "hj:po:t:b" opt; do
while getopts "hj:po:t:bd" opt; do
case "$opt" in
h) print_help; exit 0;;
j) if [ "$OPTARG" -eq 0 ]; then JOBS=$(nproc); else JOBS="$OPTARG"; fi;;
p) PRISTINE=true;;
o) FUZZER_STDOUT="$OPTARG";;
t) TEST_DURATION="$OPTARG";;
b) BUILD_ONLY=true;;
d) DEBUG_BUILD=true;;
*) print_help; exit 1;;
esac
done
Expand All @@ -116,6 +120,14 @@ main()
-DCONFIG_ASAN=y
)

local debug_configs=(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's pretty amazing that this does NOT git conflict considering I removed the entire fuzz_configs variable above (and more) in merged commit 577c9ae and replaced it with local conf_files_list=... which looks entirely different! Yet neither git cherry-pick nor git merge seem to bother - wow!

Even if not a git conflict, this is still very much a logical conflict so this PR should not be merged as is right now.

There will likely be another conflict with incoming #9409, so maybe wait for that to be merged too.

-DCONFIG_DEBUG=y
-DCONFIG_DEBUG_OPTIMIZATIONS=y
)

# append debug flags if a debug build
if $DEBUG_BUILD; then fuzz_configs=( "${fuzz_configs[@]}" "${debug_configs[@]}" ); fi
Comment thread
marc-hb marked this conversation as resolved.

# Note there's never any reason to delete fuzz_corpus/.
# Don't trust `west build -p` because it is not 100% unreliable,
# especially not when doing unusual toolchain things.
Expand Down