afl: add define to disable mgt threads

The inherent non-deterministic nature of the management threads
creates variable test cases.
pull/2002/merge
Victor Julien 11 years ago
parent b2695600ba
commit a42251d459

@ -221,6 +221,10 @@ static ConfNode *GetConfig(void) {
static void StatsInitCtx(void) static void StatsInitCtx(void)
{ {
SCEnter(); SCEnter();
#ifdef AFLFUZZ_DISABLE_MGTTHREADS
stats_enabled = FALSE;
SCReturn;
#endif
ConfNode *stats = GetConfig(); ConfNode *stats = GetConfig();
if (stats != NULL) { if (stats != NULL) {
const char *enabled = ConfNodeLookupChildValue(stats, "enabled"); const char *enabled = ConfNodeLookupChildValue(stats, "enabled");

@ -105,6 +105,9 @@ typedef struct FlowTimeoutCounters_ {
*/ */
void FlowDisableFlowManagerThread(void) void FlowDisableFlowManagerThread(void)
{ {
#ifdef AFLFUZZ_DISABLE_MGTTHREADS
return;
#endif
ThreadVars *tv = NULL; ThreadVars *tv = NULL;
int cnt = 0; int cnt = 0;
@ -708,6 +711,9 @@ static uint64_t FlowGetMemuse(void)
/** \brief spawn the flow manager thread */ /** \brief spawn the flow manager thread */
void FlowManagerThreadSpawn() void FlowManagerThreadSpawn()
{ {
#ifdef AFLFUZZ_DISABLE_MGTTHREADS
return;
#endif
intmax_t setting = 1; intmax_t setting = 1;
(void)ConfGetInt("flow.managers", &setting); (void)ConfGetInt("flow.managers", &setting);
@ -868,6 +874,9 @@ int FlowRecyclerReadyToShutdown(void)
/** \brief spawn the flow recycler thread */ /** \brief spawn the flow recycler thread */
void FlowRecyclerThreadSpawn() void FlowRecyclerThreadSpawn()
{ {
#ifdef AFLFUZZ_DISABLE_MGTTHREADS
return;
#endif
intmax_t setting = 1; intmax_t setting = 1;
(void)ConfGetInt("flow.recyclers", &setting); (void)ConfGetInt("flow.recyclers", &setting);
@ -917,6 +926,9 @@ void FlowRecyclerThreadSpawn()
*/ */
void FlowDisableFlowRecyclerThread(void) void FlowDisableFlowRecyclerThread(void)
{ {
#ifdef AFLFUZZ_DISABLE_MGTTHREADS
return;
#endif
ThreadVars *tv = NULL; ThreadVars *tv = NULL;
int cnt = 0; int cnt = 0;

@ -229,6 +229,7 @@
#endif #endif
#define AFLFUZZ_NO_RANDOM 1 #define AFLFUZZ_NO_RANDOM 1
#define AFLFUZZ_DISABLE_MGTTHREADS 1
/* we need this to stringify the defines which are supplied at compiletime see: /* we need this to stringify the defines which are supplied at compiletime see:
http://gcc.gnu.org/onlinedocs/gcc-3.4.1/cpp/Stringification.html#Stringification */ http://gcc.gnu.org/onlinedocs/gcc-3.4.1/cpp/Stringification.html#Stringification */

Loading…
Cancel
Save