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 cleanup #224

Open
SamTebbs33 opened this issue Aug 16, 2020 · 3 comments
Open

Resource cleanup #224

SamTebbs33 opened this issue Aug 16, 2020 · 3 comments
Labels
code quality An issue of source code quality good first issue Good for newcomers testing Relates to testing the kernel

Comments

@SamTebbs33
Copy link
Collaborator

SamTebbs33 commented Aug 16, 2020

Many functions in the kernel allocate resources that are not cleaned up in the case of an error. We should analyse the source and fix where this happens, adding tests as appropriate to make sure this is maintained.

@SamTebbs33 SamTebbs33 added testing Relates to testing the kernel code quality An issue of source code quality good first issue Good for newcomers labels Aug 16, 2020
@b-ncMN
Copy link
Contributor

b-ncMN commented Mar 31, 2021

Hi, is this being worked on currently ? If yes then I would like to participate, if not then I will try

@DrDeano
Copy link
Member

DrDeano commented Mar 31, 2021

Sure, you have ago. So yeh, anything that allocates memory will need leak checking for all error cases. There are examples, e.g. in the initrd.zig tests, that checks for memory leaks for each error condition. So we would like to ensure this testing is consistent through the code base.

@DrDeano
Copy link
Member

DrDeano commented Apr 8, 2021

Might also be interesting to add a function that can do this kinds of testing where it will automatically test each failed allocation. Basically how the Zig fmt testing works when testing its parsing and rendering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality An issue of source code quality good first issue Good for newcomers testing Relates to testing the kernel
Projects
None yet
Development

No branches or pull requests

3 participants