Comments (7)
from fuzztest.
Hello Markus,
thanks for the quick reply. That is utterly stupid of me. I did not even think about c not having strings and was just all the time wondering what was going on and what I did wrong.
I run the following commands:
CC=clang-16 CXX=clang++-16 cmake -DCMAKE_BUILD_TYPE=RelWithDebug -DFUZZTEST_FUZZING_MODE=on ..
cmake --build .
Does that mean I can not test c programms with fuzztest out of the box?
Best wishes,
marvi3
from fuzztest.
from fuzztest.
As Markus suggested, put your fuzz tests in a C++ file. Include your C header file with C language linkage:
extern "C" {
#include "my/c/header.h"
}
// Call your C functions from fuzz tests.
Then you should be good!
from fuzztest.
Thank you a lot for your reply and help.
I have tried to get it working with what you have provided but I am still failing.
I have tried both, to include my c program with the extern keyword and just changing the *.c to a *.cc ending and then adding the cpp code of fuzztest. However I had no success with this.
By the way I think I forgot to tell which SUT I want to build with FuzzTest:
It is mjs, a javascript interpreter.
I am getting a lot of error code that I do not get when building the program originally. Some errors seem to be connected with makros that try to get expanded:
./mjs.c:1650:3: error: expected identifier
LL_NONE = -1,
^
/usr/include/elf.h:2056:20: note: expanded from macro 'LL_NONE'
#define LL_NONE 0
^
In file included from /home/kali/SUT/mjsFuzzTest/mjs_fuzz/fuzztest.cc:4:
./mjs.c:3847:19: error: cannot initialize a variable of type 'enum cs_log_level' with an rvalue of type 'int'
enum cs_log_level cs_log_cur_msg_level WEAK = LL_NONE;
But even when I have fixed them I get this error that I can't seem to fix without breaking other things:
In file included from /home/kali/SUT/mjsFuzzTest/mjs_fuzz/fuzztest.cc:1:
In file included from /home/kali/SUT/mjsFuzzTest/fuzztest/fuzztest/fuzztest.h:23:
In file included from /home/kali/SUT/mjsFuzzTest/fuzztest/./fuzztest/domain.h:18:
In file included from /home/kali/SUT/mjsFuzzTest/fuzztest/./fuzztest/domain_core.h:47:
/home/kali/SUT/mjsFuzzTest/fuzztest/./fuzztest/internal/domains/arbitrary_impl.h:63:3: error: static assertion failed
due to requirement 'foobar<char *>::value': => Type not supported yet. Consider filing an issue.
static_assert(foobar<T>::value,
^ ~~~~~~~~~~~~~~~~
This assertion fail also does not happen when I build the program on it's own.
from fuzztest.
When I fix all other problems I am left with an error:
fuzztest/./fuzztest/internal/domains/arbitrary_impl.h:63:3: error: static assertion failed due to requirement 'foobar<char *>::value': => Type not supported yet. Consider filing an issue.
static_assert(foobar<T>::value,
So I simply commented this assertion out and then it throws the following error. So it seems like there is a problem with the value_type. I looked a bit in issues and found issue #176 where it is talked about no longer explicitly defining value_type and the change removed the value_type from InRegexImpl::DomainBase.
Could the problem I am facing be related to this ?
fuzztest/./fuzztest/internal/type_support.h:42:1: error: no type named 'value_type' in 'fuzztest::internal::ArbitraryImpl<char *>' using value_type_t = typename Domain::value_type;
I am sorry to bother you guys with my problems but I really do not know how to continue anymore.
from fuzztest.
Looks like you're trying to instantiate fuzztest::Arbitrary<T>()
with a type T
that's not supported (which is what the static assert says).
Can you paste the fuzz test somewhere and share a link?
from fuzztest.
Related Issues (20)
- libfuzzer compatibility mode spams `Unexpected file format` without making any progress (СMake)
- Target based fuzztest_setup_fuzzing_flags
- Cannot test a pointer type HOT 1
- How can I generate a profraw file based on the output of my custom fuzzer? HOT 6
- Fuzz mode as documented in https://github.com/google/fuzztest/blob/main/doc/quickstart-cmake.md doesn't work HOT 1
- how to use fuzztest on Android(aarch64)
- FUZZ_TEST_F Should Respect GTEST_SKIP() in GoogleTest Base Fixture
- support for timeout HOT 5
- how FUZZ_TEST enable multithreading
- Latest commits have issues with absl/strings:string_view HOT 3
- DFUZZTEST_COMPATIBILITY_MODE=libfuzzer failing on linking HOT 1
- MBErr: Builder group name "chromium.fuzz" not found in "/opt/chromium/src/tools/mb/mb_config.pyl" HOT 2
- cc_fuzztest_grammar_library bazel macro cannot be used outside of com_google_fuzztest repo
- Backslashes are wrongly escaped in grammar_codegen
- Byte Array Mutator failed on empty input HOT 1
- error: static assertion failed due to requirement 'always_false<unsigned char *>': => Type not supported yet HOT 2
- How can I build and run the vp8_encoder_fuzz_test
- Add bzlmod support for Bazel HOT 2
- How to add a new fuzzer for libvpx HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fuzztest.