google / google/fuzztest

error: static assertion failed due to requirement 'always_false<unsigned char *>': => Type not supported yet

Open
#929 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
1.1k
Forks
137
Avg merge
3d 6h
Merged PRs (30d)
22

Description

Hi all,
I'm trying to port the example `woff2` fuzzer to `bazel`. I have prepared the project so I can run simple tests but when I try to mimic the original `LibFuzzer` entry point I get an error.

This is the code

```
#include
#include
#include "fuzztest/fuzztest.h"
#include "gtest/gtest.h"

#include

void ConvertWOFF2ToTTF(uint8_t* data, int size) {
}
FUZZ_TEST(AlbertoFuzzTest, ConvertWOFF2ToTTF);

// Entry point for LibFuzzer.
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
std::string buf;
woff2::WOFF2StringOut out(&buf);
out.SetMaxSize(30 * 1024 * 1024);
woff2::ConvertWOFF2ToTTF(data, size, &out);
return 0;
}
```

This is the output when I run `bazel run --config=fuzztest --copt=-I./include :alberto -- --fuzz=AlbertoFuzzTest.ConvertWOFF2ToTTF`

```
In file included from external/com_google_fuzztest/fuzztest/fuzztest.h:24:
In file included from external/com_google_fuzztest/./fuzztest/domain.h:18:
In file included from external/com_google_fuzztest/./fuzztest/domain_core.h:48:
external/com_google_fuzztest/./fuzztest/internal/domains/arbitrary_impl.h:60:17: error: static assertion failed due to requirement 'always_false': => Type not supported yet. Consider filing an issue.
60 | static_assert(always_false,
| ^~~~~~~~~~~~~~~
external/com_google_fuzztest/./fuzztest/domain_core.h:398:10: note: in instantiation of template class 'fuzztest::internal::ArbitraryImpl' requested here
398 | return internal::ArbitraryImpl{};
| ^
external/com_google_fuzztest/./fuzztest/internal/registration.h:65:20: note: in instantiation of function template specialization 'fuzztest::internal_no_adl::Arbitrary' requested here
65 | return TupleOf(Arbitrary()...);
| ^
external/com_google_fuzztest/./fuzztest/internal/registry.h:84:66: note: in instantiation of member function 'fuzztest::internal::DefaultRegistrationBase::GetDomains' requested here
84 | return [target_function = reg.target_function_, domain = reg.GetDomains(),
| ^
external/com_google_fuzztest/./fuzztest/internal/registry.h:65:18: note: in instantiation of function template specialization 'fuzztest::internal::RegistrationToken::GetFuzzTestFuzzerFactory, fuzztest::internal::NoFixture, void (*)(unsigned char *, int), void *>' requested here
65 | GetFuzzTestFuzzerFactory(std::move(reg)));
| ^
src/alberto.cc:11:1: note: in instantiation of function template specialization 'fuzztest::internal::RegistrationToken::operator=, fuzztest::internal::NoFixture, void (*)(unsigned char *, int), void *>' requested here
11 | FUZZ_TEST(AlbertoFuzzTest, ConvertWOFF2ToTTF);
| ^
external/com_google_fuzztest/fuzztest/fuzztest.h:66:37: note: expanded from macro 'FUZZ_TEST'
66 | #define FUZZ_TEST(suite_name, func) INTERNAL_FUZZ_TEST(suite_name, func)
| ^
external/com_google_fuzztest/./fuzztest/internal/registry.h:107:53: note: expanded from macro 'INTERNAL_FUZZ_TEST'
107 | ::fuzztest::internal::RegistrationToken{} = \
| ^
1 error generated.
Target //:alberto failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 7.115s, Critical Path: 6.92s
INFO: 66 processes: 26 internal, 40 linux-sandbox.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target
➜ woff2 git:(ccbeb246d2)
```

Which type should I use instead? Any other way to fix it?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.