-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Check for Memory Leaks #119
Comments
I wanted to start by trying the sanitizers Unfortunately, even if this is possible on nightly, We should definitely have this issue in mind as an extra precaution, but it seems we need to wait for better/newer tools and/or toolchain versions before getting some relevant results. |
As of 1.28, the |
Hi @memoryruins , This is really useful information that we were not aware of. Thank you!
|
…-fix Fixes purge and redeploy bugs
An issue that arises is that Firecracker's main() does not return "cleanly". Termination is done in a mid-subscriber callback with If one wants to return an integer exit status -and- guarantee all the destructors have run, the idiom is to put your main code in a wrapped function that returns an integer. Then have the true main() call std::process::exit() with the result of the wrapper. This way, all the code that could need destruction has finished. I've done that, and tried to make some minimally invasive changes to get an While clean shutdown is nice for Valgrind, it is slower, and it's also introducing new code paths that could wind up in deadlocks. So I put it under an option... |
Valgrind tests can now be run after merging #2599 |
Closing this in favor of #1662 |
We have a bunch of unsafe code & usage of CString which needs to be deallocated explicitly.
We should check to see if we find any memory leaks. We could use valgrind. See https://creativcoder.github.io/post/checking_memory_leaks_in_rust_ffi/ as it might not work out of the box.
The text was updated successfully, but these errors were encountered: