[M] Change in dart/sdk[main]: [vm/service]: Add _readNativeMemory RPC and OS::SafeReadMemory for sa...

1 view
Skip to first unread message

Ben Konyi (Gerrit)

unread,
May 25, 2026, 10:30:08 AM (9 days ago) May 25
to Nourhan Hasan, Daco Harkes, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Daco Harkes and Nourhan Hasan

Ben Konyi voted and added 6 comments

Votes added by Ben Konyi

Commit-Queue+1

6 comments

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Ben Konyi . resolved

Looking good so far!

File runtime/vm/service.cc
Line 6266, Patchset 1 (Latest): uint8_t* buffer = reinterpret_cast<uint8_t*>(malloc(size));
Ben Konyi . unresolved

I think we can use `CAllocUniquePtr<uint8_t>(malloc(size))` here to handle cleanup automatically.

Line 6288, Patchset 1 (Latest): char* hex = reinterpret_cast<char*>(malloc(size * 2 + 1));
Ben Konyi . unresolved

Same here, but with `CStringUniquePtr(malloc(size * 2 + 1))`.

Line 6296, Patchset 1 (Latest): response.AddProperty("error", "address not readable");
Ben Konyi . unresolved

I think we should define another error code here and use `response.PrintError(...)` instead.

The error codes are in `json_stream.h` and we can just add to the set of experimental RPC codes for now.

Line 6302, Patchset 1 (Latest): new StringParameter("address", true),
Ben Konyi . unresolved

Since we're using `"address"` and `"size"` in multiple places, I'd define constants for each and use them in place of the raw string literals. That way tooling can help autocomplete references to these parameter names and the compiler will catch any typos.

We'll also want to do the same with the response values.

Line 6307, Patchset 1 (Latest):static void ReadNativeMemory(Thread* thread, JSONStream* js) {
Ben Konyi . unresolved

Can you document the parameters and the formats of the possible response types?

Open in Gerrit

Related details

Attention is currently required from:
  • Daco Harkes
  • Nourhan Hasan
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement satisfiedCommit-Message-Has-TEST
  • 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: sdk
Gerrit-Branch: main
Gerrit-Change-Id: Id15a82bf478bc4822c08d7fdf0a5c8bfd71a1fe0
Gerrit-Change-Number: 505781
Gerrit-PatchSet: 1
Gerrit-Owner: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Reviewer: Ben Konyi <bko...@google.com>
Gerrit-Reviewer: Daco Harkes <dacoh...@google.com>
Gerrit-Reviewer: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Attention: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Attention: Daco Harkes <dacoh...@google.com>
Gerrit-Comment-Date: Mon, 25 May 2026 14:30:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
unsatisfied_requirement
satisfied_requirement
open
diffy

Daco Harkes (Gerrit)

unread,
May 26, 2026, 3:39:51 AM (9 days ago) May 26
to Nourhan Hasan, dart-...@luci-project-accounts.iam.gserviceaccount.com, Ben Konyi, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Ben Konyi and Nourhan Hasan

Daco Harkes added 5 comments

File runtime/vm/os.h
Line 74, Patchset 1 (Latest): static bool SafeReadMemory(uintptr_t address, uint8_t* buffer, intptr_t size);
Daco Harkes . unresolved

We should add a `char** error` parameter to return any error. That way we can return the error provided by the underlying OS call.

Line 74, Patchset 1 (Latest): static bool SafeReadMemory(uintptr_t address, uint8_t* buffer, intptr_t size);
Daco Harkes . unresolved

Nit: size_in_bytes as param name.

File runtime/vm/os_android.cc
Line 226, Patchset 1 (Latest): ssize_t bytes_read = pread64(fd, buffer, size, static_cast<off64_t>(address));
Daco Harkes . unresolved

if bytes_read is -1

`strerror(errno)` to get a readable error message to return. (Or `strerror_r`)

File runtime/vm/service.cc
Line 6256, Patchset 1 (Latest): if (address > kMaxUserAddr) {
Daco Harkes . unresolved

We could possibly rely on the -1 return value to see an error and use `errno` to get the error from the OS. (It will probably just return "bad address").

File runtime/vm/service_test.cc
Line 735, Patchset 1 (Latest): EXPECT_SUBSTRING("\"bytes\":\"0102030405060708\"", handler.msg());
Daco Harkes . unresolved

🔥

Open in Gerrit

Related details

Attention is currently required from:
  • Ben Konyi
  • Nourhan Hasan
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement satisfiedCommit-Message-Has-TEST
  • 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: sdk
Gerrit-Branch: main
Gerrit-Change-Id: Id15a82bf478bc4822c08d7fdf0a5c8bfd71a1fe0
Gerrit-Change-Number: 505781
Gerrit-PatchSet: 1
Gerrit-Owner: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Reviewer: Ben Konyi <bko...@google.com>
Gerrit-Reviewer: Daco Harkes <dacoh...@google.com>
Gerrit-Reviewer: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Attention: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Attention: Ben Konyi <bko...@google.com>
Gerrit-Comment-Date: Tue, 26 May 2026 07:39:47 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
satisfied_requirement
open
diffy

Nourhan Hasan (Gerrit)

unread,
May 26, 2026, 7:02:46 AM (8 days ago) May 26
to dart-...@luci-project-accounts.iam.gserviceaccount.com, Ben Konyi, Daco Harkes, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Ben Konyi

Nourhan Hasan added 1 comment

File runtime/vm/service.cc
Line 6302, Patchset 1 (Latest): new StringParameter("address", true),
Ben Konyi . unresolved

Since we're using `"address"` and `"size"` in multiple places, I'd define constants for each and use them in place of the raw string literals. That way tooling can help autocomplete references to these parameter names and the compiler will catch any typos.

We'll also want to do the same with the response values.

Nourhan Hasan

Regarding the response, do you mean something similar that is defined at the top of runtime/vm/service.cc?
```
static constexpr const char* kNativeMemoryAddressParam = "address";
static constexpr const char* kNativeMemorySizeParam = "size";
static constexpr const char* kNativeMemoryBytesKey = "bytes";
static constexpr const char* kNativeMemoryErrorKey = "error";
```

Open in Gerrit

Related details

Attention is currently required from:
  • Ben Konyi
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement satisfiedCommit-Message-Has-TEST
  • 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: sdk
Gerrit-Branch: main
Gerrit-Change-Id: Id15a82bf478bc4822c08d7fdf0a5c8bfd71a1fe0
Gerrit-Change-Number: 505781
Gerrit-PatchSet: 1
Gerrit-Owner: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Reviewer: Ben Konyi <bko...@google.com>
Gerrit-Reviewer: Daco Harkes <dacoh...@google.com>
Gerrit-Reviewer: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Attention: Ben Konyi <bko...@google.com>
Gerrit-Comment-Date: Tue, 26 May 2026 11:02:41 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Ben Konyi <bko...@google.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Nourhan Hasan (Gerrit)

unread,
May 27, 2026, 3:04:43 AM (8 days ago) May 27
to dart-...@luci-project-accounts.iam.gserviceaccount.com, Ben Konyi, Daco Harkes, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Ben Konyi and Daco Harkes

Nourhan Hasan voted and added 8 comments

Votes added by Nourhan Hasan

Auto-Submit+1

8 comments

File runtime/vm/os.h
Line 74, Patchset 1: static bool SafeReadMemory(uintptr_t address, uint8_t* buffer, intptr_t size);
Daco Harkes . resolved

Nit: size_in_bytes as param name.

Nourhan Hasan

Done

Line 74, Patchset 1: static bool SafeReadMemory(uintptr_t address, uint8_t* buffer, intptr_t size);
Daco Harkes . resolved

We should add a `char** error` parameter to return any error. That way we can return the error provided by the underlying OS call.

Nourhan Hasan

Done

File runtime/vm/os_android.cc
Line 226, Patchset 1: ssize_t bytes_read = pread64(fd, buffer, size, static_cast<off64_t>(address));
Daco Harkes . resolved

if bytes_read is -1

`strerror(errno)` to get a readable error message to return. (Or `strerror_r`)

Nourhan Hasan

Done

File runtime/vm/service.cc
Line 6256, Patchset 1: if (address > kMaxUserAddr) {
Daco Harkes . resolved

We could possibly rely on the -1 return value to see an error and use `errno` to get the error from the OS. (It will probably just return "bad address").

Nourhan Hasan

Done

Line 6266, Patchset 1: uint8_t* buffer = reinterpret_cast<uint8_t*>(malloc(size));
Ben Konyi . resolved

I think we can use `CAllocUniquePtr<uint8_t>(malloc(size))` here to handle cleanup automatically.

Nourhan Hasan

Done

Line 6288, Patchset 1: char* hex = reinterpret_cast<char*>(malloc(size * 2 + 1));
Ben Konyi . resolved

Same here, but with `CStringUniquePtr(malloc(size * 2 + 1))`.

Nourhan Hasan

Done

Line 6296, Patchset 1: response.AddProperty("error", "address not readable");
Ben Konyi . resolved

I think we should define another error code here and use `response.PrintError(...)` instead.

The error codes are in `json_stream.h` and we can just add to the set of experimental RPC codes for now.

Nourhan Hasan

Done

File runtime/vm/service_test.cc
Line 735, Patchset 1: EXPECT_SUBSTRING("\"bytes\":\"0102030405060708\"", handler.msg());
Daco Harkes . resolved

🔥

Nourhan Hasan

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Ben Konyi
  • Daco Harkes
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement satisfiedCommit-Message-Has-TEST
  • 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: sdk
Gerrit-Branch: main
Gerrit-Change-Id: Id15a82bf478bc4822c08d7fdf0a5c8bfd71a1fe0
Gerrit-Change-Number: 505781
Gerrit-PatchSet: 2
Gerrit-Owner: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Reviewer: Ben Konyi <bko...@google.com>
Gerrit-Reviewer: Daco Harkes <dacoh...@google.com>
Gerrit-Reviewer: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Attention: Ben Konyi <bko...@google.com>
Gerrit-Attention: Daco Harkes <dacoh...@google.com>
Gerrit-Comment-Date: Wed, 27 May 2026 07:04:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Ben Konyi <bko...@google.com>
Comment-In-Reply-To: Daco Harkes <dacoh...@google.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Nourhan Hasan (Gerrit)

unread,
May 27, 2026, 3:14:44 AM (8 days ago) May 27
to dart-...@luci-project-accounts.iam.gserviceaccount.com, Ben Konyi, Daco Harkes, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Ben Konyi and Daco Harkes

Nourhan Hasan added 1 comment

File runtime/vm/service.cc
Line 6307, Patchset 1:static void ReadNativeMemory(Thread* thread, JSONStream* js) {
Ben Konyi . unresolved

Can you document the parameters and the formats of the possible response types?

Nourhan Hasan

Is there a specific file to do this? I think the `runtime/vm/service/service.md` file is for Public RPC documentation
Or should I do that as a comment on the RPC right now?

Gerrit-Comment-Date: Wed, 27 May 2026 07:14:40 +0000
unsatisfied_requirement
satisfied_requirement
open
diffy

Daco Harkes (Gerrit)

unread,
May 28, 2026, 2:16:37 PM (6 days ago) May 28
to Nourhan Hasan, dart-...@luci-project-accounts.iam.gserviceaccount.com, Ben Konyi, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Ben Konyi and Nourhan Hasan

Daco Harkes added 1 comment

Commit Message
Line 17, Patchset 7 (Latest):
Daco Harkes . unresolved

Lets make sure we add all relevant bots so that it doesn't turn red on the CI after landing:

`Cq-Include-Trybots: dart/try:vm-asan-linux-release-x64-try,vm-asan-mac-release-arm64-try,vm-asan-win-release-x64-try,vm-dyn-linux-debug-x64-try,vm-dyn-mac-debug-arm64-try,vm-ffi-qemu-linux-release-arm-try,vm-ffi-qemu-linux-release-riscv64-try,vm-linux-debug-arm64-try,vm-linux-debug-ia32-try,vm-linux-debug-simriscv32-try,vm-linux-debug-simriscv64-try,vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-linux-release-simarm-try,vm-mac-debug-arm64-try,vm-mac-debug-x64-try,vm-msan-linux-release-x64-try,vm-reload-linux-debug-x64-try,vm-tsan-linux-release-x64-try,vm-tsan-mac-release-arm64-try,vm-ubsan-linux-release-x64-try,vm-ubsan-mac-release-arm64-try,vm-ubsan-win-release-x64-try,vm-win-debug-arm64-try,vm-win-debug-x64-try,vm-win-debug-x64c-try`

(found via `dart tools/find_builders.dart vm/cc/Service_Code`)

Open in Gerrit

Related details

Attention is currently required from:
  • Ben Konyi
  • Nourhan Hasan
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement satisfiedCommit-Message-Has-TEST
  • 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: sdk
Gerrit-Branch: main
Gerrit-Change-Id: Id15a82bf478bc4822c08d7fdf0a5c8bfd71a1fe0
Gerrit-Change-Number: 505781
Gerrit-PatchSet: 7
Gerrit-Owner: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Reviewer: Ben Konyi <bko...@google.com>
Gerrit-Reviewer: Daco Harkes <dacoh...@google.com>
Gerrit-Reviewer: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Attention: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Attention: Ben Konyi <bko...@google.com>
Gerrit-Comment-Date: Thu, 28 May 2026 18:16:32 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
satisfied_requirement
open
diffy

Nourhan Hasan (Gerrit)

unread,
May 28, 2026, 3:10:52 PM (6 days ago) May 28
to Daco Harkes, dart-...@luci-project-accounts.iam.gserviceaccount.com, Ben Konyi, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Ben Konyi and Daco Harkes

Nourhan Hasan voted and added 1 comment

Votes added by Nourhan Hasan

Auto-Submit+1

1 comment

Commit Message
Line 17, Patchset 7:
Daco Harkes . resolved

Lets make sure we add all relevant bots so that it doesn't turn red on the CI after landing:

`Cq-Include-Trybots: dart/try:vm-asan-linux-release-x64-try,vm-asan-mac-release-arm64-try,vm-asan-win-release-x64-try,vm-dyn-linux-debug-x64-try,vm-dyn-mac-debug-arm64-try,vm-ffi-qemu-linux-release-arm-try,vm-ffi-qemu-linux-release-riscv64-try,vm-linux-debug-arm64-try,vm-linux-debug-ia32-try,vm-linux-debug-simriscv32-try,vm-linux-debug-simriscv64-try,vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-linux-release-simarm-try,vm-mac-debug-arm64-try,vm-mac-debug-x64-try,vm-msan-linux-release-x64-try,vm-reload-linux-debug-x64-try,vm-tsan-linux-release-x64-try,vm-tsan-mac-release-arm64-try,vm-ubsan-linux-release-x64-try,vm-ubsan-mac-release-arm64-try,vm-ubsan-win-release-x64-try,vm-win-debug-arm64-try,vm-win-debug-x64-try,vm-win-debug-x64c-try`

(found via `dart tools/find_builders.dart vm/cc/Service_Code`)

Nourhan Hasan

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Ben Konyi
  • Daco Harkes
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement satisfiedCommit-Message-Has-TEST
  • 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: sdk
Gerrit-Branch: main
Gerrit-Change-Id: Id15a82bf478bc4822c08d7fdf0a5c8bfd71a1fe0
Gerrit-Change-Number: 505781
Gerrit-PatchSet: 8
Gerrit-Owner: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Reviewer: Ben Konyi <bko...@google.com>
Gerrit-Reviewer: Daco Harkes <dacoh...@google.com>
Gerrit-Reviewer: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Attention: Ben Konyi <bko...@google.com>
Gerrit-Attention: Daco Harkes <dacoh...@google.com>
Gerrit-Comment-Date: Thu, 28 May 2026 19:10:48 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Daco Harkes <dacoh...@google.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Ben Konyi (Gerrit)

unread,
May 28, 2026, 3:22:26 PM (6 days ago) May 28
to Nourhan Hasan, Daco Harkes, dart-...@luci-project-accounts.iam.gserviceaccount.com, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Daco Harkes and Nourhan Hasan

Ben Konyi added 2 comments

File runtime/vm/service.cc
Line 6302, Patchset 1: new StringParameter("address", true),
Ben Konyi . unresolved

Since we're using `"address"` and `"size"` in multiple places, I'd define constants for each and use them in place of the raw string literals. That way tooling can help autocomplete references to these parameter names and the compiler will catch any typos.

We'll also want to do the same with the response values.

Nourhan Hasan

Regarding the response, do you mean something similar that is defined at the top of runtime/vm/service.cc?
```
static constexpr const char* kNativeMemoryAddressParam = "address";
static constexpr const char* kNativeMemorySizeParam = "size";
static constexpr const char* kNativeMemoryBytesKey = "bytes";
static constexpr const char* kNativeMemoryErrorKey = "error";
```

Ben Konyi

Yeah, basically! They don't need to be at the top of the file though (you can define them near the functions you've added).

Line 6307, Patchset 1:static void ReadNativeMemory(Thread* thread, JSONStream* js) {
Ben Konyi . unresolved

Can you document the parameters and the formats of the possible response types?

Nourhan Hasan

Is there a specific file to do this? I think the `runtime/vm/service/service.md` file is for Public RPC documentation
Or should I do that as a comment on the RPC right now?

Ben Konyi

I'd just add it as documentation here.

Open in Gerrit

Related details

Attention is currently required from:
  • Daco Harkes
  • Nourhan Hasan
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement satisfiedCommit-Message-Has-TEST
  • 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: sdk
Gerrit-Branch: main
Gerrit-Change-Id: Id15a82bf478bc4822c08d7fdf0a5c8bfd71a1fe0
Gerrit-Change-Number: 505781
Gerrit-PatchSet: 8
Gerrit-Owner: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Reviewer: Ben Konyi <bko...@google.com>
Gerrit-Reviewer: Daco Harkes <dacoh...@google.com>
Gerrit-Reviewer: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Attention: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Attention: Daco Harkes <dacoh...@google.com>
Gerrit-Comment-Date: Thu, 28 May 2026 19:22:23 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Nourhan Hasan <nourhan...@gmail.com>
Comment-In-Reply-To: Ben Konyi <bko...@google.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Daco Harkes (Gerrit)

unread,
May 29, 2026, 4:55:51 AM (6 days ago) May 29
to Nourhan Hasan, dart-...@luci-project-accounts.iam.gserviceaccount.com, Ben Konyi, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Nourhan Hasan

Daco Harkes added 4 comments

File runtime/vm/service.cc
Line 6281, Patchset 8 (Latest): Utils::SNPrint(hex.get() + i * 2, 3, "%02x", buffer.get()[i]);
Daco Harkes . unresolved

I think it's better to use hex encoding than two chars per byte.

File runtime/vm/service_test.cc
Line 712, Patchset 8 (Latest): uint8_t buffer[8] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
Daco Harkes . unresolved

Add bytes above 0x9 e.g. 0xF

Line 735, Patchset 8 (Latest): EXPECT_SUBSTRING("\"bytes\":\"0102030405060708\"", handler.msg());
Daco Harkes . unresolved

I think we should use hex instead for encoding the bytes in JSON. (Unless @bko...@google.com has a different idea.)

(Reasoning: ints is too verbose. And base64 is harder to inspect and work with.)

Line 737, Patchset 8 (Latest):
Daco Harkes . unresolved

Also add a test with a pretty big size. E.g. allocate like a MB and fill it in a for loop. And test that reading an MB through the JSON protocol works as expected.

(Probably an MB is the largest we're interested in. Most likely we'll read <1 KB most of the time. E.g. even if you an array of super large structs we'd probably have some kind of pagination UI to browse through it. And then we could do a JSON call when we flip the pages.)

Open in Gerrit

Related details

Attention is currently required from:
  • Nourhan Hasan
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement satisfiedCommit-Message-Has-TEST
  • 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: sdk
Gerrit-Branch: main
Gerrit-Change-Id: Id15a82bf478bc4822c08d7fdf0a5c8bfd71a1fe0
Gerrit-Change-Number: 505781
Gerrit-PatchSet: 8
Gerrit-Owner: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Reviewer: Ben Konyi <bko...@google.com>
Gerrit-Reviewer: Daco Harkes <dacoh...@google.com>
Gerrit-Reviewer: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Attention: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Comment-Date: Fri, 29 May 2026 08:55:47 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
satisfied_requirement
open
diffy

Nourhan Hasan (Gerrit)

unread,
May 31, 2026, 9:40:08 AM (3 days ago) May 31
to Daco Harkes, dart-...@luci-project-accounts.iam.gserviceaccount.com, Ben Konyi, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Daco Harkes

Nourhan Hasan added 1 comment

File runtime/vm/service.cc
Line 6281, Patchset 8 (Latest): Utils::SNPrint(hex.get() + i * 2, 3, "%02x", buffer.get()[i]);
Daco Harkes . unresolved

I think it's better to use hex encoding than two chars per byte.

Nourhan Hasan

Could you please clarify? I believe the current code is already using hex encoding.

Is there a different encoding approach you had in mind?

Open in Gerrit

Related details

Attention is currently required from:
  • Daco Harkes
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement satisfiedCommit-Message-Has-TEST
  • 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: sdk
Gerrit-Branch: main
Gerrit-Change-Id: Id15a82bf478bc4822c08d7fdf0a5c8bfd71a1fe0
Gerrit-Change-Number: 505781
Gerrit-PatchSet: 8
Gerrit-Owner: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Reviewer: Ben Konyi <bko...@google.com>
Gerrit-Reviewer: Daco Harkes <dacoh...@google.com>
Gerrit-Reviewer: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Attention: Daco Harkes <dacoh...@google.com>
Gerrit-Comment-Date: Sun, 31 May 2026 13:40:02 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Daco Harkes <dacoh...@google.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Nourhan Hasan (Gerrit)

unread,
May 31, 2026, 10:07:56 AM (3 days ago) May 31
to Daco Harkes, dart-...@luci-project-accounts.iam.gserviceaccount.com, Ben Konyi, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Ben Konyi and Daco Harkes

Nourhan Hasan voted and added 4 comments

Votes added by Nourhan Hasan

Auto-Submit+1

4 comments

File runtime/vm/service.cc
Line 6302, Patchset 1: new StringParameter("address", true),
Ben Konyi . resolved

Since we're using `"address"` and `"size"` in multiple places, I'd define constants for each and use them in place of the raw string literals. That way tooling can help autocomplete references to these parameter names and the compiler will catch any typos.

We'll also want to do the same with the response values.

Nourhan Hasan

Regarding the response, do you mean something similar that is defined at the top of runtime/vm/service.cc?
```
static constexpr const char* kNativeMemoryAddressParam = "address";
static constexpr const char* kNativeMemorySizeParam = "size";
static constexpr const char* kNativeMemoryBytesKey = "bytes";
static constexpr const char* kNativeMemoryErrorKey = "error";
```

Ben Konyi

Yeah, basically! They don't need to be at the top of the file though (you can define them near the functions you've added).

Nourhan Hasan

Done

Line 6307, Patchset 1:static void ReadNativeMemory(Thread* thread, JSONStream* js) {
Ben Konyi . resolved

Can you document the parameters and the formats of the possible response types?

Nourhan Hasan

Is there a specific file to do this? I think the `runtime/vm/service/service.md` file is for Public RPC documentation
Or should I do that as a comment on the RPC right now?

Ben Konyi

I'd just add it as documentation here.

Nourhan Hasan

Done

File runtime/vm/service_test.cc
Line 712, Patchset 8: uint8_t buffer[8] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
Daco Harkes . resolved

Add bytes above 0x9 e.g. 0xF

Nourhan Hasan

Done

Line 737, Patchset 8:
Daco Harkes . resolved

Also add a test with a pretty big size. E.g. allocate like a MB and fill it in a for loop. And test that reading an MB through the JSON protocol works as expected.

(Probably an MB is the largest we're interested in. Most likely we'll read <1 KB most of the time. E.g. even if you an array of super large structs we'd probably have some kind of pagination UI to browse through it. And then we could do a JSON call when we flip the pages.)

Nourhan Hasan

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Ben Konyi
  • Daco Harkes
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement satisfiedCommit-Message-Has-TEST
  • 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: sdk
Gerrit-Branch: main
Gerrit-Change-Id: Id15a82bf478bc4822c08d7fdf0a5c8bfd71a1fe0
Gerrit-Change-Number: 505781
Gerrit-PatchSet: 9
Gerrit-Owner: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Reviewer: Ben Konyi <bko...@google.com>
Gerrit-Reviewer: Daco Harkes <dacoh...@google.com>
Gerrit-Reviewer: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Attention: Ben Konyi <bko...@google.com>
Gerrit-Attention: Daco Harkes <dacoh...@google.com>
Gerrit-Comment-Date: Sun, 31 May 2026 14:07:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Nourhan Hasan <nourhan...@gmail.com>
Comment-In-Reply-To: Ben Konyi <bko...@google.com>
Comment-In-Reply-To: Daco Harkes <dacoh...@google.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Daco Harkes (Gerrit)

unread,
Jun 1, 2026, 3:48:35 AM (3 days ago) Jun 1
to Nourhan Hasan, dart-...@luci-project-accounts.iam.gserviceaccount.com, Ben Konyi, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Ben Konyi and Nourhan Hasan

Daco Harkes added 1 comment

File runtime/vm/service.cc
Line 6281, Patchset 8: Utils::SNPrint(hex.get() + i * 2, 3, "%02x", buffer.get()[i]);
Daco Harkes . unresolved

I think it's better to use hex encoding than two chars per byte.

Nourhan Hasan

Could you please clarify? I believe the current code is already using hex encoding.

Is there a different encoding approach you had in mind?

Daco Harkes

Ah yes, I meant why do we use `02`? why the zeros in between? The buffer is `uint8_t` so one hex char should be enough to represent a byte.

Open in Gerrit

Related details

Attention is currently required from:
  • Ben Konyi
  • Nourhan Hasan
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement satisfiedCommit-Message-Has-TEST
  • 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: sdk
Gerrit-Branch: main
Gerrit-Change-Id: Id15a82bf478bc4822c08d7fdf0a5c8bfd71a1fe0
Gerrit-Change-Number: 505781
Gerrit-PatchSet: 9
Gerrit-Owner: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Reviewer: Ben Konyi <bko...@google.com>
Gerrit-Reviewer: Daco Harkes <dacoh...@google.com>
Gerrit-Reviewer: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Attention: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Attention: Ben Konyi <bko...@google.com>
Gerrit-Comment-Date: Mon, 01 Jun 2026 07:48:31 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Nourhan Hasan <nourhan...@gmail.com>
Comment-In-Reply-To: Daco Harkes <dacoh...@google.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Ben Konyi (Gerrit)

unread,
Jun 1, 2026, 3:05:14 PM (2 days ago) Jun 1
to Nourhan Hasan, Daco Harkes, dart-...@luci-project-accounts.iam.gserviceaccount.com, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Nourhan Hasan

Ben Konyi added 1 comment

Patchset-level comments
File-level comment, Patchset 9 (Latest):
Ben Konyi . resolved

This LGTM once Daco is happy with it!

Open in Gerrit

Related details

Attention is currently required from:
  • Nourhan Hasan
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement satisfiedCommit-Message-Has-TEST
  • 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: sdk
Gerrit-Branch: main
Gerrit-Change-Id: Id15a82bf478bc4822c08d7fdf0a5c8bfd71a1fe0
Gerrit-Change-Number: 505781
Gerrit-PatchSet: 9
Gerrit-Owner: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Reviewer: Ben Konyi <bko...@google.com>
Gerrit-Reviewer: Daco Harkes <dacoh...@google.com>
Gerrit-Reviewer: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Attention: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Comment-Date: Mon, 01 Jun 2026 19:05:10 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
satisfied_requirement
open
diffy

Nourhan Hasan (Gerrit)

unread,
Jun 2, 2026, 5:11:26 AM (yesterday) Jun 2
to Daco Harkes, dart-...@luci-project-accounts.iam.gserviceaccount.com, Ben Konyi, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Daco Harkes

Nourhan Hasan added 1 comment

File runtime/vm/service.cc
Line 6281, Patchset 8: Utils::SNPrint(hex.get() + i * 2, 3, "%02x", buffer.get()[i]);
Daco Harkes . unresolved

I think it's better to use hex encoding than two chars per byte.

Nourhan Hasan

Could you please clarify? I believe the current code is already using hex encoding.

Is there a different encoding approach you had in mind?

Daco Harkes

Ah yes, I meant why do we use `02`? why the zeros in between? The buffer is `uint8_t` so one hex char should be enough to represent a byte.

Nourhan Hasan

I don't completely agree with you. Actually, a `uint8_t` holds 8 bits, which needs 2 hex digits to represent , one hex digit only covers 4 bits. Without the zero, the byte `0x0A` would print as `a` instead of `0a`, making the output ambiguous.
I also found that this is the standard way of hex encoding, such as in SHA-256 hashes.

Open in Gerrit

Related details

Attention is currently required from:
  • Daco Harkes
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement satisfiedCommit-Message-Has-TEST
  • 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: sdk
Gerrit-Branch: main
Gerrit-Change-Id: Id15a82bf478bc4822c08d7fdf0a5c8bfd71a1fe0
Gerrit-Change-Number: 505781
Gerrit-PatchSet: 9
Gerrit-Owner: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Reviewer: Ben Konyi <bko...@google.com>
Gerrit-Reviewer: Daco Harkes <dacoh...@google.com>
Gerrit-Reviewer: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Attention: Daco Harkes <dacoh...@google.com>
Gerrit-Comment-Date: Tue, 02 Jun 2026 09:11:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
satisfied_requirement
open
diffy

Daco Harkes (Gerrit)

unread,
Jun 2, 2026, 5:39:21 AM (yesterday) Jun 2
to Nourhan Hasan, dart-...@luci-project-accounts.iam.gserviceaccount.com, Ben Konyi, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Nourhan Hasan

Daco Harkes voted and added 5 comments

Votes added by Daco Harkes

Code-Review+1

5 comments

File runtime/vm/service.cc
Line 6281, Patchset 8: Utils::SNPrint(hex.get() + i * 2, 3, "%02x", buffer.get()[i]);
Daco Harkes . resolved

I think it's better to use hex encoding than two chars per byte.

Nourhan Hasan

Could you please clarify? I believe the current code is already using hex encoding.

Is there a different encoding approach you had in mind?

Daco Harkes

Ah yes, I meant why do we use `02`? why the zeros in between? The buffer is `uint8_t` so one hex char should be enough to represent a byte.

Nourhan Hasan

I don't completely agree with you. Actually, a `uint8_t` holds 8 bits, which needs 2 hex digits to represent , one hex digit only covers 4 bits. Without the zero, the byte `0x0A` would print as `a` instead of `0a`, making the output ambiguous.
I also found that this is the standard way of hex encoding, such as in SHA-256 hashes.

Daco Harkes

Right. Apparently I missed my coffee. 😂

Line 6317, Patchset 9 (Latest):// "bytes": "0102030405060708"
Daco Harkes . unresolved

address starts with 0x but bytes does not. Maybe we should be consistent.

Line 6349, Patchset 9 (Latest): if (!GetIntegerId(size_str, &size) || size <= 0 || size > 1 * MB) {
Daco Harkes . unresolved

Is there a reason we don't support more than 1 MB?

If the system calls support it, and the JSON encoding can handle it, I don't see a reason to limit the number.

File runtime/vm/service_test.cc
Line 735, Patchset 8: EXPECT_SUBSTRING("\"bytes\":\"0102030405060708\"", handler.msg());
Daco Harkes . resolved

I think we should use hex instead for encoding the bytes in JSON. (Unless @bko...@google.com has a different idea.)

(Reasoning: ints is too verbose. And base64 is harder to inspect and work with.)

Daco Harkes

Done

Line 784, Patchset 9 (Latest): EXPECT_SUBSTRING("\"bytes\":", handler.msg());
Daco Harkes . unresolved

Maybe expect at least one hex value in the "bytes" field as well.

Open in Gerrit

Related details

Attention is currently required from:
  • Nourhan Hasan
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedCommit-Message-Has-TEST
  • 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: sdk
Gerrit-Branch: main
Gerrit-Change-Id: Id15a82bf478bc4822c08d7fdf0a5c8bfd71a1fe0
Gerrit-Change-Number: 505781
Gerrit-PatchSet: 9
Gerrit-Owner: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Reviewer: Ben Konyi <bko...@google.com>
Gerrit-Reviewer: Daco Harkes <dacoh...@google.com>
Gerrit-Reviewer: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Attention: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Comment-Date: Tue, 02 Jun 2026 09:39:16 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Nourhan Hasan (Gerrit)

unread,
Jun 2, 2026, 6:28:49 AM (yesterday) Jun 2
to Daco Harkes, dart-...@luci-project-accounts.iam.gserviceaccount.com, Ben Konyi, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Daco Harkes

Nourhan Hasan added 2 comments

File runtime/vm/service.cc
Line 6317, Patchset 9 (Latest):// "bytes": "0102030405060708"
Daco Harkes . unresolved

address starts with 0x but bytes does not. Maybe we should be consistent.

Nourhan Hasan

The actual response is this way:
`response.AddPropertyF(kNativeMemoryAddressParam, "0x%" Px "", address);`
Do you want me to change that as well?

Line 6349, Patchset 9 (Latest): if (!GetIntegerId(size_str, &size) || size <= 0 || size > 1 * MB) {
Daco Harkes . unresolved

Is there a reason we don't support more than 1 MB?

If the system calls support it, and the JSON encoding can handle it, I don't see a reason to limit the number.

Nourhan Hasan

I did this as a precaution, to prevent excessive memory load and usage on the VM, and for security purposes, because the memory might be occupied by large amounts of data by malicious clients.

Do you have a different opinion? Or would you like me to raise or remove the limit?

Open in Gerrit

Related details

Attention is currently required from:
  • Daco Harkes
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedCommit-Message-Has-TEST
  • 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: sdk
Gerrit-Branch: main
Gerrit-Change-Id: Id15a82bf478bc4822c08d7fdf0a5c8bfd71a1fe0
Gerrit-Change-Number: 505781
Gerrit-PatchSet: 9
Gerrit-Owner: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Reviewer: Ben Konyi <bko...@google.com>
Gerrit-Reviewer: Daco Harkes <dacoh...@google.com>
Gerrit-Reviewer: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Attention: Daco Harkes <dacoh...@google.com>
Gerrit-Comment-Date: Tue, 02 Jun 2026 10:28:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Daco Harkes <dacoh...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Daco Harkes (Gerrit)

unread,
Jun 2, 2026, 6:40:10 AM (yesterday) Jun 2
to Nourhan Hasan, dart-...@luci-project-accounts.iam.gserviceaccount.com, Ben Konyi, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Nourhan Hasan

Daco Harkes added 2 comments

File runtime/vm/service.cc
Line 6317, Patchset 9 (Latest):// "bytes": "0102030405060708"
Daco Harkes . resolved

address starts with 0x but bytes does not. Maybe we should be consistent.

Nourhan Hasan

The actual response is this way:
`response.AddPropertyF(kNativeMemoryAddressParam, "0x%" Px "", address);`
Do you want me to change that as well?

Daco Harkes

`response.AddProperty(kNativeMemoryBytesKey, "0x%s", hex.get());` ?

But then reading the string becomes more annoying because we would need to skip the `0x` always when indexing into the string.

So maybe being inconsistent is fine. Both are hex, but address is short and will be read at once. while the bytes will likely be parsed/read in a loop or indexing into the string.

Line 6349, Patchset 9 (Latest): if (!GetIntegerId(size_str, &size) || size <= 0 || size > 1 * MB) {
Daco Harkes . resolved

Is there a reason we don't support more than 1 MB?

If the system calls support it, and the JSON encoding can handle it, I don't see a reason to limit the number.

Nourhan Hasan

I did this as a precaution, to prevent excessive memory load and usage on the VM, and for security purposes, because the memory might be occupied by large amounts of data by malicious clients.

Do you have a different opinion? Or would you like me to raise or remove the limit?

Daco Harkes

Hm, we can keep it. We can always remove it later if we want or need to.

Open in Gerrit

Related details

Attention is currently required from:
  • Nourhan Hasan
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedCommit-Message-Has-TEST
  • 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: sdk
Gerrit-Branch: main
Gerrit-Change-Id: Id15a82bf478bc4822c08d7fdf0a5c8bfd71a1fe0
Gerrit-Change-Number: 505781
Gerrit-PatchSet: 9
Gerrit-Owner: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Reviewer: Ben Konyi <bko...@google.com>
Gerrit-Reviewer: Daco Harkes <dacoh...@google.com>
Gerrit-Reviewer: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Attention: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Comment-Date: Tue, 02 Jun 2026 10:40:06 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Daco Harkes (Gerrit)

unread,
Jun 2, 2026, 8:23:08 AM (yesterday) Jun 2
to Nourhan Hasan, dart-...@luci-project-accounts.iam.gserviceaccount.com, Ben Konyi, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Nourhan Hasan

Daco Harkes added 1 comment

Patchset-level comments
Ben Konyi . unresolved

This LGTM once Daco is happy with it!

Daco Harkes

We need your +1 as well Ben to submit!

Open in Gerrit

Related details

Attention is currently required from:
  • Nourhan Hasan
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedCommit-Message-Has-TEST
  • 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: sdk
Gerrit-Branch: main
Gerrit-Change-Id: Id15a82bf478bc4822c08d7fdf0a5c8bfd71a1fe0
Gerrit-Change-Number: 505781
Gerrit-PatchSet: 9
Gerrit-Owner: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Reviewer: Ben Konyi <bko...@google.com>
Gerrit-Reviewer: Daco Harkes <dacoh...@google.com>
Gerrit-Reviewer: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Attention: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Comment-Date: Tue, 02 Jun 2026 12:23:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Ben Konyi <bko...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Ben Konyi (Gerrit)

unread,
Jun 2, 2026, 10:22:59 AM (yesterday) Jun 2
to Nourhan Hasan, Daco Harkes, dart-...@luci-project-accounts.iam.gserviceaccount.com, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Nourhan Hasan

Ben Konyi voted

Code-Review+1
Commit-Queue+2
Open in Gerrit

Related details

Attention is currently required from:
  • Nourhan Hasan
Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedCommit-Message-Has-TEST
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: Id15a82bf478bc4822c08d7fdf0a5c8bfd71a1fe0
    Gerrit-Change-Number: 505781
    Gerrit-PatchSet: 9
    Gerrit-Owner: Nourhan Hasan <nourhan...@gmail.com>
    Gerrit-Reviewer: Ben Konyi <bko...@google.com>
    Gerrit-Reviewer: Daco Harkes <dacoh...@google.com>
    Gerrit-Reviewer: Nourhan Hasan <nourhan...@gmail.com>
    Gerrit-Attention: Nourhan Hasan <nourhan...@gmail.com>
    Gerrit-Comment-Date: Tue, 02 Jun 2026 14:22:54 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Daco Harkes (Gerrit)

    unread,
    2:09 AM (16 hours ago) 2:09 AM
    to Nourhan Hasan, Ben Konyi, dart-...@luci-project-accounts.iam.gserviceaccount.com, rev...@dartlang.org, vm-...@dartlang.org

    Daco Harkes submitted the change

    Change information

    Commit message:
    [vm/service]: Add _readNativeMemory RPC and OS::SafeReadMemory for safe native memory inspection

    - Declare OS::SafeReadMemory in os.h
    - Implement using pread64(/proc/self/mem) on Linux and Android
    - Add _readNativeMemory VM Service RPC with pre-checks for null
    and address overflow

    TEST=runtime/vm/service_test.cc
    Cq-Include-Trybots: dart/try:vm-asan-linux-release-x64-try,vm-asan-mac-release-arm64-try,vm-asan-win-release-x64-try,vm-dyn-linux-debug-x64-try,vm-dyn-mac-debug-arm64-try,vm-ffi-qemu-linux-release-arm-try,vm-ffi-qemu-linux-release-riscv64-try,vm-linux-debug-arm64-try,vm-linux-debug-ia32-try,vm-linux-debug-simriscv32-try,vm-linux-debug-simriscv64-try,vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-linux-release-simarm-try,vm-mac-debug-arm64-try,vm-mac-debug-x64-try,vm-msan-linux-release-x64-try,vm-reload-linux-debug-x64-try,vm-tsan-linux-release-x64-try,vm-tsan-mac-release-arm64-try,vm-ubsan-linux-release-x64-try,vm-ubsan-mac-release-arm64-try,vm-ubsan-win-release-x64-try,vm-win-debug-arm64-try,vm-win-debug-x64-try,vm-win-debug-x64c-try
    Change-Id: Id15a82bf478bc4822c08d7fdf0a5c8bfd71a1fe0
    Auto-Submit: Nourhan Hasan <nourhan...@gmail.com>
    Reviewed-by: Ben Konyi <bko...@google.com>
    Reviewed-by: Daco Harkes <dacoh...@google.com>
    Files:
    • M runtime/tests/vm/vm.status
    • M runtime/vm/json_stream.h
    • M runtime/vm/os.h
    • M runtime/vm/os_android.cc
    • M runtime/vm/os_linux.cc
    • M runtime/vm/service.cc
    • M runtime/vm/service_test.cc
    Change size: L
    Delta: 7 files changed, 349 insertions(+), 0 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Daco Harkes, +1 by Ben Konyi
    Open in Gerrit
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: merged
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: Id15a82bf478bc4822c08d7fdf0a5c8bfd71a1fe0
    Gerrit-Change-Number: 505781
    Gerrit-PatchSet: 10
    open
    diffy
    satisfied_requirement

    Slava Egorov (Gerrit)

    unread,
    3:23 AM (15 hours ago) 3:23 AM
    to Nourhan Hasan, Daco Harkes, Ben Konyi, dart-...@luci-project-accounts.iam.gserviceaccount.com, rev...@dartlang.org, vm-...@dartlang.org
    Attention needed from Nourhan Hasan

    Slava Egorov added 3 comments

    Patchset-level comments
    File runtime/vm/os_android.cc
    Line 234, Patchset 10 (Latest): pread64(fd, buffer, size_in_bytes, static_cast<off64_t>(address));
    Slava Egorov . unresolved

    Should this handle `EINTR`? If not - why not?

    Line 237, Patchset 10 (Latest): *error = strerror(errno);
    Slava Egorov . unresolved

    If `close` also fails it will clobber `errno`.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Nourhan Hasan
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedCommit-Message-Has-TEST
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: Id15a82bf478bc4822c08d7fdf0a5c8bfd71a1fe0
    Gerrit-Change-Number: 505781
    Gerrit-PatchSet: 10
    Gerrit-Owner: Nourhan Hasan <nourhan...@gmail.com>
    Gerrit-Reviewer: Ben Konyi <bko...@google.com>
    Gerrit-Reviewer: Daco Harkes <dacoh...@google.com>
    Gerrit-Reviewer: Nourhan Hasan <nourhan...@gmail.com>
    Gerrit-CC: Slava Egorov <veg...@google.com>
    Gerrit-Comment-Date: Wed, 03 Jun 2026 07:23:16 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages