Skip to content

tests/valgrind: Check for leaking file descriptors#5877

Closed
btriller wants to merge 2 commits into
cfengine:masterfrom
btriller:tests-valgrind-fds
Closed

tests/valgrind: Check for leaking file descriptors#5877
btriller wants to merge 2 commits into
cfengine:masterfrom
btriller:tests-valgrind-fds

Conversation

@btriller

Copy link
Copy Markdown
Contributor

Let valgrind track fds to catch unclosed file descriptors. That would have catched bug in #5722.

Let valgrind track fds to catch unclosed file descriptors.
That would have catched bug in cfengine#5722.
@larsewi

larsewi commented Sep 11, 2025

Copy link
Copy Markdown
Contributor

Thanks @btriller 🚀

I see that your change found another leaking file descriptor:

 ---snip---
==31286== FILE DESCRIPTORS: 4 open (3 std) at exit.
==31286== Open file descriptor 3: /var/cfengine/state/am_policy_hub
==31286==    at 0x4D528B4: creat (creat64.c:28)
==31286==    by 0x48B5CF5: WriteAmPolicyHubFile (bootstrap.c:218)
==31286==    by 0x490402E: GenericAgentDiscoverContext (generic_agent.c:1092)
==31286==    by 0x11A008: main (cf-agent.c:296)
 ---snip---

Do you want to fix it, or do you want us to take a look at it?

@btriller

Copy link
Copy Markdown
Contributor Author

Do you want to fix it, or do you want us to take a look at it?

Please go ahead.

Changelog: Title
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
@larsewi

larsewi commented Sep 16, 2025

Copy link
Copy Markdown
Contributor

There's still a leaked file descriptor. I will have to get back to this next week @btriller

@larsewi

larsewi commented Sep 29, 2025

Copy link
Copy Markdown
Contributor

@btriller I investigated the remaining file descriptor leak but wasn't able to resolve it within the current sprint scope. I've created ticket CFE-4593 to track this issue for future prioritization when we have additional resources to throw at it.

I'm closing this PR for now, with the plan to reopen it once we can allocate some time to address it properly. Thanks again for the contribution 🚀

@larsewi larsewi closed this Sep 29, 2025
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