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

phihat1, phihat2 and phihat3 are not correctly freed in some error cases resulting in memory leaks #547

Closed
DiamonDinoia opened this issue Sep 4, 2024 · 6 comments

Comments

@DiamonDinoia
Copy link
Collaborator

This problem will once we de macroize and we use stl containers instead of malloc/free.

@ahbarnett
Copy link
Collaborator

Is this type 3 only? CPU or GPU? Etc. Can you make a concrete proposal?

@DiamonDinoia
Copy link
Collaborator Author

This is type3 CPU only. If we use std::vector instead of malloc/free the memory leak goes away without extra effort. Othwewise we need to define an error handler in cpu finufft setpts for type 3 that make sure to free all the memory before returning. I'd rather do the de/macroize as it is less error prone.

This memory leak occurs only in case of errors so it is not super critical to fix as I expect the user to terminate the program if the nufft fails but we should fix it now that we spotted it.

@ahbarnett
Copy link
Collaborator

ahbarnett commented Sep 5, 2024 via email

@ahbarnett
Copy link
Collaborator

Ok, we wait until de-macro-ize which will use std::vector.

@mreineck
Copy link
Collaborator

mreineck commented Nov 4, 2024

This should be fixed now, correct?

@DiamonDinoia
Copy link
Collaborator Author

Indeed.

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