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,