-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minimal reproducible example for Libfuzzer #65
Comments
hi @eddelbuettel I know this is not easily reproducible (without installing libfuzzer,deepstate) but do you have any idea why exit is being called here? libfuzzer does not like that |
Hi Dirk thanks for the quick response, that helped actually. /* Protection against embedded misuse, PR#15420 */
static int num_initialized = 0; This R-devel bug https://bugs.r-project.org/bugzilla/show_bug.cgi?id=15420 did not really help me much to understand what is going on. |
I don't think libfuzzer instantiate R more than once. Libfuzzer is an in-process fuzzer which means fuzzing happens in only one process, for every test case, the process isn't restarted but the input values are changed in the memory. |
That could help. Try to do setup only once, and then just call workloads. You cannot run the <construct,destruct> pair in a loop as R was never built for that; I think some internal may not reset. BTW I think your repo is not complete and the example is not self-contained: |
Thanks for your suggestion. Test Fixtures in deepstate provide SetUp() and TearDown() where we can initialize an object, destruct an object respectively. Here is the complete code:
|
What I meant is whether this file is public or not:
The path you use is not. You could access a file in a package via |
The file is not public. The testharness which I presented is automatically generated by the R code and Yes I make use of system.file to get the path and I write the obtained path to the Testharness.cpp file. For every Rcpp function in the package, the R code generates a Testharness and makes a call to the rcpp function inside the testharness. |
Is there a deeper philosphical reason I am not seeing? Everything else here is open source. |
The R code uses system.file() to get the path to the "rbound" file in the RcppDeepState package and writes it to the Testharness. All the inputs passed to the TestHarness by deepstate are usually stored in binary files(.crash/.fail/.pass files). Reading data from these files is not possible so we created a file(rbound) that stores the inputs provided by RcppDeepState_int(). |
hello @tdhock,
Here is the Testharness, Makefile used to compile the code using libfuzzer.
rcpp_read_out_of_bound_DeepState_TestHarness.cpp :
When we run the makefile :
The code aborts because of an internal call to exit() from the RInside object initialization.
The text was updated successfully, but these errors were encountered: