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

Memory Leak occurs when GraphicsOutput::query_mode is called. #968

Closed
JarlEvanson opened this issue Oct 21, 2023 · 4 comments
Closed

Memory Leak occurs when GraphicsOutput::query_mode is called. #968

JarlEvanson opened this issue Oct 21, 2023 · 4 comments

Comments

@JarlEvanson
Copy link
Contributor

A memory leak occurs when GraphicsOutput::query_mode is called. The UEFI specification specifies that the GraphicsOutputModeInformation is returned in a callee-allocated buffer, but GraphicsOutput::query_mode does not free the buffer.

@phip1611
Copy link
Contributor

phip1611 commented Oct 21, 2023

@phip1611
Copy link
Contributor

phip1611 commented Oct 21, 2023

Hm, I don't see how we can easily fix this without having access to the boot services. Probably, this is the point where we should consider #905, i.e., having the boot services stored in a global static.

What do you think, @nicholasbishop ?

I've set up a PR that comes with a breaking change:
#969

@JarlEvanson Did you spot this by looking at the code or by with some nice debugging tooling? I'm curious

@phip1611 phip1611 mentioned this issue Oct 21, 2023
2 tasks
@JarlEvanson
Copy link
Contributor Author

I was looking at the specification and noticed that it returned a callee allocated buffer, but the uefi-rs implementation didn't take BootServices to deallocate it.

@nicholasbishop
Copy link
Contributor

nicholasbishop commented Oct 24, 2023

Should be fixed now with Philipp's PR merged. Thanks again for filing this issue :)

Re comment 3, added a note about this to #893 (the "add a global table pointer" issue).

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

3 participants