Actions
Bug #4216
closed5.0.5 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();
Updated by Jason Ish about 4 years ago
- Status changed from New to Assigned
- Assignee set to Jason Ish
- Affected Versions 6.0.1 added
- Label Needs backport to 5.0, Needs backport to 6.0 added
Confirmed. 6.0 affected as well. I have a fix, will do a pull request soon.
Updated by Jason Ish about 4 years ago
- Status changed from Assigned to In Review
PR for master: https://github.com/OISF/suricata/pull/5671
Updated by Jeff Lucovsky almost 4 years ago
- Copied to Bug #4301: 5.0.5 in socket mode crashes when using file-store due to uninitialized stats_ctx added
Updated by Jeff Lucovsky almost 4 years ago
- Copied to Bug #4302: 6.0.x in socket mode crashes when using file-store due to uninitialized stats_ctx added
Updated by Jason Ish over 3 years ago
- Status changed from In Review to Closed
Merged into master a while back: 0aed5e188b214d56107e66ea8e38dfb7d5a13758
Actions