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

compile_native_go_fuzzer problem calling functions from another file in same package #2

Closed
hickford opened this issue Jul 25, 2022 · 8 comments

Comments

@hickford
Copy link

hickford commented Jul 25, 2022

My tests call functions from other files in the same package. compile_native_go_fuzzer seems to have a problem with this -- during the "replacing *testing.F" step I see undefined errors:

testonly/tree_fuzz_test.go_fuzz_.go:30:11: undefined: newTree

Example https://github.com/transparency-dev/merkle/runs/7502903729?check_suite_focus=true via transparency-dev/merkle#36

@AdamKorcz
Copy link
Owner

Try doing this in build.sh:

mv testonly/tree_test.go testonly/tree_test_fuzz.go before running compile_native_go_fuzzer.

@hickford
Copy link
Author

hickford commented Jul 25, 2022

Ooh that fixes some of the errors but there's functions from other files such as reference_test.go needed too. Any suggestions?

@AdamKorcz
Copy link
Owner

Ooh that fixes some of the errors but there's functions from other files such as reference_test.go needed too. Any suggestions?

Yeah, you can do the same for all _test.go files.

@hickford
Copy link
Author

I'm confused. Surely the second move command will overwrite the result of the first? Am I missing something?

mv testonly/constants.go        testonly/tree_test_fuzz.go
mv testonly/reference_test.go   testonly/tree_test_fuzz.go
mv testonly/tree_test.go        testonly/tree_test_fuzz.go
mv testonly/tree.go             testonly/tree_test_fuzz.go
compile_native_go_fuzzer github.com/transparency-dev/merkle/testonly FuzzConsistencyProofAndVerify FuzzConsistencyProofAndVerify
compile_native_go_fuzzer github.com/transparency-dev/merkle/testonly FuzzInclusionProofAndVerify FuzzInclusionProofAndVerify
compile_native_go_fuzzer github.com/transparency-dev/merkle/testonly FuzzHashAtAgainstReferenceImplementation FuzzHashAtAgainstReferenceImplementation
compile_native_go_fuzzer github.com/transparency-dev/merkle/testonly FuzzInclusionProofAgainstReferenceImplementation FuzzInclusionProofAgainstReferenceImplementation
compile_native_go_fuzzer github.com/transparency-dev/merkle/testonly FuzzConsistencyProofAgainstReferenceImplementation FuzzConsistencyProofAgainstReferenceImplementation

@hickford
Copy link
Author

hickford commented Aug 3, 2022

I realise this is an issue in the compile_native_go_fuzzer script rather than this library . Shall I create a new issue in oss-fuzz?

@AdamKorcz
Copy link
Owner

I realise this is an issue in the compile_native_go_fuzzer script rather than this library . Shall I create a new issue in oss-fuzz?

Could you elaborate on what the issue is?

@AdamKorcz
Copy link
Owner

I'm confused. Surely the second move command will overwrite the result of the first? Am I missing something?

Sorry I missed this one. You are correct, you should not name all files testonly/tree_test_fuzz.go. It would be:

mv testonly/reference_test.go testonly/reference_test_fuzz.go

@hickford
Copy link
Author

hickford commented Aug 3, 2022

Thanks, that worked. What's going on? Only files with 'fuzz' in the name are copied?

@hickford hickford closed this as completed Aug 3, 2022
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

No branches or pull requests

2 participants