Actions
Bug #4302
closed6.0.x in socket mode crashes when using file-store due to uninitialized stats_ctx
Description
When using 5.0.5 in socket mode with a config that enables file-store:
# suricata -c /suricata.yaml -v --unix-socket=/tmp/suricata.socket 11/12/2020 -- 18:19:56 - <Notice> - This is Suricata version 5.0.5 RELEASE running in SYSTEM mode 11/12/2020 -- 18:19:56 - <Info> - CPUs/cores online: 8 suricata: counters.c:1007: StatsRegisterGlobalCounter: Assertion `!(stats_ctx == ((void *)0))' failed. Aborted (core dumped)
This diff properly initializes stats_ctx and seems to fix the issue:
diff --git a/src/suricata.c b/src/suricata.c index 5b76b0559..dbcc123fe 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -2300,10 +2300,10 @@ static int InitSignalHandler(SCInstance *suri) * Will be run once per pcap in unix-socket mode */ void PreRunInit(const int runmode) { + StatsInit(); if (runmode == RUNMODE_UNIX_SOCKET) return; - StatsInit(); #ifdef PROFILING SCProfilingRulesGlobalInit(); SCProfilingKeywordsGlobalInit();
Actions