Optimize small memory reads when writing iOS intermediate dumps. [crashpad/crashpad : main]

4 views
Skip to first unread message

Justin Cohen (Gerrit)

unread,
Mar 19, 2026, 1:31:44 PM (6 days ago) Mar 19
to Mark Mentovai, crashp...@chromium.org
Attention needed from Mark Mentovai

Justin Cohen added 1 comment

Patchset-level comments
File-level comment, Patchset 8 (Latest):
Justin Cohen . resolved

ptal! Initially this CL was scoped only to the reg capture, but I wonder if this would be valuable everywhere?

Open in Gerrit

Related details

Attention is currently required from:
  • Mark Mentovai
Submit Requirements:
  • requirement 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: crashpad/crashpad
Gerrit-Branch: main
Gerrit-Change-Id: I2013329ce719b2bbcb61ab83fb3c77e8af825ff2
Gerrit-Change-Number: 7685150
Gerrit-PatchSet: 8
Gerrit-Owner: Justin Cohen <justi...@google.com>
Gerrit-Reviewer: Mark Mentovai <ma...@chromium.org>
Gerrit-Attention: Mark Mentovai <ma...@chromium.org>
Gerrit-Comment-Date: Thu, 19 Mar 2026 17:31:41 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Mark Mentovai (Gerrit)

unread,
Mar 24, 2026, 11:14:21 AM (20 hours ago) Mar 24
to Justin Cohen, Code Review Nudger, crashp...@chromium.org
Attention needed from Justin Cohen

Mark Mentovai added 1 comment

File util/ios/ios_intermediate_dump_writer.h
Line 178, Patchset 9 (Latest): //! \brief Adds a property using `vm_read` for arbitrary-sized memory blocks.
//!
//! \return `true` if able to `vm_read` `value` `value_length` and write a
//! kProperty command with the `key` `value` `value_length` tuple.
//!
//! \note This method allocates a new VM page via `vm_read` in the calling
//! task's footprint. It should only be used for large memory reads
//! (e.g. thread stacks) where allocating a local stack buffer is unsafe.
bool AddPropertyBytesLarge(IntermediateDumpKey key,
const void* value,
size_t value_length);

//! \brief Adds a property using `vm_read_overwrite` and a local stack buffer.
//!
//! \return `true` if able to `vm_read_overwrite` `value` `value_length`
//! and write a kProperty command with the `key` `value` `value_length`
//! tuple.
//!
//! \note This method uses a `kMaxPropertyBytesSmallSize`-byte local stack
//! buffer to avoid allocating new virtual memory pages during the read.
//! `value_length` must be <= `kMaxPropertyBytesSmallSize`.
bool AddPropertyBytesSmall(IntermediateDumpKey key,
const void* value,
size_t value_length);
Mark Mentovai . unresolved

Can `AddPropertyBytes` take care of making the decision on its own, so we don’t need to pollute all of the call sites?

(Then `kMaxPropertyBytesSmallSize` wouldn’t need to be exposed either.)

Open in Gerrit

Related details

Attention is currently required from:
  • Justin Cohen
Submit Requirements:
    • requirement 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: crashpad/crashpad
    Gerrit-Branch: main
    Gerrit-Change-Id: I2013329ce719b2bbcb61ab83fb3c77e8af825ff2
    Gerrit-Change-Number: 7685150
    Gerrit-PatchSet: 9
    Gerrit-Owner: Justin Cohen <justi...@google.com>
    Gerrit-Reviewer: Mark Mentovai <ma...@chromium.org>
    Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
    Gerrit-Attention: Justin Cohen <justi...@google.com>
    Gerrit-Comment-Date: Tue, 24 Mar 2026 15:14:19 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages