google / google/fuzztest

AssertSoo fails when trying to build with a protobuf library in fuzzing mode

Open
#1,937 0 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

when using fuzzing mode and a proto library, and trying to run it always reports this line:
Assertion failed: ((common.capacity() == policy.soo_capacity()) && "Try enabling sanitizers."), function AssertSoo, file raw_hash_set.cc, line 781.

everything in this cmake was copied from the getting started guide except the protobuf part
```cmake
cmake_minimum_required(VERSION 3.19)
project(first_fuzz_project)

# GoogleTest requires at least C++17
set(CMAKE_CXX_STANDARD 17)

add_subdirectory(fuzztest)

enable_testing()

include(GoogleTest)

find_package(Protobuf)

fuzztest_setup_fuzzing_flags()
fuzztest_proto_library(NAME protolib SRCS test.proto PUBLIC)

add_executable(
first_fuzz_test
first_fuzz_test.cc
)

# If you have other dependencies than FuzzTest, link them:
target_link_libraries(first_fuzz_test PRIVATE fuzztest::protolib)

link_fuzztest(first_fuzz_test)
gtest_discover_tests(first_fuzz_test)
```

platform: macos26
clang version: 20.1.8
libprotoc version: 33.1
cmake version: 4.1.2
on main branch 1c3e6d18bf618bdad3917670bf50b83f215711b4

built using:
cmake \\
-DCMAKE_BUILD_TYPE=RelWithDebug \\
-DFUZZTEST_FUZZING_MODE=on ..
cmake --build . -j 10

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.