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
Use the freed memory in readHandler (Redis-benchmark.c) #669
Comments
I fail to see how there would be a change with this in the code path. Could you elaborate a bit more on the claimed "use the free'd memory", please? Unless I misread your change, the while(c->pending) {...} loop terminates in the case of (c->pending == 0), which is the endroit where you added the additional break. |
Hi, moreaki: The code of current implementation: if (c->pending == 0) clientDone(c); So I think the code should be modified as: Could you help to check this? Thanks very much!! Best Regards |
You are correct with your analysis, Nan Xiao. A look at clientDone(): static void clientDone(client c) {
if (config.requests_finished == config.requests) {
freeClient(c);
aeStop(config.el);
return;
}
if (config.keepalive) {
resetClient(c);
} else {
config.liveclients--;
createMissingClients(c);
config.liveclients++;
freeClient(c);
}
} Your case happens in case of (config.requests_finished == config.requests) being true or (config.keepalive) being false. Normally, the process of code fixes works by modifying the code in the git repository and adding a pull request to te upstream maintainer. Do you care to provide a fix with a subsequent pull request? Thank you and best regards. |
Hi, moreaki: Best Regards |
G'day Nan Xiao. Excellent. As I have just seen, it has been merged already. Thanks for your catch and the patch. Take care. |
Hi, moreaki: Welcome! Best Regards |
Hi, antirez:
Best Regards
Nan Xiao
The text was updated successfully, but these errors were encountered: