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

Coverage as in https://github.com/google/oss-fuzz/issues/26 #35

Merged
merged 2 commits into from
Oct 14, 2016

Conversation

vitalybuka
Copy link
Contributor

No description provided.

Copy link
Contributor

@mikea mikea left a comment

Choose a reason for hiding this comment

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

Thanks for working on this.

@@ -202,6 +202,12 @@ $ python scripts/helper.py run_fuzzer $LIB_NAME name_of_a_fuzzer
If everything works locally, then it should also work on our automated builders
and ClusterFuzz.

It's recommended look at coverage as a sanity check to make sure that fuzzer gets to the code you expect.
Copy link
Contributor

Choose a reason for hiding this comment

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

recommended to

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

'-w', '/cov',
'-e', 'ASAN_OPTIONS=coverage=1,detect_leaks=0',
'-t', 'ossfuzz/libfuzzer-runner',
'/out/%s/%s' % (args.library_name, args.fuzzer_name),
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm surprised by this additional directory. AFAIK our build scripts do not create second level.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure what do you mean.

pipe = subprocess.Popen(command)
pipe.communicate()

checkout_dir = os.path.join(BUILD_DIR, args.library_name)
Copy link
Contributor

Choose a reason for hiding this comment

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

you don't have to run it in docker. You can run all of it on host => no need to install in the image python.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

maybe it's insecure to run random python script downloaded over http

Copy link
Contributor

Choose a reason for hiding this comment

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

Hm...

Can you try running it within standard image? For example, one of these: https://hub.docker.com/_/python/

Copy link
Contributor

Choose a reason for hiding this comment

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

If not, let's create a special image for server. I am not keen on pulling new packages just for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

It's recommended to look at coverage as a sanity check to make sure that fuzzer gets to the code you expect.

```bash
$ sudo python scripts/helper.py run_with_coverage $LIB_NAME name_of_a_fuzzer seconds_to_run
Copy link
Contributor

Choose a reason for hiding this comment

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

replace run_with_coverage with just coverage?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

@mikea mikea left a comment

Choose a reason for hiding this comment

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

almost there. 2 small changes please.

@@ -19,4 +19,4 @@ docker build --pull -t ossfuzz/base $@ infra/base-images/base
docker build -t ossfuzz/base-clang $@ infra/base-images/base-clang
docker build -t ossfuzz/base-libfuzzer $@ infra/base-images/base-libfuzzer
docker build -t ossfuzz/libfuzzer-runner $@ infra/base-images/libfuzzer-runner

docker build -t ossfuzz/coverage $@ infra/base-images/coverage
Copy link
Contributor

Choose a reason for hiding this comment

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

You will also need to change Jenkinsfile in this folder & Jenkinsfile in ../push-images/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

parser = argparse.ArgumentParser('helper.py coverage')
parser.add_argument('library_name', help='name of the library')
parser.add_argument('fuzzer_name', help='name of the fuzzer')
parser.add_argument('run_time', help='time in seconds to run fuzzer')
Copy link
Contributor

Choose a reason for hiding this comment

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

let's add default (60s?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@vitalybuka vitalybuka merged commit a15a7b5 into google:master Oct 14, 2016
kant added a commit to kant/oss-fuzz that referenced this pull request Apr 2, 2018
inferno-chromium pushed a commit that referenced this pull request Apr 2, 2018
fenner pushed a commit to fenner/oss-fuzz that referenced this pull request Apr 8, 2018
tmatth pushed a commit to tmatth/oss-fuzz that referenced this pull request Oct 22, 2018
DavidKorczynski pushed a commit that referenced this pull request Jul 9, 2024
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.

4 participants