You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To use -fsanitize=fuzzer, the user has to manually initialize druntime, because a user-specified main is not supported. The user has to supply the following code:
extern (C) int LLVMFuzzerTestOneInput(const(ubyte*) data, size_t size)
{
// D runtime must be initialized, but only once.staticbool init = false;
if (!init)
{
importcore.runtime : rt_init;
rt_init();
init = true;
}
//... do the actual fuzz testing
}
Perhaps we can add functionality to instead let the user write:
extern (C) int LDC_LLVMFuzzerTestOneInput(const(ubyte*) data, size_t size)
{
//... do the actual fuzz testing
}
where LLVMFuzzerTestOneInput initializes druntime and calls LDC_LLVMFuzzerTestOneInput.
Another option is to extend libFuzzer functionality or make use of what's already there: https://llvm.org/docs/LibFuzzer.html#startup-initialization
The text was updated successfully, but these errors were encountered:
To use
-fsanitize=fuzzer
, the user has to manually initialize druntime, because a user-specifiedmain
is not supported. The user has to supply the following code:Perhaps we can add functionality to instead let the user write:
where
LLVMFuzzerTestOneInput
initializes druntime and callsLDC_LLVMFuzzerTestOneInput
.Another option is to extend libFuzzer functionality or make use of what's already there: https://llvm.org/docs/LibFuzzer.html#startup-initialization
The text was updated successfully, but these errors were encountered: