[dart-lang/sdk] d5413c: [vm_service] Fix race condition in resumeIsolate

0 views
Skip to first unread message

Ben Konyi

unread,
Jun 18, 2026, 2:08:50 PM (18 hours ago) Jun 18
to com...@dartlang.org
Branch: refs/heads/main
Home: https://github.com/dart-lang/sdk
Commit: d5413c8d6bdf5c9c991fb052def0a2ff4f6e8602
https://github.com/dart-lang/sdk/commit/d5413c8d6bdf5c9c991fb052def0a2ff4f6e8602
Author: Ben Konyi <bko...@google.com>
Date: 2026-06-18 (Thu, 18 Jun 2026)

Changed paths:
M pkg/vm_service/test/common/service_test_common.dart

Log Message:
-----------
[vm_service] Fix race condition in resumeIsolate

Apply the asynchronous and synchronous-nullification pattern to `resumeIsolate` to resolve a race condition.

Previously, because the debug stream listener didn't check if it was completing the same `Completer` multiple times, multiple incoming `kResume` events (or concurrent paths) could double-complete it and throw a `StateError`.

By introducing a synchronous helper `complete` which nullifies the `completer` variable synchronously BEFORE yielding to any asynchronous calls (like `subscription.cancel()` or `streamCancel()`), we guarantee that only one execution path can successfully complete the completer, preventing concurrent double-completing races. Additionally, we verify the isolate ID of the event matches the isolate being resumed.

Change-Id: If170ed425b6123de9255cdd1b794f176bac73dc3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/508380
Reviewed-by: Nicholas Shahan <nsh...@google.com>
Commit-Queue: Ben Konyi <bko...@google.com>
Auto-Submit: Ben Konyi <bko...@google.com>



To unsubscribe from these emails, change your notification settings at https://github.com/dart-lang/sdk/settings/notifications

copybara-service[bot]

unread,
Jun 18, 2026, 3:33:51 PM (16 hours ago) Jun 18
to com...@dartlang.org
Branch: refs/heads/lkgr
Commit: 10815d3db00f307ca546c5da23bb2e2392fb31a6
https://github.com/dart-lang/sdk/commit/10815d3db00f307ca546c5da23bb2e2392fb31a6
Author: dart-a...@skia-public.iam.gserviceaccount.com <dart-a...@skia-public.iam.gserviceaccount.com>
Date: 2026-06-18 (Thu, 18 Jun 2026)

Changed paths:
M DEPS

Log Message:
-----------
Roll Fuchsia SDK from 32.20260612.4.1 to 32.20260618.4.1

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/fuchsia-sdk-dart-sdk
Please CC fuchsia-3...@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Fuchsia SDK: https://bugs.fuchsia.dev/p/fuchsia/issues/list
To file a bug in Dart SDK: https://github.com/dart-lang/sdk/issues

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Cq-Include-Trybots: luci.dart.try:vm-fuchsia-release-x64-try;luci.dart.try:vm-fuchsia-release-arm64-try
Change-Id: I03e94649cedf3c4f6fcbbebe96c199ec79fda9c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/514940
Reviewed-by: Alexander Markov <alexm...@google.com>
Reviewed-by: Alexander Aprelev <a...@google.com>
Commit-Queue: dart-a...@skia-public.iam.gserviceaccount.com <dart-a...@skia-public.iam.gserviceaccount.com>
Commit-Queue: Alexander Markov <alexm...@google.com>


Compare: https://github.com/dart-lang/sdk/compare/d8d70b447aad...10815d3db00f
Reply all
Reply to author
Forward
0 new messages