PA: Report LeakedSecurityObject's type id and total leaked size with MallocDumpProvider [chromium/src : main]

4 views
Skip to first unread message

Takashi Sakamoto (Gerrit)

unread,
Jun 30, 2026, 12:12:42 AM (4 days ago) Jun 30
to Keishi Hattori, Chromium LUCI CQ, chromium...@chromium.org, android-bu...@system.gserviceaccount.com, spang...@chromium.org, gavinp...@chromium.org, wfh+...@chromium.org, tracing...@chromium.org
Attention needed from Keishi Hattori

Takashi Sakamoto added 2 comments

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

Would you review this CL?

File base/trace_event/malloc_dump_provider.cc
Line 811, Patchset 7 (Latest): MemoryDumpPartitionStatsDumper::kPartitionsDumpName, type_id);
Takashi Sakamoto . unresolved

```
"malloc/partitions/leaked/LeakedSecurityObject/%08x": { "size": ... }
```

Open in Gerrit

Related details

Attention is currently required from:
  • Keishi Hattori
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • 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: I5cfd717a6ac75f7fd935c191cdab641bb3a3d7b8
Gerrit-Change-Number: 8002236
Gerrit-PatchSet: 7
Gerrit-Owner: Takashi Sakamoto <ta...@google.com>
Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
Gerrit-Reviewer: Takashi Sakamoto <ta...@google.com>
Gerrit-Attention: Keishi Hattori <kei...@chromium.org>
Gerrit-Comment-Date: Tue, 30 Jun 2026 04:12:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Keishi Hattori (Gerrit)

unread,
Jun 30, 2026, 12:21:37 AM (4 days ago) Jun 30
to Takashi Sakamoto, Chromium LUCI CQ, chromium...@chromium.org, android-bu...@system.gserviceaccount.com, spang...@chromium.org, gavinp...@chromium.org, wfh+...@chromium.org, tracing...@chromium.org
Attention needed from Takashi Sakamoto

Keishi Hattori voted and added 1 comment

Votes added by Keishi Hattori

Code-Review+1

1 comment

Patchset-level comments
Keishi Hattori . resolved

LGTM

Open in Gerrit

Related details

Attention is currently required from:
  • 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: I5cfd717a6ac75f7fd935c191cdab641bb3a3d7b8
    Gerrit-Change-Number: 8002236
    Gerrit-PatchSet: 7
    Gerrit-Owner: Takashi Sakamoto <ta...@google.com>
    Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
    Gerrit-Reviewer: Takashi Sakamoto <ta...@google.com>
    Gerrit-Attention: Takashi Sakamoto <ta...@google.com>
    Gerrit-Comment-Date: Tue, 30 Jun 2026 04:21:13 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Takashi Sakamoto (Gerrit)

    unread,
    Jun 30, 2026, 12:36:00 AM (4 days ago) Jun 30
    to Keishi Hattori, Chromium LUCI CQ, chromium...@chromium.org, android-bu...@system.gserviceaccount.com, spang...@chromium.org, gavinp...@chromium.org, wfh+...@chromium.org, tracing...@chromium.org

    Takashi Sakamoto added 1 comment

    Patchset-level comments
    Takashi Sakamoto . resolved

    Thank you for the review.

    Open in Gerrit

    Related details

    Attention set is empty
    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: I5cfd717a6ac75f7fd935c191cdab641bb3a3d7b8
    Gerrit-Change-Number: 8002236
    Gerrit-PatchSet: 7
    Gerrit-Owner: Takashi Sakamoto <ta...@google.com>
    Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
    Gerrit-Reviewer: Takashi Sakamoto <ta...@google.com>
    Gerrit-Comment-Date: Tue, 30 Jun 2026 04:35:54 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Takashi Sakamoto (Gerrit)

    unread,
    Jun 30, 2026, 12:36:38 AM (4 days ago) Jun 30
    to Lei Zhang, Keishi Hattori, Chromium LUCI CQ, chromium...@chromium.org, android-bu...@system.gserviceaccount.com, spang...@chromium.org, gavinp...@chromium.org, wfh+...@chromium.org, tracing...@chromium.org
    Attention needed from Lei Zhang

    Takashi Sakamoto added 1 comment

    Patchset-level comments
    Takashi Sakamoto . resolved

    thestig@, would you review this CL?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Lei Zhang
    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: I5cfd717a6ac75f7fd935c191cdab641bb3a3d7b8
    Gerrit-Change-Number: 8002236
    Gerrit-PatchSet: 7
    Gerrit-Owner: Takashi Sakamoto <ta...@google.com>
    Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
    Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
    Gerrit-Attention: Lei Zhang <the...@chromium.org>
    Gerrit-Comment-Date: Tue, 30 Jun 2026 04:36:34 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Lei Zhang (Gerrit)

    unread,
    Jun 30, 2026, 12:46:41 AM (4 days ago) Jun 30
    to Takashi Sakamoto, Lei Zhang, Keishi Hattori, Chromium LUCI CQ, chromium...@chromium.org, android-bu...@system.gserviceaccount.com, spang...@chromium.org, gavinp...@chromium.org, wfh+...@chromium.org, tracing...@chromium.org
    Attention needed from Takashi Sakamoto

    Lei Zhang voted and added 3 comments

    Votes added by Lei Zhang

    Code-Review+1

    3 comments

    File base/memory/safety_checks_unittest.cc
    Line 7, Patchset 7 (Latest):#include <unordered_map>
    Lei Zhang . unresolved

    Is there a special need to use std::unordered_map instead of a std::map?

    Line 310, Patchset 7 (Latest): reported_leaks.find(TestClass1::kPartitionAllocSanitizedObjectTypeId));
    Lei Zhang . unresolved

    Take the resulting iterator and use ASSERT_NE() here. Then reuse the iterator on line 321.

    Line 323, Patchset 7 (Latest): EXPECT_EQ(1u, reported_leaks.size());
    Lei Zhang . unresolved

    Maybe do this check earlier?

    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: I5cfd717a6ac75f7fd935c191cdab641bb3a3d7b8
    Gerrit-Change-Number: 8002236
    Gerrit-PatchSet: 7
    Gerrit-Owner: Takashi Sakamoto <ta...@google.com>
    Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
    Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
    Gerrit-Reviewer: Takashi Sakamoto <ta...@google.com>
    Gerrit-Attention: Takashi Sakamoto <ta...@google.com>
    Gerrit-Comment-Date: Tue, 30 Jun 2026 04:46:27 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Takashi Sakamoto (Gerrit)

    unread,
    Jun 30, 2026, 1:13:59 AM (4 days ago) Jun 30
    to Lei Zhang, Keishi Hattori, Chromium LUCI CQ, chromium...@chromium.org, android-bu...@system.gserviceaccount.com, spang...@chromium.org, gavinp...@chromium.org, wfh+...@chromium.org, tracing...@chromium.org
    Attention needed from Lei Zhang

    Takashi Sakamoto voted and added 4 comments

    Votes added by Takashi Sakamoto

    Commit-Queue+1

    4 comments

    Patchset-level comments
    Takashi Sakamoto . resolved

    Thank you for the review.

    File base/memory/safety_checks_unittest.cc
    Line 7, Patchset 7:#include <unordered_map>
    Lei Zhang . unresolved

    Is there a special need to use std::unordered_map instead of a std::map?

    Takashi Sakamoto

    No special need, because it's just for testing and the map will contain very few items.
    I replaced it with `base::flat_map`. Is it ok? Or `std::map` is better?

    Line 310, Patchset 7: reported_leaks.find(TestClass1::kPartitionAllocSanitizedObjectTypeId));
    Lei Zhang . resolved

    Take the resulting iterator and use ASSERT_NE() here. Then reuse the iterator on line 321.

    Takashi Sakamoto

    I see. Done

    Line 323, Patchset 7: EXPECT_EQ(1u, reported_leaks.size());
    Lei Zhang . resolved

    Maybe do this check earlier?

    Takashi Sakamoto

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Lei Zhang
    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: I5cfd717a6ac75f7fd935c191cdab641bb3a3d7b8
    Gerrit-Change-Number: 8002236
    Gerrit-PatchSet: 7
    Gerrit-Owner: Takashi Sakamoto <ta...@google.com>
    Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
    Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
    Gerrit-Reviewer: Takashi Sakamoto <ta...@google.com>
    Gerrit-Attention: Lei Zhang <the...@chromium.org>
    Gerrit-Comment-Date: Tue, 30 Jun 2026 05:13:51 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Lei Zhang <the...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Lei Zhang (Gerrit)

    unread,
    Jun 30, 2026, 1:19:23 AM (4 days ago) Jun 30
    to Takashi Sakamoto, Lei Zhang, Keishi Hattori, Chromium LUCI CQ, chromium...@chromium.org, android-bu...@system.gserviceaccount.com, spang...@chromium.org, gavinp...@chromium.org, wfh+...@chromium.org, tracing...@chromium.org
    Attention needed from Takashi Sakamoto

    Lei Zhang voted and added 1 comment

    Votes added by Lei Zhang

    Code-Review+1

    1 comment

    File base/memory/safety_checks_unittest.cc
    Line 7, Patchset 7:#include <unordered_map>
    Lei Zhang . resolved

    Is there a special need to use std::unordered_map instead of a std::map?

    Takashi Sakamoto

    No special need, because it's just for testing and the map will contain very few items.
    I replaced it with `base::flat_map`. Is it ok? Or `std::map` is better?

    Lei Zhang

    Either is fine.

    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: I5cfd717a6ac75f7fd935c191cdab641bb3a3d7b8
    Gerrit-Change-Number: 8002236
    Gerrit-PatchSet: 8
    Gerrit-Owner: Takashi Sakamoto <ta...@google.com>
    Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
    Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
    Gerrit-Reviewer: Takashi Sakamoto <ta...@google.com>
    Gerrit-Attention: Takashi Sakamoto <ta...@google.com>
    Gerrit-Comment-Date: Tue, 30 Jun 2026 05:19:08 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Lei Zhang <the...@chromium.org>
    Comment-In-Reply-To: Takashi Sakamoto <ta...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Takashi Sakamoto (Gerrit)

    unread,
    Jul 1, 2026, 1:11:57 AM (3 days ago) Jul 1
    to Lei Zhang, Keishi Hattori, Chromium LUCI CQ, chromium...@chromium.org, android-bu...@system.gserviceaccount.com, spang...@chromium.org, gavinp...@chromium.org, wfh+...@chromium.org, tracing...@chromium.org

    Takashi Sakamoto added 2 comments

    Takashi Sakamoto . resolved

    Thank you for the review.

    File base/trace_event/malloc_dump_provider.cc
    Line 811, Patchset 7: MemoryDumpPartitionStatsDumper::kPartitionsDumpName, type_id);
    Takashi Sakamoto . resolved

    ```
    "malloc/partitions/leaked/LeakedSecurityObject/%08x": { "size": ... }
    ```

    Takashi Sakamoto

    Acknowledged

    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: I5cfd717a6ac75f7fd935c191cdab641bb3a3d7b8
      Gerrit-Change-Number: 8002236
      Gerrit-PatchSet: 8
      Gerrit-Owner: Takashi Sakamoto <ta...@google.com>
      Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
      Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
      Gerrit-Reviewer: Takashi Sakamoto <ta...@google.com>
      Gerrit-Comment-Date: Wed, 01 Jul 2026 05:11:47 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Takashi Sakamoto <ta...@google.com>
      satisfied_requirement
      open
      diffy

      Takashi Sakamoto (Gerrit)

      unread,
      Jul 1, 2026, 1:11:58 AM (3 days ago) Jul 1
      to Lei Zhang, Keishi Hattori, Chromium LUCI CQ, chromium...@chromium.org, android-bu...@system.gserviceaccount.com, spang...@chromium.org, gavinp...@chromium.org, wfh+...@chromium.org, tracing...@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: I5cfd717a6ac75f7fd935c191cdab641bb3a3d7b8
      Gerrit-Change-Number: 8002236
      Gerrit-PatchSet: 8
      Gerrit-Owner: Takashi Sakamoto <ta...@google.com>
      Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
      Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
      Gerrit-Reviewer: Takashi Sakamoto <ta...@google.com>
      Gerrit-Comment-Date: Wed, 01 Jul 2026 05:11:51 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Chromium LUCI CQ (Gerrit)

      unread,
      Jul 1, 2026, 2:39:57 AM (3 days ago) Jul 1
      to Takashi Sakamoto, Lei Zhang, Keishi Hattori, chromium...@chromium.org, android-bu...@system.gserviceaccount.com, spang...@chromium.org, gavinp...@chromium.org, wfh+...@chromium.org, tracing...@chromium.org

      Chromium LUCI CQ submitted the change

      Change information

      Commit message:
      PA: Report LeakedSecurityObject's type id and total leaked size with MallocDumpProvider

      MallocDumpProvider uses partition_alloc::DumpIntendedLeakStats() to
      report leaked size per each LeakedSecurityObject's type_id. The reported
      sizes are based on `slot_size`, not `requested size`. We can see the
      data by using tracing with memory-infra.
      Bug: 501113274
      Change-Id: I5cfd717a6ac75f7fd935c191cdab641bb3a3d7b8
      Reviewed-by: Keishi Hattori <kei...@chromium.org>
      Reviewed-by: Lei Zhang <the...@chromium.org>
      Commit-Queue: Takashi Sakamoto <ta...@google.com>
      Cr-Commit-Position: refs/heads/main@{#1655293}
      Files:
      • M base/memory/safety_checks_unittest.cc
      • M base/trace_event/malloc_dump_provider.cc
      • M base/trace_event/malloc_dump_provider.h
      Change size: M
      Delta: 3 files changed, 85 insertions(+), 3 deletions(-)
      Branch: refs/heads/main
      Submit Requirements:
      • requirement satisfiedCode-Review: +1 by Lei Zhang, +1 by Keishi Hattori
      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: I5cfd717a6ac75f7fd935c191cdab641bb3a3d7b8
      Gerrit-Change-Number: 8002236
      Gerrit-PatchSet: 9
      Gerrit-Owner: Takashi Sakamoto <ta...@google.com>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
      Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
      Gerrit-Reviewer: Takashi Sakamoto <ta...@google.com>
      open
      diffy
      satisfied_requirement
      Reply all
      Reply to author
      Forward
      0 new messages