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(asan): repeated memory release in pegasus_server_write_test.batch_writes #685

Merged
merged 6 commits into from
Jan 25, 2021

Conversation

levy5307
Copy link
Contributor

@levy5307 levy5307 commented Jan 20, 2021

What problem does this PR solve?

writes[0] ~ writes[total_rpc_cnt-1] will be destructed by their corresponding rpc_holder which created in on_batched_write_requests, so we don't need to release them in this unit test. Or it will produce coredump.

Check List

Tests

  • No code

@levy5307 levy5307 changed the title fix: repeated memory release in pegasus_server_write_test.batch fix: repeated memory release in pegasus_server_write_test.batch_writes Jan 20, 2021
@levy5307 levy5307 changed the title fix: repeated memory release in pegasus_server_write_test.batch_writes fix(asan): repeated memory release in pegasus_server_write_test.batch_writes Jan 20, 2021
@levy5307 levy5307 added the type/sanitize Fixes on errors reported by sanitizers. label Jan 20, 2021
for (int i = 0; i < put_rpc_cnt; i++) {
writes[i] = pegasus::create_put_request(req);
}
for (int i = put_rpc_cnt; i < total_rpc_cnt; i++) {
writes[i] = pegasus::create_remove_request(key);
}
auto cleanup = dsn::defer([=]() {
Copy link
Contributor

@Smityz Smityz Jan 20, 2021

Choose a reason for hiding this comment

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

auto cleanup = dsn::defer([=]() {

May have the same problem, can you help to fix?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@neverchanje neverchanje merged commit 8159b5b into apache:master Jan 25, 2021
@neverchanje neverchanje mentioned this pull request Mar 1, 2021
@levy5307 levy5307 deleted the batch-write-test-memory branch March 18, 2021 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/sanitize Fixes on errors reported by sanitizers.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants