PA: Add `IntendedLeakSize` to `MallocMemoryDump` [chromium/src : main]

15 views
Skip to first unread message

Takashi Sakamoto (Gerrit)

unread,
Jun 11, 2026, 2:36:49 AMJun 11
to Stephen Nusko, Daniel Cheng, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, bartek...@chromium.org, gavinp...@chromium.org, lize...@chromium.org, lizeb...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
Attention needed from Daniel Cheng and Stephen Nusko

Takashi Sakamoto added 1 comment

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Takashi Sakamoto . resolved

Would you review this CL?

Open in Gerrit

Related details

Attention is currently required from:
  • Daniel Cheng
  • Stephen Nusko
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I4201f8085b3fac9eb2b76ae9042b6afb28ce8a59
Gerrit-Change-Number: 7921989
Gerrit-PatchSet: 2
Gerrit-Owner: Takashi Sakamoto <ta...@google.com>
Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
Gerrit-Reviewer: Takashi Sakamoto <ta...@google.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-Attention: Stephen Nusko <nus...@chromium.org>
Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
Gerrit-Comment-Date: Thu, 11 Jun 2026 06:36:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Stephen Nusko (Gerrit)

unread,
Jun 11, 2026, 3:13:11 AMJun 11
to Takashi Sakamoto, Daniel Cheng, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, bartek...@chromium.org, gavinp...@chromium.org, lize...@chromium.org, lizeb...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
Attention needed from Daniel Cheng and Takashi Sakamoto

Stephen Nusko voted and added 2 comments

Votes added by Stephen Nusko

Code-Review+1

2 comments

File base/trace_event/malloc_dump_provider_unittest.cc
Line 161, Patchset 2 (Latest): NormalTestClass1* normal_obj1 = new NormalTestClass1;
ASSERT_NE(normal_obj1, nullptr);
EXPECT_NE(leaky_root,
partition_alloc::PartitionRoot::GetRootFromAddress(normal_obj1));
delete normal_obj1;
Stephen Nusko . unresolved

nit: we can use unique_ptr

```
{
auto normal_obj1 = std::make_unique<NormalTestClass1>
ASSERT_NE(normal_obj1, nullptr);
EXPECT_NE(leaky_root,
partition_alloc::PartitionRoot::GetRootFromAddress(normal_obj1));
}
```

Same below.

File base/trace_event/memory_infra_background_allowlist.cc
Line 221, Patchset 2 (Latest): "malloc/partitions/leaky",
Stephen Nusko . unresolved

maybe `leaked` or `quarantined` or `kept_alive` rather than `leaky` which I feel doesn't fully tell you that things never get freed in here.

Open in Gerrit

Related details

Attention is currently required from:
  • Daniel Cheng
  • Takashi Sakamoto
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I4201f8085b3fac9eb2b76ae9042b6afb28ce8a59
    Gerrit-Change-Number: 7921989
    Gerrit-PatchSet: 2
    Gerrit-Owner: Takashi Sakamoto <ta...@google.com>
    Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
    Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
    Gerrit-Reviewer: Takashi Sakamoto <ta...@google.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-Attention: Takashi Sakamoto <ta...@google.com>
    Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
    Gerrit-Comment-Date: Thu, 11 Jun 2026 07:12:44 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Takashi Sakamoto (Gerrit)

    unread,
    Jun 11, 2026, 4:09:31 AMJun 11
    to Stephen Nusko, Daniel Cheng, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, bartek...@chromium.org, gavinp...@chromium.org, lize...@chromium.org, lizeb...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
    Attention needed from Daniel Cheng

    Takashi Sakamoto voted and added 3 comments

    Votes added by Takashi Sakamoto

    Commit-Queue+0

    3 comments

    Patchset-level comments
    File-level comment, Patchset 5 (Latest):
    Takashi Sakamoto . resolved

    Thank you for the review.

    File base/trace_event/malloc_dump_provider_unittest.cc
    Line 161, Patchset 2: NormalTestClass1* normal_obj1 = new NormalTestClass1;

    ASSERT_NE(normal_obj1, nullptr);
    EXPECT_NE(leaky_root,
    partition_alloc::PartitionRoot::GetRootFromAddress(normal_obj1));
    delete normal_obj1;
    Stephen Nusko . resolved

    nit: we can use unique_ptr

    ```
    {
    auto normal_obj1 = std::make_unique<NormalTestClass1>
    ASSERT_NE(normal_obj1, nullptr);
    EXPECT_NE(leaky_root,
    partition_alloc::PartitionRoot::GetRootFromAddress(normal_obj1));
    }
    ```

    Same below.

    Takashi Sakamoto

    Done

    File base/trace_event/memory_infra_background_allowlist.cc
    Line 221, Patchset 2: "malloc/partitions/leaky",
    Stephen Nusko . resolved

    maybe `leaked` or `quarantined` or `kept_alive` rather than `leaky` which I feel doesn't fully tell you that things never get freed in here.

    Takashi Sakamoto

    I see. Done.
    I also replaced all `Leaky` with `Leaked` (or `LeakedSecurityObject`).

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Daniel Cheng
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I4201f8085b3fac9eb2b76ae9042b6afb28ce8a59
      Gerrit-Change-Number: 7921989
      Gerrit-PatchSet: 5
      Gerrit-Owner: Takashi Sakamoto <ta...@google.com>
      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
      Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
      Gerrit-Reviewer: Takashi Sakamoto <ta...@google.com>
      Gerrit-CC: Kentaro Hara <har...@chromium.org>
      Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
      Gerrit-Comment-Date: Thu, 11 Jun 2026 08:09:02 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Stephen Nusko <nus...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Daniel Cheng (Gerrit)

      unread,
      Jun 11, 2026, 10:56:15 AMJun 11
      to Takashi Sakamoto, Daniel Cheng, Stephen Nusko, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, bartek...@chromium.org, gavinp...@chromium.org, lize...@chromium.org, lizeb...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
      Attention needed from Takashi Sakamoto

      Daniel Cheng voted and added 5 comments

      Votes added by Daniel Cheng

      Code-Review+1

      5 comments

      Patchset-level comments
      Daniel Cheng . unresolved

      LGTM with nits addressed, and the CL description updated to explain more about the purpose of this change–I don't really know why we need this CL from reading the CL description, but I assume there's a good reason, and that reason should be in the description :)

      File base/trace_event/malloc_dump_provider.cc
      Line 179, Patchset 5 (Latest): auto* leaked_secirty_object_allocator =
      Daniel Cheng . unresolved

      Is this a typo?

      File base/trace_event/malloc_dump_provider_unittest.cc
      Line 163, Patchset 5 (Latest): std::unique_ptr<NormalTestClass1> normal_obj1(new NormalTestClass1);
      ASSERT_NE(normal_obj1, nullptr);
      Daniel Cheng . unresolved

      Please fix this WARNING reported by ClangTidy: check: modernize-make-unique

      use std::make_unique instead (https://clang.llvm.o...

      check: modernize-make-unique

      use std::make_unique instead (https://clang.llvm.org/extra/clang-tidy/checks/modernize/make-unique.html)

      (Note: You can add `Skip-Clang-Tidy-Checks: modernize-make-unique` footer to the CL description to skip the check)

      (Lint observed on `linux-clang-tidy-rel`, but not on `android-clang-tidy-rel`)

      Line 178, Patchset 5 (Latest): std::unique_ptr<LeakedTestClass1> leaked_obj1(new LeakedTestClass1);
      ASSERT_NE(leaked_obj1, nullptr);
      Daniel Cheng . unresolved

      Please fix this WARNING reported by ClangTidy: check: modernize-make-unique

      use std::make_unique instead (https://clang.llvm.o...

      check: modernize-make-unique

      use std::make_unique instead (https://clang.llvm.org/extra/clang-tidy/checks/modernize/make-unique.html)

      (Note: You can add `Skip-Clang-Tidy-Checks: modernize-make-unique` footer to the CL description to skip the check)

      (Lint observed on `android-clang-tidy-rel`, but not on `linux-clang-tidy-rel`)

      Line 195, Patchset 5 (Latest): std::unique_ptr<LeakedTestClass2> leaked_obj2(new LeakedTestClass2);
      ASSERT_NE(leaked_obj2, nullptr);
      Daniel Cheng . unresolved

      Please fix this WARNING reported by ClangTidy: check: modernize-make-unique

      use std::make_unique instead (https://clang.llvm.o...

      check: modernize-make-unique

      use std::make_unique instead (https://clang.llvm.org/extra/clang-tidy/checks/modernize/make-unique.html)

      (Note: You can add `Skip-Clang-Tidy-Checks: modernize-make-unique` footer to the CL description to skip the check)

      (Lint observed on `android-clang-tidy-rel`, but not on `linux-clang-tidy-rel`)

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Takashi Sakamoto
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I4201f8085b3fac9eb2b76ae9042b6afb28ce8a59
      Gerrit-Change-Number: 7921989
      Gerrit-PatchSet: 5
      Gerrit-Owner: Takashi Sakamoto <ta...@google.com>
      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
      Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
      Gerrit-Reviewer: Takashi Sakamoto <ta...@google.com>
      Gerrit-CC: Kentaro Hara <har...@chromium.org>
      Gerrit-Attention: Takashi Sakamoto <ta...@google.com>
      Gerrit-Comment-Date: Thu, 11 Jun 2026 14:55:58 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Takashi Sakamoto (Gerrit)

      unread,
      Jun 12, 2026, 3:16:26 AMJun 12
      to Daniel Cheng, Stephen Nusko, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, bartek...@chromium.org, gavinp...@chromium.org, lize...@chromium.org, lizeb...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org

      Takashi Sakamoto added 6 comments

      Patchset-level comments
      File-level comment, Patchset 5:
      Daniel Cheng . resolved

      LGTM with nits addressed, and the CL description updated to explain more about the purpose of this change–I don't really know why we need this CL from reading the CL description, but I assume there's a good reason, and that reason should be in the description :)

      Takashi Sakamoto . resolved

      Thank you for the review.

      File base/trace_event/malloc_dump_provider.cc
      Line 179, Patchset 5: auto* leaked_secirty_object_allocator =
      Daniel Cheng . resolved

      Is this a typo?

      Takashi Sakamoto

      Done

      File base/trace_event/malloc_dump_provider_unittest.cc
      Line 163, Patchset 5: std::unique_ptr<NormalTestClass1> normal_obj1(new NormalTestClass1);
      ASSERT_NE(normal_obj1, nullptr);
      Daniel Cheng . resolved

      Please fix this WARNING reported by ClangTidy: check: modernize-make-unique

      use std::make_unique instead (https://clang.llvm.o...

      check: modernize-make-unique

      use std::make_unique instead (https://clang.llvm.org/extra/clang-tidy/checks/modernize/make-unique.html)

      (Note: You can add `Skip-Clang-Tidy-Checks: modernize-make-unique` footer to the CL description to skip the check)

      (Lint observed on `linux-clang-tidy-rel`, but not on `android-clang-tidy-rel`)

      Takashi Sakamoto

      Done

      Line 178, Patchset 5: std::unique_ptr<LeakedTestClass1> leaked_obj1(new LeakedTestClass1);
      ASSERT_NE(leaked_obj1, nullptr);
      Daniel Cheng . resolved

      Please fix this WARNING reported by ClangTidy: check: modernize-make-unique

      use std::make_unique instead (https://clang.llvm.o...

      check: modernize-make-unique

      use std::make_unique instead (https://clang.llvm.org/extra/clang-tidy/checks/modernize/make-unique.html)

      (Note: You can add `Skip-Clang-Tidy-Checks: modernize-make-unique` footer to the CL description to skip the check)

      (Lint observed on `android-clang-tidy-rel`, but not on `linux-clang-tidy-rel`)

      Takashi Sakamoto

      Done

      Line 195, Patchset 5: std::unique_ptr<LeakedTestClass2> leaked_obj2(new LeakedTestClass2);
      ASSERT_NE(leaked_obj2, nullptr);
      Daniel Cheng . resolved

      Please fix this WARNING reported by ClangTidy: check: modernize-make-unique

      use std::make_unique instead (https://clang.llvm.o...

      check: modernize-make-unique

      use std::make_unique instead (https://clang.llvm.org/extra/clang-tidy/checks/modernize/make-unique.html)

      (Note: You can add `Skip-Clang-Tidy-Checks: modernize-make-unique` footer to the CL description to skip the check)

      (Lint observed on `android-clang-tidy-rel`, but not on `linux-clang-tidy-rel`)

      Takashi Sakamoto

      Done

      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I4201f8085b3fac9eb2b76ae9042b6afb28ce8a59
        Gerrit-Change-Number: 7921989
        Gerrit-PatchSet: 7
        Gerrit-Owner: Takashi Sakamoto <ta...@google.com>
        Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
        Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
        Gerrit-Reviewer: Takashi Sakamoto <ta...@google.com>
        Gerrit-CC: Kentaro Hara <har...@chromium.org>
        Gerrit-Comment-Date: Fri, 12 Jun 2026 07:16:17 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
        satisfied_requirement
        open
        diffy

        Takashi Sakamoto (Gerrit)

        unread,
        Jun 12, 2026, 3:50:30 AMJun 12
        to Daniel Cheng, Stephen Nusko, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, bartek...@chromium.org, gavinp...@chromium.org, lize...@chromium.org, lizeb...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org

        Takashi Sakamoto voted Commit-Queue+2

        Commit-Queue+2
        Open in Gerrit

        Related details

        Attention set is empty
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I4201f8085b3fac9eb2b76ae9042b6afb28ce8a59
        Gerrit-Change-Number: 7921989
        Gerrit-PatchSet: 7
        Gerrit-Owner: Takashi Sakamoto <ta...@google.com>
        Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
        Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
        Gerrit-Reviewer: Takashi Sakamoto <ta...@google.com>
        Gerrit-CC: Kentaro Hara <har...@chromium.org>
        Gerrit-Comment-Date: Fri, 12 Jun 2026 07:50:15 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Takashi Sakamoto (Gerrit)

        unread,
        Jun 14, 2026, 8:34:06 PMJun 14
        to Daniel Cheng, Stephen Nusko, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, bartek...@chromium.org, gavinp...@chromium.org, lize...@chromium.org, lizeb...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org
        Gerrit-Comment-Date: Mon, 15 Jun 2026 00:33:55 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Chromium LUCI CQ (Gerrit)

        unread,
        Jun 14, 2026, 9:32:00 PMJun 14
        to Takashi Sakamoto, Daniel Cheng, Stephen Nusko, chromium...@chromium.org, Kentaro Hara, bartek...@chromium.org, gavinp...@chromium.org, lize...@chromium.org, lizeb...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org

        Chromium LUCI CQ submitted the change with unreviewed changes

        Unreviewed changes

        5 is the latest approved patch-set.
        The change was submitted with unreviewed changes in the following files:

        ```
        The name of the file: base/trace_event/malloc_dump_provider_unittest.cc
        Insertions: 6, Deletions: 3.

        The diff is too large to show. Please review the diff.
        ```
        ```
        The name of the file: base/trace_event/malloc_dump_provider.cc
        Insertions: 4, Deletions: 4.

        The diff is too large to show. Please review the diff.
        ```

        Change information

        Commit message:
        PA: Add `IntendedLeakSize` to `MallocMemoryDump`

        Since leaked security objects are leaked, not really freed, to avoid
        heap-use-after-free, they may cause significant memory regressions, and
        finally lots of OOM. So we have to monitor how much memory are leaked.
        Firstly update memory-infra to gather total size of the leaked memory as
        "malloc/partitions/leaked". The size will be reported to UMA in the
        later CL.
        Bug: 501113274
        Change-Id: I4201f8085b3fac9eb2b76ae9042b6afb28ce8a59
        Reviewed-by: Stephen Nusko <nus...@chromium.org>
        Reviewed-by: Daniel Cheng <dch...@chromium.org>
        Commit-Queue: Takashi Sakamoto <ta...@google.com>
        Cr-Commit-Position: refs/heads/main@{#1646552}
        Files:
        • M base/allocator/partition_allocator/src/partition_alloc/partition_root.cc
        • M base/allocator/partition_allocator/src/partition_alloc/partition_root.h
        • M base/memory/advanced_memory_safety_checks.cc
        • M base/memory/advanced_memory_safety_checks.h
        • M base/memory/safety_checks_unittest.cc
        • M base/trace_event/malloc_dump_provider.cc
        • M base/trace_event/malloc_dump_provider.h
        • M base/trace_event/malloc_dump_provider_unittest.cc
        • M base/trace_event/memory_infra_background_allowlist.cc
        Change size: M
        Delta: 9 files changed, 185 insertions(+), 17 deletions(-)
        Branch: refs/heads/main
        Submit Requirements:
        • requirement satisfiedCode-Review: +1 by Daniel Cheng, +1 by Stephen Nusko
        Open in Gerrit
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: merged
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I4201f8085b3fac9eb2b76ae9042b6afb28ce8a59
        Gerrit-Change-Number: 7921989
        Gerrit-PatchSet: 8
        Gerrit-Owner: Takashi Sakamoto <ta...@google.com>
        Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
        Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
        Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
        Gerrit-Reviewer: Takashi Sakamoto <ta...@google.com>
        open
        diffy
        satisfied_requirement
        Reply all
        Reply to author
        Forward
        0 new messages