-
Notifications
You must be signed in to change notification settings - Fork 504
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
unittests: fix leaks reported by ASan #605
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PragmaTwice could you share the ASan report before and after this change?
The ASan report before this is about 6MiB, I will soon find a way to upload. Seems reach the size limit in GitHub? |
kvrocks-unittest-asan.log Seems just some error due to my poor network, not limit exceeding. Done @tisonkun. |
@PragmaTwice looks great! It seems that this PR fixes all leaks currently reported. We should fail if there are new leaks in #599. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, cool!
Seems there are also some leaks in TCL tests, I do not know the current status, maybe @git-hulk know that. ASan will slow down the program execution about x2 times, and TSan about x10 times. |
Yes, I can reproduce the memory leak on my side, but didn't investigate root causes now. |
I'm going to merge this PR. Further discussion about #599 can go to that thread. If you'd like to investigate leak issues, it'd be better to create another issue. |
use
std::unique_ptr
to avoid missing delete and dtor callthis fix can remove a large amount of leak reports from ASan (~10000+ lines in stderr), so we can check easier when other important leaks is reported.