Skip to content

Dataset string memcap 3910/v7#11162

Closed
inashivb wants to merge 4 commits intoOISF:masterfrom
inashivb:dataset-string-memcap-3910/v7
Closed

Dataset string memcap 3910/v7#11162
inashivb wants to merge 4 commits intoOISF:masterfrom
inashivb:dataset-string-memcap-3910/v7

Conversation

@inashivb
Copy link
Member

Link to redmine ticket: https://redmine.openinfosecfoundation.org/issues/3910

Previous PR: #11124

Changes since v6:

  • review taken into account

victorjulien and others added 4 commits May 28, 2024 12:56
Add a callback and helper function to handle data expiration.

Update datasets to explicitly not use expiration.
In order to have access to the length of datatypes with variable lengths
to correctly update memuse to calculate memcaps.

Bug 3910
So far, when the data size was passed to the THash API, it was sent as
a sizeof(Struct) which works fine for the other data types as they have
a fixed length but not for the StringType.
However, because of the sizeof construct, the length of a string type
dataset was always taken to be 16 Bytes which is only the size of the struct
itself. It did not accomodate the actual size of the string that the
StringType holds. Fix this so that the memuse that is used to determine
whether memcap was reached also takes into consideration the size of the
actual string.

Bug 3910
@codecov
Copy link

codecov bot commented May 28, 2024

Codecov Report

Attention: Patch coverage is 45.20548% with 40 lines in your changes are missing coverage. Please review.

Project coverage is 83.46%. Comparing base (e041187) to head (a059b69).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11162      +/-   ##
==========================================
- Coverage   84.28%   83.46%   -0.83%     
==========================================
  Files         926      920       -6     
  Lines      243303   241657    -1646     
==========================================
- Hits       205076   201695    -3381     
- Misses      38227    39962    +1735     
Flag Coverage Δ
fuzzcorpus 64.17% <42.46%> (-0.02%) ⬇️
livemode ?
pcap 46.61% <20.54%> (-0.06%) ⬇️
suricata-verify 63.01% <45.20%> (-0.02%) ⬇️
unittests 61.73% <0.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@inashivb inashivb force-pushed the dataset-string-memcap-3910/v7 branch from 16f89c2 to a059b69 Compare May 28, 2024 07:48
@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline 20824

@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline 20826

@inashivb inashivb closed this May 29, 2024
@inashivb inashivb deleted the dataset-string-memcap-3910/v7 branch May 29, 2024 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants