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

Fix some memory leaks in redis-cli #13258

Open
wants to merge 3 commits into
base: unstable
Choose a base branch
from

Conversation

LuMingYinDetect
Copy link

Fix memory leak related to variable slot_nodes in the clusterManagerFixSlotsCoverage() function

@sundb sundb changed the title Fix memory leak of the slot_nodes variable (#13256) Fix memory leak of the slot_nodes variable May 11, 2024
@LuMingYinDetect LuMingYinDetect changed the title Fix memory leak of the slot_nodes variable Fix memory leak of the variables slot_nodes and argv2 May 11, 2024
src/redis-cli.c Show resolved Hide resolved
@sundb
Copy link
Collaborator

sundb commented May 11, 2024

@LuMingYinDetect Can you try to reproduce these leaks using redis-cli?

@sundb sundb changed the title Fix memory leak of the variables slot_nodes and argv2 Fix some memory leaks in redis-cli May 11, 2024
@LuMingYinDetect
Copy link
Author

@LuMingYinDetect Can you try to reproduce these leaks using redis-cli?

The tool I use to check for memory leaks is the Clang Static Analyzer. It only provides information about the paths that trigger the defects and doesn't offer a specific test case. Therefore, I might not be able to reproduce the issue using redis-cli for now.

@sundb
Copy link
Collaborator

sundb commented May 11, 2024

@LuMingYinDetect if there is any leak, when execute the following script we can see a leak report from sanitizer.

make SANITIZER=address
./src/redis-cli --eval test.lua

Copy link
Author

@LuMingYinDetect LuMingYinDetect left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correcting released memory objects.

Co-authored-by: debing.sun <debing.sun@redis.com>
@LuMingYinDetect
Copy link
Author

@LuMingYinDetect if there is any leak, when execute the following script we can see a leak report from sanitizer.

make SANITIZER=address
./src/redis-cli --eval test.lua

Thank you for your detailed guidance!

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

Successfully merging this pull request may close these issues.

None yet

2 participants