[fuchsia] Make ClientNativePixmapFuchsia thread-safe [chromium/src : main]

0 views
Skip to first unread message

Wez (Gerrit)

unread,
Sep 17, 2025, 5:05:38 AMSep 17
to Zijie He, David Worsham, Robert Kroeger, AyeAye, Chromium LUCI CQ, fuchsia...@chromium.org, emi...@google.com, ozone-...@chromium.org, spang...@chromium.org
Attention needed from Zijie He

Wez added 7 comments

Patchset-level comments
File-level comment, Patchset 6 (Latest):
Wez . unresolved

This seems fine, but the only caller of `ClientNativePixmap::Map()` seems to be a `LegacyCpuMemoryBuffer` code path (see https://source.chromium.org/chromium/chromium/src/+/main:gpu/ipc/common/legacy_gpu_memory_buffer_for_video.cc;l=69) which applies locking around the operations.

So it seems to be the case that (1) `ClientNativePixmap` is deprecated and (2) the interface's implementations need _not_ be _thread-safe_ (i.e. internally synchrony ized), but must be _thread-compatible_ or _thread-unsafe_ (i.e. OK to use with appropriate caller synchronization). Our current `ClientNativePixmapFuchsia` has a _thread-compatible_ implementation but imposes _thread-hostile_ sequence checks.

File build/config/dcheck_always_on.gni
Line 17, Patchset 6 (Latest):# DO NOT SUBMIT
dcheck_always_on = true
Wez . unresolved

FYI, you can just hack the default for the arg in-place, leaving the `declare_args()` otherwise intact, for tests like this, in future 😊

File ui/gfx/client_native_pixmap.h
Line 17, Patchset 6 (Latest):// Functions in this class need to be thread-safe, they can be called from
// different threads.
Wez . unresolved

Is this true, or is it only the case that the `Map()` and `Unmap()` (and `GetNumberOfPlanes()` etc?) operations may be called on a different sequence from the setup/teardown sequence?

File ui/ozone/platform/flatland/client_native_pixmap_factory_flatland.cc
Line 32, Patchset 6 (Latest): base::AutoLock lock(lock_);
Wez . unresolved

This isn't incorrect per-se, but it should not be necessary, since by definition if we have accesses to `this` racing with destruction then we have bigger problems.

If possible I think it would be clearer to have two `SEQUENCE_CHECKER()`s in this object, one checked on construction & destruction, and the other initial un-bound, and checked in `Map()`, `Unmap()`, etc - that would express the constraint that the object _can_ be created & torn-down on a different sequence to the one on which it is used, but that it must be used from a consistent sequence, which I think is the actual property required here?

Line 113, Patchset 6 (Latest): base::AutoLock lock(lock_);
return handle_.planes.size();
Wez . unresolved

nit: This is only working via the `handle_`, which is `const`, so presumably no need for locking here?

Line 125, Patchset 6 (Latest): base::AutoLock lock(lock_);
Wez . unresolved

`handle_` is `const`, so no need to lock here?

Line 131, Patchset 6 (Latest): base::AutoLock lock(lock_);
Wez . unresolved

No need for lock because `handle_` is `const`.

Open in Gerrit

Related details

Attention is currently required from:
  • Zijie He
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: If10d327f05d65e175738d6a2780c889900596725
Gerrit-Change-Number: 6909839
Gerrit-PatchSet: 6
Gerrit-Owner: Zijie He <zij...@google.com>
Gerrit-Reviewer: Zijie He <zij...@google.com>
Gerrit-CC: David Worsham <dwor...@google.com>
Gerrit-CC: Robert Kroeger <rjkr...@chromium.org>
Gerrit-CC: Wez <w...@chromium.org>
Gerrit-Attention: Zijie He <zij...@google.com>
Gerrit-Comment-Date: Wed, 17 Sep 2025 09:05:25 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Zijie He (Gerrit)

unread,
Sep 17, 2025, 12:42:59 PMSep 17
to David Worsham, Robert Kroeger, AyeAye, Chromium LUCI CQ, fuchsia...@chromium.org, emi...@google.com, ozone-...@chromium.org, spang...@chromium.org

Zijie He added 2 comments

Patchset-level comments
Wez . unresolved

This seems fine, but the only caller of `ClientNativePixmap::Map()` seems to be a `LegacyCpuMemoryBuffer` code path (see https://source.chromium.org/chromium/chromium/src/+/main:gpu/ipc/common/legacy_gpu_memory_buffer_for_video.cc;l=69) which applies locking around the operations.

So it seems to be the case that (1) `ClientNativePixmap` is deprecated and (2) the interface's implementations need _not_ be _thread-safe_ (i.e. internally synchrony ized), but must be _thread-compatible_ or _thread-unsafe_ (i.e. OK to use with appropriate caller synchronization). Our current `ClientNativePixmapFuchsia` has a _thread-compatible_ implementation but imposes _thread-hostile_ sequence checks.

Zijie He

Emmm, interesting, I never saw this class in the stack trace before. But considering you fixed the destruction sequence, I am rerunning https://crrev.com/i/8394026 and will get the latest failures if any.

File ui/ozone/platform/flatland/client_native_pixmap_factory_flatland.cc
Line 125, Patchset 6 (Latest): base::AutoLock lock(lock_);
Wez . unresolved

`handle_` is `const`, so no need to lock here?

Zijie He

Ah, yes, I think I messed two different intentions altogether; the const was also added in this CL. So yes, locking in this function is not necessary.

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: If10d327f05d65e175738d6a2780c889900596725
Gerrit-Change-Number: 6909839
Gerrit-PatchSet: 6
Gerrit-Owner: Zijie He <zij...@google.com>
Gerrit-Reviewer: Zijie He <zij...@google.com>
Gerrit-CC: David Worsham <dwor...@google.com>
Gerrit-CC: Robert Kroeger <rjkr...@chromium.org>
Gerrit-CC: Wez <w...@chromium.org>
Gerrit-Comment-Date: Wed, 17 Sep 2025 16:42:49 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Wez <w...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Zijie He (Gerrit)

unread,
Sep 17, 2025, 4:20:42 PMSep 17
to David Worsham, Robert Kroeger, AyeAye, Chromium LUCI CQ, fuchsia...@chromium.org, emi...@google.com, ozone-...@chromium.org, spang...@chromium.org
Attention needed from Wez

Zijie He added 1 comment

File ui/ozone/platform/flatland/client_native_pixmap_factory_flatland.cc
Line 32, Patchset 6 (Latest): base::AutoLock lock(lock_);
Wez . unresolved

This isn't incorrect per-se, but it should not be necessary, since by definition if we have accesses to `this` racing with destruction then we have bigger problems.

If possible I think it would be clearer to have two `SEQUENCE_CHECKER()`s in this object, one checked on construction & destruction, and the other initial un-bound, and checked in `Map()`, `Unmap()`, etc - that would express the constraint that the object _can_ be created & torn-down on a different sequence to the one on which it is used, but that it must be used from a consistent sequence, which I think is the actual property required here?

Zijie He

It's possible that constructor and destructor is using a different sequence than Map() & Unmap(), but the problem is that the destructor calls Unmap() conditionally below. Also technically speaking, accessing mapping_ needs to be thread protected if Map() can be executed in a different thread.

Open in Gerrit

Related details

Attention is currently required from:
  • Wez
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: If10d327f05d65e175738d6a2780c889900596725
Gerrit-Change-Number: 6909839
Gerrit-PatchSet: 6
Gerrit-Owner: Zijie He <zij...@google.com>
Gerrit-Reviewer: Zijie He <zij...@google.com>
Gerrit-CC: David Worsham <dwor...@google.com>
Gerrit-CC: Robert Kroeger <rjkr...@chromium.org>
Gerrit-CC: Wez <w...@chromium.org>
Gerrit-Attention: Wez <w...@chromium.org>
Gerrit-Comment-Date: Wed, 17 Sep 2025 20:20:32 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Wez (Gerrit)

unread,
Sep 18, 2025, 5:30:51 AMSep 18
to Zijie He, David Worsham, Robert Kroeger, AyeAye, Chromium LUCI CQ, fuchsia...@chromium.org, emi...@google.com, ozone-...@chromium.org, spang...@chromium.org
Attention needed from Zijie He

Wez added 1 comment

File ui/ozone/platform/flatland/client_native_pixmap_factory_flatland.cc
Line 32, Patchset 6 (Latest): base::AutoLock lock(lock_);
Wez . unresolved

This isn't incorrect per-se, but it should not be necessary, since by definition if we have accesses to `this` racing with destruction then we have bigger problems.

If possible I think it would be clearer to have two `SEQUENCE_CHECKER()`s in this object, one checked on construction & destruction, and the other initial un-bound, and checked in `Map()`, `Unmap()`, etc - that would express the constraint that the object _can_ be created & torn-down on a different sequence to the one on which it is used, but that it must be used from a consistent sequence, which I think is the actual property required here?

Zijie He

It's possible that constructor and destructor is using a different sequence than Map() & Unmap(), but the problem is that the destructor calls Unmap() conditionally below. Also technically speaking, accessing mapping_ needs to be thread protected if Map() can be executed in a different thread.

Wez

It's possible that constructor and destructor is using a different sequence than Map() & Unmap(), but the problem is that the destructor calls Unmap() conditionally below.

If there is a `Map()` or `Unmap()` in-flight while the destructor is running then all bets are already off - adding locking just means that the in-flight call could run _after_ the destructor completes and releases the lock, at which point the object is gone and you have UaF.

As-is the logic will actually deadlock, unless the `Lock` implementation is re-entrant, since both the destructor and `Unmap()` are locking the object.

Also technically speaking, accessing mapping_ needs to be thread protected if Map() can be executed in a different thread.

No other operations can be running on other threads at the point when the destructor executes, or all bets are off. There are special-cases where that could work, e.g. the object itself has an internal thread and blocks in the destructor until it exits, but that's not the situation here.

Even if we did need to `AutoLock` to access `mapping_`, to appease the threading annotations checker, `mapping_` has an invariant (in the current implementation) that it can only change from not-set to set, since `Unmap()` flushes the cache without actually un-mapping the memory. So we can lock, check the value, and unlock and (because we know it would be intrinsically unsafe for `Map()` to run concurrently with destruction) we can then unlock before doing the conditional work.

However, I suspect that the caller just creates/destroys on one sequence and map/unmaps on a different one, and takes care of ensuring that is safe, so that we just need to relax the sequence-checker constraint that currently regards this class as thread-hostile.

Open in Gerrit

Related details

Attention is currently required from:
  • Zijie He
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: If10d327f05d65e175738d6a2780c889900596725
Gerrit-Change-Number: 6909839
Gerrit-PatchSet: 6
Gerrit-Owner: Zijie He <zij...@google.com>
Gerrit-Reviewer: Zijie He <zij...@google.com>
Gerrit-CC: David Worsham <dwor...@google.com>
Gerrit-CC: Robert Kroeger <rjkr...@chromium.org>
Gerrit-CC: Wez <w...@chromium.org>
Gerrit-Attention: Zijie He <zij...@google.com>
Gerrit-Comment-Date: Thu, 18 Sep 2025 09:30:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Wez <w...@chromium.org>
Comment-In-Reply-To: Zijie He <zij...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Zijie He (Gerrit)

unread,
Sep 18, 2025, 2:14:22 PMSep 18
to David Worsham, Robert Kroeger, AyeAye, Chromium LUCI CQ, fuchsia...@chromium.org, emi...@google.com, ozone-...@chromium.org, spang...@chromium.org

Zijie He added 1 comment

File ui/ozone/platform/flatland/client_native_pixmap_factory_flatland.cc
Line 32, Patchset 6 (Latest): base::AutoLock lock(lock_);
Wez . unresolved

This isn't incorrect per-se, but it should not be necessary, since by definition if we have accesses to `this` racing with destruction then we have bigger problems.

If possible I think it would be clearer to have two `SEQUENCE_CHECKER()`s in this object, one checked on construction & destruction, and the other initial un-bound, and checked in `Map()`, `Unmap()`, etc - that would express the constraint that the object _can_ be created & torn-down on a different sequence to the one on which it is used, but that it must be used from a consistent sequence, which I think is the actual property required here?

Zijie He

It's possible that constructor and destructor is using a different sequence than Map() & Unmap(), but the problem is that the destructor calls Unmap() conditionally below. Also technically speaking, accessing mapping_ needs to be thread protected if Map() can be executed in a different thread.

Wez

It's possible that constructor and destructor is using a different sequence than Map() & Unmap(), but the problem is that the destructor calls Unmap() conditionally below.

If there is a `Map()` or `Unmap()` in-flight while the destructor is running then all bets are already off - adding locking just means that the in-flight call could run _after_ the destructor completes and releases the lock, at which point the object is gone and you have UaF.

As-is the logic will actually deadlock, unless the `Lock` implementation is re-entrant, since both the destructor and `Unmap()` are locking the object.

Also technically speaking, accessing mapping_ needs to be thread protected if Map() can be executed in a different thread.

No other operations can be running on other threads at the point when the destructor executes, or all bets are off. There are special-cases where that could work, e.g. the object itself has an internal thread and blocks in the destructor until it exits, but that's not the situation here.

Even if we did need to `AutoLock` to access `mapping_`, to appease the threading annotations checker, `mapping_` has an invariant (in the current implementation) that it can only change from not-set to set, since `Unmap()` flushes the cache without actually un-mapping the memory. So we can lock, check the value, and unlock and (because we know it would be intrinsically unsafe for `Map()` to run concurrently with destruction) we can then unlock before doing the conditional work.

However, I suspect that the caller just creates/destroys on one sequence and map/unmaps on a different one, and takes care of ensuring that is safe, so that we just need to relax the sequence-checker constraint that currently regards this class as thread-hostile.

Zijie He

I never thought a project as large as chromium would prefer non-nestable locks, it's way too easy to be abused, comparing to the performance benefit we achieve. But I do take a look at the code and notice that it is not guaranteed nestable. Anyway 😂.
I agree the lock in the destructor is overreacting, I assume `zx::vmar::root_self()->unmap` needs no thread-protection.

But using two sequence-checkers does not work, we do know that the destructor and Map() are running on different threads.

On the other hand, it's a great idea to relax the sequence-checker constraint. It fails and serves no purpose. I can quickly remove the sequence-checker, enable the DCHECK in our builders, and come back for a proper fix.

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: If10d327f05d65e175738d6a2780c889900596725
Gerrit-Change-Number: 6909839
Gerrit-PatchSet: 6
Gerrit-Owner: Zijie He <zij...@google.com>
Gerrit-Reviewer: Wez <w...@chromium.org>
Gerrit-Reviewer: Zijie He <zij...@google.com>
Gerrit-CC: David Worsham <dwor...@google.com>
Gerrit-CC: Robert Kroeger <rjkr...@chromium.org>
Gerrit-Comment-Date: Thu, 18 Sep 2025 18:14:10 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Wez (Gerrit)

unread,
Sep 19, 2025, 5:44:08 AMSep 19
to Zijie He, David Worsham, Robert Kroeger, AyeAye, Chromium LUCI CQ, fuchsia...@chromium.org, emi...@google.com, ozone-...@chromium.org, spang...@chromium.org
Attention needed from Zijie He

Wez added 1 comment

File ui/ozone/platform/flatland/client_native_pixmap_factory_flatland.cc
Line 32, Patchset 6 (Latest): base::AutoLock lock(lock_);
Wez . unresolved

This isn't incorrect per-se, but it should not be necessary, since by definition if we have accesses to `this` racing with destruction then we have bigger problems.

If possible I think it would be clearer to have two `SEQUENCE_CHECKER()`s in this object, one checked on construction & destruction, and the other initial un-bound, and checked in `Map()`, `Unmap()`, etc - that would express the constraint that the object _can_ be created & torn-down on a different sequence to the one on which it is used, but that it must be used from a consistent sequence, which I think is the actual property required here?

Zijie He

It's possible that constructor and destructor is using a different sequence than Map() & Unmap(), but the problem is that the destructor calls Unmap() conditionally below. Also technically speaking, accessing mapping_ needs to be thread protected if Map() can be executed in a different thread.

Wez

It's possible that constructor and destructor is using a different sequence than Map() & Unmap(), but the problem is that the destructor calls Unmap() conditionally below.

If there is a `Map()` or `Unmap()` in-flight while the destructor is running then all bets are already off - adding locking just means that the in-flight call could run _after_ the destructor completes and releases the lock, at which point the object is gone and you have UaF.

As-is the logic will actually deadlock, unless the `Lock` implementation is re-entrant, since both the destructor and `Unmap()` are locking the object.

Also technically speaking, accessing mapping_ needs to be thread protected if Map() can be executed in a different thread.

No other operations can be running on other threads at the point when the destructor executes, or all bets are off. There are special-cases where that could work, e.g. the object itself has an internal thread and blocks in the destructor until it exits, but that's not the situation here.

Even if we did need to `AutoLock` to access `mapping_`, to appease the threading annotations checker, `mapping_` has an invariant (in the current implementation) that it can only change from not-set to set, since `Unmap()` flushes the cache without actually un-mapping the memory. So we can lock, check the value, and unlock and (because we know it would be intrinsically unsafe for `Map()` to run concurrently with destruction) we can then unlock before doing the conditional work.

However, I suspect that the caller just creates/destroys on one sequence and map/unmaps on a different one, and takes care of ensuring that is safe, so that we just need to relax the sequence-checker constraint that currently regards this class as thread-hostile.

Zijie He

I never thought a project as large as chromium would prefer non-nestable locks, it's way too easy to be abused, comparing to the performance benefit we achieve. But I do take a look at the code and notice that it is not guaranteed nestable. Anyway 😂.
I agree the lock in the destructor is overreacting, I assume `zx::vmar::root_self()->unmap` needs no thread-protection.

But using two sequence-checkers does not work, we do know that the destructor and Map() are running on different threads.

On the other hand, it's a great idea to relax the sequence-checker constraint. It fails and serves no purpose. I can quickly remove the sequence-checker, enable the DCHECK in our builders, and come back for a proper fix.

Wez

[snip]


> But using two sequence-checkers does not work, we do know that the destructor and Map() are running on different threads.

That's why I'm suggesting using two distinct sequence-checkers - one to ensure same-sequence use of map/unmap and a separate one for create/destroy. The map/unmap one would likely need to be "detached" on destruction, to prevent it from `DCHECK`ing, though.

On the other hand, it's a great idea to relax the sequence-checker constraint. It fails and serves no purpose. I can quickly remove the sequence-checker, enable the DCHECK in our builders, and come back for a proper fix.

Open in Gerrit

Related details

Attention is currently required from:
  • Zijie He
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: If10d327f05d65e175738d6a2780c889900596725
Gerrit-Change-Number: 6909839
Gerrit-PatchSet: 6
Gerrit-Owner: Zijie He <zij...@google.com>
Gerrit-Reviewer: Wez <w...@chromium.org>
Gerrit-Reviewer: Zijie He <zij...@google.com>
Gerrit-CC: David Worsham <dwor...@google.com>
Gerrit-CC: Robert Kroeger <rjkr...@chromium.org>
Gerrit-Attention: Zijie He <zij...@google.com>
Gerrit-Comment-Date: Fri, 19 Sep 2025 09:43:55 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Zijie He (Gerrit)

unread,
Sep 19, 2025, 3:07:38 PMSep 19
to David Song, David Worsham, Robert Kroeger, AyeAye, Chromium LUCI CQ, fuchsia...@chromium.org, emi...@google.com, ozone-...@chromium.org, spang...@chromium.org
Attention needed from Wez

Zijie He added 1 comment

File ui/ozone/platform/flatland/client_native_pixmap_factory_flatland.cc
Zijie He

The unmap is called conditionally in the destructor, so unless one of the followings is true,
1. destructor is running in the same thread as unmap
2. destructor and unmap are cross-thread protected by the caller
3. the unmap is not necessary in the destructor / CHECK(!mapping_) in line 33
using two sequence-checkers would only prove the assumption without solving the issue.

We know 1 is not true. 2 and 3 need extra investigation.

I am very happy to solve the underlying issue, but it definitely needs more deep investigation, and it's the reason I am moving forward with a simple https://crrev.com/c/6965663 to unblock the enablement of DCHECKs first.

Open in Gerrit

Related details

Attention is currently required from:
  • Wez
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: If10d327f05d65e175738d6a2780c889900596725
Gerrit-Change-Number: 6909839
Gerrit-PatchSet: 6
Gerrit-Owner: Zijie He <zij...@google.com>
Gerrit-Reviewer: Wez <w...@chromium.org>
Gerrit-Reviewer: Zijie He <zij...@google.com>
Gerrit-CC: David Song <winter...@google.com>
Gerrit-CC: David Worsham <dwor...@google.com>
Gerrit-CC: Robert Kroeger <rjkr...@chromium.org>
Gerrit-Attention: Wez <w...@chromium.org>
Gerrit-Comment-Date: Fri, 19 Sep 2025 19:07:29 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Wez (Gerrit)

unread,
Sep 22, 2025, 11:28:27 AMSep 22
to Zijie He, David Song, David Worsham, Robert Kroeger, AyeAye, Chromium LUCI CQ, fuchsia...@chromium.org, emi...@google.com, ozone-...@chromium.org, spang...@chromium.org
Attention needed from Zijie He

Wez voted and added 2 comments

Votes added by Wez

Code-Review+1

2 comments

Patchset-level comments
Wez . resolved

LGTM w/ the DO NOT SUBMIT bit not submitted.

File ui/ozone/platform/flatland/client_native_pixmap_factory_flatland.cc
Line 32, Patchset 6 (Latest): base::AutoLock lock(lock_);
Wez . resolved
Wez

Acknowledged

Open in Gerrit

Related details

Attention is currently required from:
  • Zijie He
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: If10d327f05d65e175738d6a2780c889900596725
    Gerrit-Change-Number: 6909839
    Gerrit-PatchSet: 6
    Gerrit-Owner: Zijie He <zij...@google.com>
    Gerrit-Reviewer: Wez <w...@chromium.org>
    Gerrit-Reviewer: Zijie He <zij...@google.com>
    Gerrit-CC: David Song <winter...@google.com>
    Gerrit-CC: David Worsham <dwor...@google.com>
    Gerrit-CC: Robert Kroeger <rjkr...@chromium.org>
    Gerrit-Attention: Zijie He <zij...@google.com>
    Gerrit-Comment-Date: Mon, 22 Sep 2025 15:28:12 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Zijie He (Gerrit)

    unread,
    Sep 22, 2025, 2:29:52 PMSep 22
    to David Song, David Worsham, Robert Kroeger, AyeAye, Chromium LUCI CQ, fuchsia...@chromium.org, emi...@google.com, ozone-...@chromium.org, spang...@chromium.org
    Attention needed from Wez and Zijie He

    Message from Zijie He

    Set Ready For Review

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Wez
    • Zijie He
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: If10d327f05d65e175738d6a2780c889900596725
    Gerrit-Change-Number: 6909839
    Gerrit-PatchSet: 8
    Gerrit-Owner: Zijie He <zij...@google.com>
    Gerrit-Reviewer: Wez <w...@chromium.org>
    Gerrit-Reviewer: Zijie He <zij...@google.com>
    Gerrit-CC: David Song <winter...@google.com>
    Gerrit-CC: David Worsham <dwor...@google.com>
    Gerrit-CC: Robert Kroeger <rjkr...@chromium.org>
    Gerrit-Attention: Wez <w...@chromium.org>
    Gerrit-Attention: Zijie He <zij...@google.com>
    Gerrit-Comment-Date: Mon, 22 Sep 2025 18:29:40 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Zijie He (Gerrit)

    unread,
    Sep 22, 2025, 4:19:17 PMSep 22
    to David Song, David Worsham, Robert Kroeger, AyeAye, Chromium LUCI CQ, fuchsia...@chromium.org, emi...@google.com, ozone-...@chromium.org, spang...@chromium.org

    Zijie He voted and added 5 comments

    Votes added by Zijie He

    Commit-Queue+1

    5 comments

    File build/config/dcheck_always_on.gni
    Line 17, Patchset 6:# DO NOT SUBMIT
    dcheck_always_on = true
    Wez . resolved

    FYI, you can just hack the default for the arg in-place, leaving the `declare_args()` otherwise intact, for tests like this, in future 😊

    Zijie He

    This change is unnecessary after https://crrev.com/i/8394026 🎉

    (The problem of keeping it as declare_args is that the infra/config is very complicated, and it's hard to tell if any GN args are overridden.)

    File ui/gfx/client_native_pixmap.h
    Line 17, Patchset 6:// Functions in this class need to be thread-safe, they can be called from
    // different threads.
    Wez . unresolved

    Is this true, or is it only the case that the `Map()` and `Unmap()` (and `GetNumberOfPlanes()` etc?) operations may be called on a different sequence from the setup/teardown sequence?

    Zijie He

    It's a good point, I will continue the investigation.

    But also, even we are talking about the interface ClientNativePixmap, it can be used by different callers, and some of them may abuse it.

    I believe we need to also add sequence checkers in the ui/gfx/linux/client_native_pixmap_dmabuf.cc to see if the same code path would be triggered on linux.

    File ui/ozone/platform/flatland/client_native_pixmap_factory_flatland.cc
    Line 113, Patchset 6: base::AutoLock lock(lock_);
    return handle_.planes.size();
    Wez . resolved

    nit: This is only working via the `handle_`, which is `const`, so presumably no need for locking here?

    Zijie He

    Done

    Line 125, Patchset 6: base::AutoLock lock(lock_);
    Wez . resolved

    `handle_` is `const`, so no need to lock here?

    Zijie He

    Ah, yes, I think I messed two different intentions altogether; the const was also added in this CL. So yes, locking in this function is not necessary.

    Zijie He

    Done

    Line 131, Patchset 6: base::AutoLock lock(lock_);
    Wez . resolved

    No need for lock because `handle_` is `const`.

    Zijie He

    Done

    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: If10d327f05d65e175738d6a2780c889900596725
    Gerrit-Change-Number: 6909839
    Gerrit-PatchSet: 12
    Gerrit-Owner: Zijie He <zij...@google.com>
    Gerrit-Reviewer: Wez <w...@chromium.org>
    Gerrit-Reviewer: Zijie He <zij...@google.com>
    Gerrit-CC: David Song <winter...@google.com>
    Gerrit-CC: David Worsham <dwor...@google.com>
    Gerrit-CC: Robert Kroeger <rjkr...@chromium.org>
    Gerrit-Comment-Date: Mon, 22 Sep 2025 20:19:08 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Zijie He (Gerrit)

    unread,
    Sep 30, 2025, 1:20:20 PM (7 days ago) Sep 30
    to David Song, David Worsham, Robert Kroeger, AyeAye, Chromium LUCI CQ, fuchsia...@chromium.org, emi...@google.com, ozone-...@chromium.org, spang...@chromium.org

    Zijie He abandoned this change

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: abandon
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: If10d327f05d65e175738d6a2780c889900596725
    Gerrit-Change-Number: 6909839
    Gerrit-PatchSet: 13
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages