Skip to content

Conversation

catenacyber
Copy link
Contributor

Fixes #6268

Replaces #6449

Introduces lvm-cov-rel, a tool to convert profraw files from version 5 and 7/clang-13 to version 7/clang-14

cc @jonathanmetzman @inferno-chromium
Tested with

python3 infra/helper.py build_image --no-pull base-builder
python3 infra/helper.py build_image --no-pull base-builder-rust
python3 infra/helper.py build_image --no-pull base-runner
export PROJECT=suricata
python3 infra/helper.py build_image --no-pull $PROJECT
python3 infra/helper.py build_fuzzers --sanitizer coverage $PROJECT
python3 infra/helper.py coverage --no-corpus-download $PROJECT

with projects suricata, image-rs and swift-nio

Copy link
Contributor

Choose a reason for hiding this comment

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

This is pretty hacky to me. Why can't you just do the latter when using rust or swift?
Or would doing the latter for every language work.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please begin with capital and end with period.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, or we can do it in every case, as it leaves clang-14 profraw files identical

Copy link
Contributor

@jonathanmetzman jonathanmetzman 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 this. This is better than #6449 but I think could still be improved.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please begin with capital and end with period.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, done

Copy link
Contributor

Choose a reason for hiding this comment

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

In the future I would prefer code for OSS-Fuzz be written in python.
I still need to figure out how to remove the go toolchain from the runner image because we didn't stick to this policy. All of the other code in OSS-Fuzz is python or bash (also an unfortunate choice), lets try to do python only from now on.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, do you want me to rewrite this in python ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Not necessary for this PR, but in future, I'd prefer it if we had as little go code as possible yes.

Copy link
Contributor

Choose a reason for hiding this comment

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

This PR LGTM, but if it won't take to long, could you please convert this script to Python?
Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

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

Please begin with capital and end with period.

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

Choose a reason for hiding this comment

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

Please begin with capital and end with period.

Copy link
Contributor

Choose a reason for hiding this comment

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

Why not delete 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.

This comment explains the addition afterwards

Copy link
Contributor

Choose a reason for hiding this comment

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

Please begin with capital and end with period.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

Copy link
Contributor

Choose a reason for hiding this comment

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

Please begin with capital and end with period.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

Copy link
Contributor

Choose a reason for hiding this comment

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

Please begin with capital and end with period.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

Copy link
Contributor

Choose a reason for hiding this comment

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

Please begin with capital and end with period.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

Cf google#6268

Latest clang-14 and clang-13 used by rust or swift have a slightly
different profraw file format

llvm-cov-rel is tool that will update the profraw file produced
by clang-13 to one readable by clang-14 llvm-cov tools
So that projects not using default fuzz_targets subdir
get the good remap, and hence the good coverage report
@catenacyber
Copy link
Contributor Author

@jonathanmetzman I pushed a new version with the right syntax for comments

Copy link
Contributor

@jonathanmetzman jonathanmetzman left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

Choose a reason for hiding this comment

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

This PR LGTM, but if it won't take to long, could you please convert this script to Python?
Thanks!

@jonathanmetzman jonathanmetzman merged commit 5c386a4 into google:master Sep 27, 2021
@catenacyber
Copy link
Contributor Author

Looks like base-runner dit not get updated yet so today's coverage builds still fail

I will wait to see how it goes before trying python

@catenacyber
Copy link
Contributor Author

Still no updated version of base-runner ...
Is something going wrong ?

@catenacyber
Copy link
Contributor Author

ping @jonathanmetzman why do the docker images not updated ?
When I run python infra/helper.py pull_images I always get

latest: Pulling from oss-fuzz-base/base-runner
Digest: sha256:41c2805f5f035993f7582796ed954b7acd9c14873a9d73860cd542cdeba1c1c6

@catenacyber
Copy link
Contributor Author

Getting some fixes :-)
All swift projects, and C++ projects with rust are ok

But none of the pure rust projects are working yet... because of a new change in LLVM 14 cf #6551

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.

Support for LLVM 13 fuzzing

2 participants