[S] Change in dart/sdk[main]: [vm/isolate_api] Fix thread-starting race in threading_test.

0 views
Skip to first unread message

Slava Egorov (Gerrit)

unread,
Jun 8, 2026, 8:29:11 AMJun 8
to Alexander Aprelev, dart-...@luci-project-accounts.iam.gserviceaccount.com, rev...@dartlang.org
Attention needed from Alexander Aprelev

Slava Egorov added 2 comments

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Slava Egorov . resolved

I think this fixes a symptom (test failing), not the actual bug (VM deadlocking trying to safepoint?).

File tests/ffi/threading_test.dart
Line 255, Patchset 1 (Latest):bool isHelperInThreadMainWaitingLatchRunning = false;
Slava Egorov . unresolved

This should not be possible according to the newest spec. All shared variables are supposed to be `final`. Sounds like we are missing some checks :)

Open in Gerrit

Related details

Attention is currently required from:
  • Alexander Aprelev
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: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I7e0a52d3c5a7c04c1d853f769544547758c49545
Gerrit-Change-Number: 509541
Gerrit-PatchSet: 1
Gerrit-Owner: Alexander Aprelev <a...@google.com>
Gerrit-Reviewer: Alexander Aprelev <a...@google.com>
Gerrit-Reviewer: Slava Egorov <veg...@google.com>
Gerrit-Attention: Alexander Aprelev <a...@google.com>
Gerrit-Comment-Date: Mon, 08 Jun 2026 12:29:06 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Alexander Aprelev (Gerrit)

unread,
Jun 8, 2026, 11:04:19 AMJun 8
to Alexander Aprelev, Slava Egorov, dart-...@luci-project-accounts.iam.gserviceaccount.com, rev...@dartlang.org
Attention needed from Slava Egorov

Alexander Aprelev added 2 comments

Patchset-level comments
Slava Egorov . resolved

I think this fixes a symptom (test failing), not the actual bug (VM deadlocking trying to safepoint?).

Alexander Aprelev

When spawned thread catches unexpected exception it stops responding, resulting in a timeout. The change in test ensures there are no unexpected exceptions thrown.

File tests/ffi/threading_test.dart
Line 255, Patchset 1 (Latest):bool isHelperInThreadMainWaitingLatchRunning = false;
Slava Egorov . unresolved

This should not be possible according to the newest spec. All shared variables are supposed to be `final`. Sounds like we are missing some checks :)

Alexander Aprelev

Somehow I missed that. There are multiple such variables in this and other tests that do communicate between isolates using `vm:shared` fields.

Open in Gerrit

Related details

Attention is currently required from:
  • Slava Egorov
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: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I7e0a52d3c5a7c04c1d853f769544547758c49545
Gerrit-Change-Number: 509541
Gerrit-PatchSet: 1
Gerrit-Owner: Alexander Aprelev <a...@google.com>
Gerrit-Reviewer: Alexander Aprelev <a...@google.com>
Gerrit-Reviewer: Slava Egorov <veg...@google.com>
Gerrit-Attention: Slava Egorov <veg...@google.com>
Gerrit-Comment-Date: Mon, 08 Jun 2026 15:04:14 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Slava Egorov <veg...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Slava Egorov (Gerrit)

unread,
Jun 9, 2026, 7:08:25 AMJun 9
to Alexander Aprelev, dart-...@luci-project-accounts.iam.gserviceaccount.com, rev...@dartlang.org
Attention needed from Alexander Aprelev

Slava Egorov added 1 comment

Patchset-level comments
Slava Egorov . unresolved

I think this fixes a symptom (test failing), not the actual bug (VM deadlocking trying to safepoint?).

Alexander Aprelev

When spawned thread catches unexpected exception it stops responding, resulting in a timeout. The change in test ensures there are no unexpected exceptions thrown.

Slava Egorov

I am speaking about this output from the test:

```
Attempt:11 waiting for isolate helper to check in
Attempt:12 waiting for isolate helper to check in
Attempt:13 waiting for isolate helper to check in
Attempt:14 waiting for isolate helper to check in
Attempt:15 waiting for isolate helper to check in
```

This is timeout in safepointing - which indicates some sort of deadlock in the machinery we have added. This should not happen - so I think the test right now is revealing some actual bug.

Open in Gerrit

Related details

Attention is currently required from:
  • Alexander Aprelev
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: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I7e0a52d3c5a7c04c1d853f769544547758c49545
Gerrit-Change-Number: 509541
Gerrit-PatchSet: 1
Gerrit-Owner: Alexander Aprelev <a...@google.com>
Gerrit-Reviewer: Alexander Aprelev <a...@google.com>
Gerrit-Reviewer: Slava Egorov <veg...@google.com>
Gerrit-Attention: Alexander Aprelev <a...@google.com>
Gerrit-Comment-Date: Tue, 09 Jun 2026 11:08:20 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Alexander Aprelev <a...@google.com>
Comment-In-Reply-To: Slava Egorov <veg...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Alexander Aprelev (Gerrit)

unread,
Jun 9, 2026, 2:11:58 PMJun 9
to Alexander Aprelev, Slava Egorov, dart-...@luci-project-accounts.iam.gserviceaccount.com, rev...@dartlang.org
Attention needed from Slava Egorov

Alexander Aprelev added 1 comment

Patchset-level comments
Slava Egorov . unresolved

I think this fixes a symptom (test failing), not the actual bug (VM deadlocking trying to safepoint?).

Alexander Aprelev

When spawned thread catches unexpected exception it stops responding, resulting in a timeout. The change in test ensures there are no unexpected exceptions thrown.

Slava Egorov

I am speaking about this output from the test:

```
Attempt:11 waiting for isolate helper to check in
Attempt:12 waiting for isolate helper to check in
Attempt:13 waiting for isolate helper to check in
Attempt:14 waiting for isolate helper to check in
Attempt:15 waiting for isolate helper to check in
```

This is timeout in safepointing - which indicates some sort of deadlock in the machinery we have added. This should not happen - so I think the test right now is revealing some actual bug.

Alexander Aprelev

I believe this is test's `waitLatch` in `threadMainWaitingLatch` that blocks isolate execution. Doesn't look like a bug in the vm.

Open in Gerrit

Related details

Attention is currently required from:
  • Slava Egorov
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: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I7e0a52d3c5a7c04c1d853f769544547758c49545
Gerrit-Change-Number: 509541
Gerrit-PatchSet: 1
Gerrit-Owner: Alexander Aprelev <a...@google.com>
Gerrit-Reviewer: Alexander Aprelev <a...@google.com>
Gerrit-Reviewer: Slava Egorov <veg...@google.com>
Gerrit-Attention: Slava Egorov <veg...@google.com>
Gerrit-Comment-Date: Tue, 09 Jun 2026 18:11:54 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Slava Egorov (Gerrit)

unread,
Jun 10, 2026, 6:45:08 AMJun 10
to Alexander Aprelev, dart-...@luci-project-accounts.iam.gserviceaccount.com, rev...@dartlang.org
Attention needed from Alexander Aprelev

Slava Egorov voted and added 1 comment

Votes added by Slava Egorov

Code-Review+1

1 comment

Patchset-level comments
Slava Egorov . unresolved

I think this fixes a symptom (test failing), not the actual bug (VM deadlocking trying to safepoint?).

Alexander Aprelev

When spawned thread catches unexpected exception it stops responding, resulting in a timeout. The change in test ensures there are no unexpected exceptions thrown.

Slava Egorov

I am speaking about this output from the test:

```
Attempt:11 waiting for isolate helper to check in
Attempt:12 waiting for isolate helper to check in
Attempt:13 waiting for isolate helper to check in
Attempt:14 waiting for isolate helper to check in
Attempt:15 waiting for isolate helper to check in
```

This is timeout in safepointing - which indicates some sort of deadlock in the machinery we have added. This should not happen - so I think the test right now is revealing some actual bug.

Alexander Aprelev

I believe this is test's `waitLatch` in `threadMainWaitingLatch` that blocks isolate execution. Doesn't look like a bug in the vm.

Slava Egorov

Ah, it is not safepointing but VM shutdown, which is blocked by isolate being stuck (Maybe we should update the message to make it clear).

I think it is worth considering if we should introduce a way to gracefully shutdown in such situations (e.g. whether we should make it possible to interrupt such wait).

Open in Gerrit

Related details

Attention is currently required from:
  • Alexander Aprelev
Submit Requirements:
  • 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: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I7e0a52d3c5a7c04c1d853f769544547758c49545
