Skip to content

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

Description

@thealberto

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 <stddef.h>
#include <stdint.h>
#include "fuzztest/fuzztest.h"
#include "gtest/gtest.h"

#include <woff2/decode.h>

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<unsigned char *>': => Type not supported yet. Consider filing an issue.
   60 |   static_assert(always_false<T>,
      |                 ^~~~~~~~~~~~~~~
external/com_google_fuzztest/./fuzztest/domain_core.h:398:10: note: in instantiation of template class 'fuzztest::internal::ArbitraryImpl<unsigned char *>' requested here
  398 |   return internal::ArbitraryImpl<T>{};
      |          ^
external/com_google_fuzztest/./fuzztest/internal/registration.h:65:20: note: in instantiation of function template specialization 'fuzztest::internal_no_adl::Arbitrary<unsigned char *>' requested here
   65 |     return TupleOf(Arbitrary<Args>()...);
      |                    ^
external/com_google_fuzztest/./fuzztest/internal/registry.h:84:66: note: in instantiation of member function 'fuzztest::internal::DefaultRegistrationBase<unsigned char *, int>::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::DefaultRegistrationBase<unsigned char *, int>, 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::DefaultRegistrationBase<unsigned char *, int>, 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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions