Refactor sanitizers env preparation & crashes monitor
Sanitizers initialization has been separated from the sancov file under a separate
sanitizers module. This aims to isolate the generic sanitizers environment
preparation from the coverage data parsing.
An additional enable sanitizers flag has been added to input option so that users
can enable the environment preparation and monitor routines only when required.
The logic around SIGABRT monitoring has been proved more complex than
originally expected under the Android platform. As such expose an extra input
argument to control whether it needs to be monitored in a sanitizer enabled or not
target.
Signed-off-by: Anestis Bechtsoudis <anestis@census-labs.com>
diff --git a/subproc.c b/subproc.c
index 057b185..859bc9f 100644
--- a/subproc.c
+++ b/subproc.c
@@ -181,8 +181,8 @@
if (hfuzz->clearEnv) {
environ = NULL;
}
- if (sancov_prepareExecve(hfuzz) == false) {
- LOG_E("sancov_prepareExecve() failed");
+ if (sanitizers_prepareExecve(hfuzz) == false) {
+ LOG_E("sanitizers_prepareExecve() failed");
return false;
}
for (size_t i = 0; i < ARRAYSIZE(hfuzz->envs) && hfuzz->envs[i]; i++) {