-
Notifications
You must be signed in to change notification settings - Fork 56
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 memory leaking caused by r.max
and r.min
#87
Conversation
r.max
and r.min
r.max
and r.min
Interesting! Is it possible to add a test to catch this? I'm not sure if the ones that use valgrind are 100% accurate now that you found this |
@aviggiano Valgrind should catch all memory leaks. It would be interesting to find out that it does not. |
I found this via `leaks` tool.
Have an awesome day
✉️✉️✉️✉️✉️✉️✉️✉️✉️✉️✉️✉️
Arthur lee
Sent from my iPhone
… 在 2021年7月13日,下午9:07,Daniel Lemire ***@***.***> 写道:
@aviggiano Valgrind should catch all memory leaks. It would be interesting to find out that it does not.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
you can just run this on your command line
To repeat the memory leak, you can try this command after call
|
I'm not sure why you guys did not found this leak by But after I added a call to |
Cool, I didn't know about it. |
Hi there In any case, after re-enabling it, I wasn't able to reproduce this leak, even though it is quite obvious that The docs explain that auto memory eliminates the need of calling If you have any ideas (or a sequence of commands to reproduce the bug) I'm happy to add more tests. Otherwise, I'll just merge and add a new issue to make the tests more robust |
LGTM, /* Mark an object as freed in the auto release queue, so that users can still
* free things manually if they want.
*
* The function returns 1 if the object was actually found in the auto memory
* pool, otherwise 0 is returned. */
int autoMemoryFreed(RedisModuleCtx *ctx, int type, void *ptr) {
if (!(ctx->flags & REDISMODULE_CTX_AUTO_MEMORY)) return 0;
... ...
} And I have also investigated in |
Merging and opening a new issue here #90 to improve Valgrind tests |
No description provided.