Gerrit-Change-Number: 509541
Gerrit-PatchSet: 1
Gerrit-Owner: Alexander Aprelev <a...@google.com>
Gerrit-Reviewer: Alexander Aprelev <a...@google.com>
Gerrit-Reviewer: Slava Egorov <veg...@google.com>
Gerrit-Attention: Alexander Aprelev <a...@google.com>
Gerrit-Comment-Date: Wed, 10 Jun 2026 10:45:02 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Alexander Aprelev (Gerrit)

unread,
Jun 10, 2026, 11:46:58 AMJun 10
to Alexander Aprelev, Slava Egorov, dart-...@luci-project-accounts.iam.gserviceaccount.com, rev...@dartlang.org

Alexander Aprelev voted and added 3 comments

Votes added by Alexander Aprelev

Commit-Queue+2

3 comments

Patchset-level comments
Alexander Aprelev . resolved

thank you Slava!

Slava Egorov . resolved

I think this fixes a symptom (test failing), not the actual bug (VM deadlocking trying to safepoint?).

Alexander Aprelev

When spawned thread catches unexpected exception it stops responding, resulting in a timeout. The change in test ensures there are no unexpected exceptions thrown.

Slava Egorov

I am speaking about this output from the test:

```
Attempt:11 waiting for isolate helper to check in
Attempt:12 waiting for isolate helper to check in
Attempt:13 waiting for isolate helper to check in
Attempt:14 waiting for isolate helper to check in
Attempt:15 waiting for isolate helper to check in
```

This is timeout in safepointing - which indicates some sort of deadlock in the machinery we have added. This should not happen - so I think the test right now is revealing some actual bug.

Alexander Aprelev

I believe this is test's `waitLatch` in `threadMainWaitingLatch` that blocks isolate execution. Doesn't look like a bug in the vm.

Slava Egorov

Ah, it is not safepointing but VM shutdown, which is blocked by isolate being stuck (Maybe we should update the message to make it clear).

I think it is worth considering if we should introduce a way to gracefully shutdown in such situations (e.g. whether we should make it possible to interrupt such wait).

File tests/ffi/threading_test.dart
Line 255, Patchset 1 (Latest):bool isHelperInThreadMainWaitingLatchRunning = false;
Slava Egorov . resolved

This should not be possible according to the newest spec. All shared variables are supposed to be `final`. Sounds like we are missing some checks :)

Alexander Aprelev

Somehow I missed that. There are multiple such variables in this and other tests that do communicate between isolates using `vm:shared` fields.

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • 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: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I7e0a52d3c5a7c04c1d853f769544547758c49545
Gerrit-Change-Number: 509541
Gerrit-PatchSet: 1
Gerrit-Owner: Alexander Aprelev <a...@google.com>
Gerrit-Reviewer: Alexander Aprelev <a...@google.com>
Gerrit-Reviewer: Slava Egorov <veg...@google.com>
Gerrit-Comment-Date: Wed, 10 Jun 2026 15:46:54 +0000
satisfied_requirement
open
diffy

dart-scoped@luci-project-accounts.iam.gserviceaccount.com (Gerrit)

unread,
Jun 10, 2026, 12:37:07 PMJun 10
to Alexander Aprelev, Slava Egorov, rev...@dartlang.org

dart-...@luci-project-accounts.iam.gserviceaccount.com submitted the change

Change information

Commit message:
[vm/isolate_api] Fix thread-starting race in threading_test.

Fixes https://github.com/dart-lang/sdk/issues/63526
TEST=ci
Change-Id: I7e0a52d3c5a7c04c1d853f769544547758c49545
Reviewed-by: Slava Egorov <veg...@google.com>
Commit-Queue: Alexander Aprelev <a...@google.com>
Files:
  • M tests/ffi/threading_test.dart
Change size: S
Delta: 1 file changed, 10 insertions(+), 1 deletion(-)
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Slava Egorov
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: I7e0a52d3c5a7c04c1d853f769544547758c49545
Gerrit-Change-Number: 509541
Gerrit-PatchSet: 2
Gerrit-Owner: Alexander Aprelev <a...@google.com>
Gerrit-Reviewer: Alexander Aprelev <a...@google.com>
Gerrit-Reviewer: Slava Egorov <veg...@google.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages