Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resource tracking #161

Open
javierhonduco opened this issue Apr 28, 2022 · 1 comment
Open

Resource tracking #161

javierhonduco opened this issue Apr 28, 2022 · 1 comment

Comments

@javierhonduco
Copy link
Contributor

Something we have experienced in libbpfgo is that it's not hard to accidentally double-free resources (see this bug we recently hit parca-dev/parca-agent#367 that ASAN catches parca-dev/parca-agent#370), which beyond crashes, could have other implications.

Perhaps this could be avoided by having more checks in place to keep track of which resources are 'closed' or not. This would make the code less clean and maintainable and it won't be bulletproof 😢.

Just wanted to kickstart the discussion here, in case this is something any of you are interested in!

cc/ @rafaeldtinoco

@rafaeldtinoco
Copy link
Contributor

Thanks for opening this @javierhonduco and having a resource reference/usage status flag (or similar) sounds interesting indeed (not to close fds and/or double frees).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants