Skip to content

Fix memory leak from ASAN checks #9750

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

Merged
merged 23 commits into from
May 5, 2022
Merged

Fix memory leak from ASAN checks #9750

merged 23 commits into from
May 5, 2022

Conversation

wu-hui
Copy link
Contributor

@wu-hui wu-hui commented May 3, 2022

Newer version of ASAN started to support checking memory leaks.

  • MaxValue() was leaking some heap memory because the special field value is allocated on heap and no one frees it. It's a negligible leak, but I fixed so we have clean ASAN by allocating the entire kMaxValue in static memory.
  • Some tests in local_serializer_tests.cc are leaking memory, they happen to be tests we intend to remove, so I simply removed them. There are some production code we need to remove as well (local_store->DecodeMutationBatch), but I'll leave that for later.

@google-oss-bot
Copy link

1 Warning
⚠️ Did you forget to add a changelog entry? (Add #no-changelog to the PR description to silence this warning.)

Generated by 🚫 Danger

@google-oss-bot
Copy link

google-oss-bot commented May 3, 2022

Coverage Report 1

Affected Products

  • FirebaseFirestore-iOS-FirebaseFirestore.framework

    Overall coverage changed from 87.60% (0bdc148) to 87.54% (1cd1bca) by -0.06%.

    FilenameBase (0bdc148)Merge (1cd1bca)Diff
    local_serializer.cc90.25%86.07%-4.18%
    value_util.cc95.65%95.59%-0.07%
    write_stream.cc90.14%94.37%+4.23%

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/qEaMibfS8u.html

@paulb777 paulb777 mentioned this pull request May 3, 2022
@wu-hui wu-hui requested a review from ehsannas May 3, 2022 14:16
@ehsannas ehsannas removed their assignment May 4, 2022
@wu-hui wu-hui merged commit 74c7c1f into master May 5, 2022
@wu-hui wu-hui deleted the origin/wuandy/FixMemoryLeak branch May 5, 2022 00:48
@firebase firebase locked and limited conversation to collaborators Jun 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants