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

oss-fuzz/build.sh: move flags to 'set' from #! #2037

Merged
merged 3 commits into from
Feb 23, 2024

Conversation

jzern
Copy link
Collaborator

@jzern jzern commented Feb 23, 2024

The set command is preferred over flags in the shebang because they
won't be used if the script is invoked with bash as is done in the
build_fuzzers command 1.

The set command is preferred over flags in the shebang because they
won't be used if the script is invoked with bash as is done in the
build_fuzzers command [1].

[1]: https://google.github.io/oss-fuzz/advanced-topics/reproducing/#reproducing-bugs
@jzern jzern requested review from wantehchang, y-guyon and vrabaud and removed request for y-guyon February 23, 2024 18:09
@jzern
Copy link
Collaborator Author

jzern commented Feb 23, 2024

This brings out some other issues with the script and its interaction with the build_fuzzers command. I missed them because there's link errors with --sanitizer undefined which prompted this. --sanitizer address proceeds further, but fails with:

Fuzz binaries: ./tests/avif_fuzztest_dec
./tests/avif_fuzztest_dec_incr
./tests/avif_fuzztest_enc_dec
./tests/avif_fuzztest_enc_dec_anim
./tests/avif_fuzztest_enc_dec_incr
./tests/avif_fuzztest_read_image
./tests/avif_fuzztest_yuvrgb
WARNING: TEST_DATA_DIRS env variable not set, unable to read seed files
WARNING: TEST_DATA_DIRS env variable not set, unable to read seed files
WARNING: TEST_DATA_DIRS env variable not set, unable to read seed files
mkdir: cannot create directory '/out/corpus': File exists
ERROR:__main__:Building fuzzers failed.

@jzern
Copy link
Collaborator Author

jzern commented Feb 23, 2024

This brings out some other issues with the script and its interaction with the build_fuzzers command. I missed them because there's link errors with --sanitizer undefined which prompted this. --sanitizer address proceeds further, but fails with:

Fuzz binaries: ./tests/avif_fuzztest_dec
./tests/avif_fuzztest_dec_incr
./tests/avif_fuzztest_enc_dec
./tests/avif_fuzztest_enc_dec_anim
./tests/avif_fuzztest_enc_dec_incr
./tests/avif_fuzztest_read_image
./tests/avif_fuzztest_yuvrgb
WARNING: TEST_DATA_DIRS env variable not set, unable to read seed files
WARNING: TEST_DATA_DIRS env variable not set, unable to read seed files
WARNING: TEST_DATA_DIRS env variable not set, unable to read seed files
mkdir: cannot create directory '/out/corpus': File exists
ERROR:__main__:Building fuzzers failed.

I had a dirty build directory, though for convenience -p could be used.

The real issue is with cp:

...
cp: -r not specified; omitting directory '/src/libavif/tests/data/goldens'
cp: -r not specified; omitting directory '/src/libavif/tests/data/io'
cp: -r not specified; omitting directory '/src/libavif/tests/data/sources'

A zip file can be added to. So instead of copying the test data add it
directly. This avoids using cp as there are subdirectories in the
tests/data folder which cause failures when not using -r.
The tests expect the corpus to be available in this directory.
@jzern jzern merged commit a44270e into AOMediaCodec:main Feb 23, 2024
20 checks passed
@jzern jzern deleted the fix-bash-flags branch February 23, 2024 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants