mbox series

[libgpiod,0/2] line-config: don't allow memory usage to increase indefinitely

Message ID 20250424-line_config_mem_use-v1-0-fa0abdcf0cdf@linaro.org
Headers show
Series line-config: don't allow memory usage to increase indefinitely | expand

Message

Bartosz Golaszewski April 24, 2025, 12:06 p.m. UTC
I've received an issue report on github pointing out that repeated calls
to gpiod_test_line_config_add_line_settings_or_fail() inflate the memory
usage of the calling process indefinitely until it's killed by the OOM
killer. This series proposes to address the issue and adds a relevant
test-case.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
Bartosz Golaszewski (2):
      core: keep memory usage of struct line_config in check
      tests: add a test-case checking line-config memory usage

 configure.ac              |  1 +
 lib/line-config.c         | 19 ++++++++++++++++++-
 tests/tests-line-config.c | 43 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 62 insertions(+), 1 deletion(-)
---
base-commit: 41231df28c9aecacaaae9e6493d31161023733d6
change-id: 20250422-line_config_mem_use-34e22c0a86ee

Best regards,

Comments

Bartosz Golaszewski April 30, 2025, 8:49 a.m. UTC | #1
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>


On Thu, 24 Apr 2025 14:06:15 +0200, Bartosz Golaszewski wrote:
> I've received an issue report on github pointing out that repeated calls
> to gpiod_test_line_config_add_line_settings_or_fail() inflate the memory
> usage of the calling process indefinitely until it's killed by the OOM
> killer. This series proposes to address the issue and adds a relevant
> test-case.
> 
> 
> [...]

Applied, thanks!

[1/2] core: keep memory usage of struct line_config in check
      commit: 2560a857ce43f2bd7b31284ce2b354d5c2edcd18
[2/2] tests: add a test-case checking line-config memory usage
      commit: c116b6f6f118b983dbd9674612396cc04a883905

Best regards,