Project

General

Profile

Actions

Bug #4878

closed

datasets: memory leak in 5.0.x

Added by Victor Julien about 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

Running test datasets-1m-StringSets from Suricata-Verify, after leak checks are enabled in SV.

=================================================================
==1731519==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 16393484 byte(s) in 812282 object(s) allocated from:
    #0 0x4a4c2d in malloc (/home/victor/sync/devel/suricata-5.0.x/src/suricata+0x4a4c2d)
    #1 0xa94bf7 in StringSet /home/victor/sync/devel/suricata-5.0.x/src/datasets-string.c:68:18
    #2 0x2387cd8 in THashDataGetNew /home/victor/sync/devel/suricata-5.0.x/src/util-thash.c:517:5
    #3 0x238638c in THashGetFromHash /home/victor/sync/devel/suricata-5.0.x/src/util-thash.c:573:32
    #4 0xa8f550 in DatasetAddString /home/victor/sync/devel/suricata-5.0.x/src/datasets.c:873:37
    #5 0xa8f23c in DatasetAdd /home/victor/sync/devel/suricata-5.0.x/src/datasets.c:983:20
    #6 0xa835c4 in DatasetLoadString /home/victor/sync/devel/suricata-5.0.x/src/datasets.c:324:17
    #7 0xa7e8dd in DatasetGet /home/victor/sync/devel/suricata-5.0.x/src/datasets.c:501:17
    #8 0xdcc0f2 in DetectDatasetSetup /home/victor/sync/devel/suricata-5.0.x/src/detect-dataset.c:375:20
    #9 0x17b94bc in SigParseOptions /home/victor/sync/devel/suricata-5.0.x/src/detect-parse.c:815:21
    #10 0x17a7688 in SigParse /home/victor/sync/devel/suricata-5.0.x/src/detect-parse.c:1251:19
    #11 0x17919cf in SigInitHelper /home/victor/sync/devel/suricata-5.0.x/src/detect-parse.c:1883:15
    #12 0x1790b0e in SigInit /home/victor/sync/devel/suricata-5.0.x/src/detect-parse.c:2035:16
    #13 0x1793c98 in DetectEngineAppendSig /home/victor/sync/devel/suricata-5.0.x/src/detect-parse.c:2333:22
    #14 0x106f963 in DetectLoadSigFile /home/victor/sync/devel/suricata-5.0.x/src/detect-engine-loader.c:169:15
    #15 0x10671ae in ProcessSigFiles /home/victor/sync/devel/suricata-5.0.x/src/detect-engine-loader.c:250:13
    #16 0x1064dbf in SigLoadSignatures /home/victor/sync/devel/suricata-5.0.x/src/detect-engine-loader.c:329:15
    #17 0x200c558 in LoadSignatures /home/victor/sync/devel/suricata-5.0.x/src/suricata.c:2496:9
    #18 0x20004d5 in PostConfLoadedDetectSetup /home/victor/sync/devel/suricata-5.0.x/src/suricata.c:2650:17
    #19 0x1fe31ef in main /home/victor/sync/devel/suricata-5.0.x/src/suricata.c:3077:5
    #20 0x7fbf818bb0b2 in __libc_start_main /build/glibc-YbNSs7/glibc-2.31/csu/../csu/libc-start.c:308:16

Direct leak of 876 byte(s) in 48 object(s) allocated from:
    #0 0x4a4c2d in malloc (/home/victor/sync/devel/suricata-5.0.x/src/suricata+0x4a4c2d)
    #1 0xa94bf7 in StringSet /home/victor/sync/devel/suricata-5.0.x/src/datasets-string.c:68:18
    #2 0x2387cd8 in THashDataGetNew /home/victor/sync/devel/suricata-5.0.x/src/util-thash.c:517:5
    #3 0x238604c in THashGetFromHash /home/victor/sync/devel/suricata-5.0.x/src/util-thash.c:542:13
    #4 0xa8f550 in DatasetAddString /home/victor/sync/devel/suricata-5.0.x/src/datasets.c:873:37
    #5 0xa8f23c in DatasetAdd /home/victor/sync/devel/suricata-5.0.x/src/datasets.c:983:20
    #6 0xa835c4 in DatasetLoadString /home/victor/sync/devel/suricata-5.0.x/src/datasets.c:324:17
    #7 0xa7e8dd in DatasetGet /home/victor/sync/devel/suricata-5.0.x/src/datasets.c:501:17
    #8 0xdcc0f2 in DetectDatasetSetup /home/victor/sync/devel/suricata-5.0.x/src/detect-dataset.c:375:20
    #9 0x17b94bc in SigParseOptions /home/victor/sync/devel/suricata-5.0.x/src/detect-parse.c:815:21
    #10 0x17a7688 in SigParse /home/victor/sync/devel/suricata-5.0.x/src/detect-parse.c:1251:19
    #11 0x17919cf in SigInitHelper /home/victor/sync/devel/suricata-5.0.x/src/detect-parse.c:1883:15
    #12 0x1790b0e in SigInit /home/victor/sync/devel/suricata-5.0.x/src/detect-parse.c:2035:16
    #13 0x1793c98 in DetectEngineAppendSig /home/victor/sync/devel/suricata-5.0.x/src/detect-parse.c:2333:22
    #14 0x106f963 in DetectLoadSigFile /home/victor/sync/devel/suricata-5.0.x/src/detect-engine-loader.c:169:15
    #15 0x10671ae in ProcessSigFiles /home/victor/sync/devel/suricata-5.0.x/src/detect-engine-loader.c:250:13
    #16 0x1064dbf in SigLoadSignatures /home/victor/sync/devel/suricata-5.0.x/src/detect-engine-loader.c:329:15
    #17 0x200c558 in LoadSignatures /home/victor/sync/devel/suricata-5.0.x/src/suricata.c:2496:9
    #18 0x20004d5 in PostConfLoadedDetectSetup /home/victor/sync/devel/suricata-5.0.x/src/suricata.c:2650:17
    #19 0x1fe31ef in main /home/victor/sync/devel/suricata-5.0.x/src/suricata.c:3077:5
    #20 0x7fbf818bb0b2 in __libc_start_main /build/glibc-YbNSs7/glibc-2.31/csu/../csu/libc-start.c:308:16

SUMMARY: AddressSanitizer: 16394360 byte(s) leaked in 812330 allocation(s).


Related issues 1 (0 open1 closed)

Related to Suricata - Bug #3879: detasets related memleakClosedVictor JulienActions
Actions #1

Updated by Victor Julien about 3 years ago

This is not an issue in 6.0.x and master, so I suspect we're missing a backport.

Actions #2

Updated by Victor Julien about 3 years ago

  • Description updated (diff)
Actions #3

Updated by Jeff Lucovsky about 3 years ago

  • Status changed from Assigned to In Progress

Looks like this commit will fix the issue: 017c038bcba9ebe279e470cc48e1f440dfa0ef7d from issue 3879

https://github.com/OISF/suricata/pull/6722

Actions #4

Updated by Jeff Lucovsky about 3 years ago

  • Related to Bug #3879: detasets related memleak added
Actions #5

Updated by Jeff Lucovsky about 3 years ago

  • Status changed from In Progress to In Review
Actions #6

Updated by Jeff Lucovsky almost 3 years ago

  • Status changed from In Review to Closed
Actions

Also available in: Atom PDF