From 5cec22ac37511e9f5e89e3de62bcafe1d705acc9 Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Fri, 4 Nov 2011 09:57:44 +0100 Subject: [PATCH] threads: Add sanity check. --- src/tm-threads.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tm-threads.c b/src/tm-threads.c index f825457a7d..7f294ab7ea 100644 --- a/src/tm-threads.c +++ b/src/tm-threads.c @@ -537,7 +537,11 @@ void *TmThreadsSlotPktAcqLoop(void *td) { TmThreadSetupOptions(tv); /* check if we are setup properly */ - if (s == NULL || tv->tmqh_in == NULL || tv->tmqh_out == NULL) { + if (s == NULL || s->PktAcqLoop == NULL || tv->tmqh_in == NULL || tv->tmqh_out == NULL) { + SCLogError(SC_ERR_FATAL, "TmSlot or ThreadVars badly setup: s=%p," + " PktAcqLoop=%p, tmqh_in=%p," + " tmqh_out=%p", + s, s->PktAcqLoop, tv->tmqh_in, tv->tmqh_out); EngineKill(); TmThreadsSetFlag(tv, THV_CLOSED);