Skip to content

Isolates appear as "paused on entry" even if they're not paused #5397

Closed

Description

@simolus3

Describe the bug

When spawning new isolates at the start of an application, these isolates are mistakenly viewed as "paused on entry" in the call stack of the debugging view.

import 'dart:async';
import 'dart:isolate';

void main() async {
  final isolates = <Isolate>[];

  for (var i = 0; i < 10; i++) {
    isolates.add(await Isolate.spawn(
      (_) {
        print('isolate $i started');
        Timer.periodic(const Duration(minutes: 10), (_) {});
      },
      null,
    ));
  }

  await Future.delayed(Duration(seconds: 2));
  print('at resumed state');
  Timer.periodic(const Duration(minutes: 10), (_) {});
}

Setting a breakpoint on the print in line 18 and running this Dart program in VS Code will show most isolates as "paused on entry" (usually all of them, but not always. Maybe this is a race condition?).
Unfortunately, this is not just a cosmetic issue. It also affects the pause button in the button bar of the debugger, which will now interact with the new isolates instead of pausing / resuming the main isolate like it usually would.

Expected behavior
The isolates (except for main paused on a breakpoint) are all running and should be displayed as such.

I've attached a VM service to print the isolate's state shortly after hitting the breakpoint, the isolates are listed as running there. So I think this may be an issue in the extension (as opposed to something in the vm service).

Screenshots

Immediately after program start, all secondary isolates are shown as "Paused on entry". Then afterwards they're showing up as "".

Image

Please complete the following information:

Workspace Environment
Dart Code extension: 3.102.0
Flutter extension: 3.102.0 (not activated)

App: Visual Studio Code
App Host: desktop
Version: mac 1.96.3

Workspace type: Dart (LSP)
Workspace name: vscode_startup_issue

Dart (3.6.1): /opt/homebrew/Cellar/dart/3.6.1/libexec
Flutter (3.27.2): /Users/simon/fvm/versions/stable (No device)

Output from 'dart info'

/opt/homebrew/Cellar/dart/3.6.1/libexec/bin/dart info

If providing this information as part of reporting a bug, please review the information
below to ensure it only contains things you're comfortable posting publicly.

General info

  • Dart 3.6.1 (stable) (Tue Jan 7 09:50:00 2025 -0800) on "macos_arm64"
  • on macos / Version 15.2 (Build 24C101)
  • locale is de-DE

Project info

  • sdk constraint: '^3.6.1'
  • dependencies: sqlite_async, vm_service
  • dev_dependencies: lints, test

Process info

Memory CPU Elapsed time Command line
116 MB 0.0% 22:01 dart devtools
30 MB 0.0% 38:41 dart devtools --machine --allow-embedding --dtd-uri ws:/szh7dcqvfD8=
231 MB 0.0% 38:42 dart language-server --protocol=lsp --client-id=VS-Code --client-version=3.102.0
581 MB 0.0% 30:56 dart language-server --protocol=lsp --client-id=VS-Code --client-version=3.102.0
33 MB 0.0% 38:42 dart tooling-daemon --machine
64 MB 0.0% 30:56 dart tooling-daemon --machine
72 MB 0.0% 38:42 flutter_tools.snapshot daemon

Activity

  1. DanTup commented on Jan 23, 2025

    @DanTup
    Member

    I don't seem to reproduce this, I see them all as paused on the breakpoint:

    Image

    Could you try capturing debugging logs while reproducing this?

    Thanks!

  2. added
    awaiting infoRequires more information from the customer to progress
    on Jan 23, 2025
  3. DanTup commented on Jan 23, 2025

    @DanTup
    Member

    Sorry, I had my breakpoint on the wrong print :) I can repro.. investigating!

  4. simolus3 commented on Jan 23, 2025

    @simolus3
    ContributorAuthor

    Thanks for the quick response 👍 I now see that my description was also ambigious..

  5. DanTup commented on Jan 23, 2025

    @DanTup
    Member

    Hmmm, the DAP traffic looks good here:

    dap.txt

    If I filter to just the lines containing one of the threads, it looks like this:

    [5:17:21 PM] [DAP] [Info] <== {"seq":21,"type":"event","body":{"reason":"started","threadId":3},"event":"thread"}
    [5:17:21 PM] [DAP] [Info] <== {"seq":43,"type":"event","body":{"allThreadsStopped":false,"reason":"entry","threadId":3},"event":"stopped"}
    [5:17:21 PM] [DAP] [Info] <== {"seq":78,"type":"event","body":{"allThreadsContinued":false,"threadId":3},"event":"continued"}
    

    So while it did pause-on-entry, it continues immediately after. I'll try to reproduce with VS Code's MockDebug, this could be a VS Code bug.

  6. added a commit that references this issue on Jan 23, 2025
  7. DanTup commented on Jan 23, 2025

    @DanTup
    Member

    I can reproduce this in MockDebug. I've filed microsoft/vscode#238591

  8. added
    in debuggingRelates to the debug adapter or process of running debug sessions
    and removed
    awaiting infoRequires more information from the customer to progress
    on Jan 23, 2025
  9. added this to the v3.106.0 milestone on Jan 23, 2025
  10. modified the milestones: v3.106.0, v3.108.0 on Feb 10, 2025
  11. removed this from the v3.108.0 milestone on Mar 5, 2025
  12. 11 remaining items

  13. DanTup commented on Sep 15, 2025

    @DanTup
    Member

    VS Code has made a fix for this and it's in the latest Insiders build. Is anyone that could reproduce this able to confirm that it's fixed there? (You'll need to ensure you're on the latest insiders and restart after it installs the update).

    The only repro I had was from MockDebug so it's not the best test that this is solved.

  14. modified the milestones: On Deck, v3.120.0 on Sep 15, 2025
  15. simolus3 commented on Sep 15, 2025

    @simolus3
    ContributorAuthor

    I can't reproduce this issue with the latest insider build and the snippet I've posted in the original issue description. Since it still reproduces for me on VS Code stable, it looks like the fix is working 👍

    Should I close this issue or will that happen with the next release?

  16. DanTup commented on Sep 15, 2025

    @DanTup
    Member

    Great, thanks for confirming! I'll close this now.

  17. easy-Coder commented on Sep 21, 2025

    @easy-Coder

    @DanTup I still faced this issue by the way.

    Image

    I'm using the latest flutter version. also latest VS code and Dart Code extension version as i just updated it.

  18. DanTup commented on Sep 22, 2025

    @DanTup
    Member

    @easy-Coder are you using VS Code stable or Insiders? Currently the fix is only in Insiders (see my comments a few above). Usually VS Code releases around 1 week into each month, so I would expect the fix to be in stable in around a fortnight.

  19. easy-Coder commented on Sep 23, 2025

    @easy-Coder

    @DanTup I'm using the stable version. I will wait for the update. Thank you for your response

  20. NBA2K1 commented on Nov 29, 2025

    @NBA2K1

    I'm experiencing this bug right now.

    VSCodium:

    Version: 1.106.37943
    Commit: 03d61e1799ba4597c64a6c0ae65316d95b2c2937
    Date: 2025-11-27T00:03:42.214Z
    Electron: 37.10.2
    ElectronBuildId: undefined
    Chromium: 138.0.7204.251
    Node.js: 22.21.1
    V8: 13.8.258.32-electron.0
    OS: Linux x64 6.14.0-36-generic
    

     

    Dart Extension:

    Name: Dart
    Id: Dart-Code.dart-code
    Description: Dart language support and debugger for Visual Studio Code.
    Version: 3.122.0
    Publisher: Dart-Code
    VS Marketplace Link: https://open-vsx.org/vscode/item?itemName=Dart-Code.dart-code
    
    $ dart --version
    Dart SDK version: 3.10.1 (stable) (Tue Nov 18 11:02:31 2025 -0800) on "linux_x64"
    
  21. DanTup commented on Nov 29, 2025

    @DanTup
    Member

    @NBA2K1 could you provide a code sample that reproduces this, along with a log file captured following the instructions in this comment above? Thanks!

  22. NBA2K1 commented on Dec 11, 2025

    @NBA2K1

    @NBA2K1 could you provide a code sample that reproduces this, along with a log file captured following the instructions in this comment above? Thanks!

    I can reproduce it with the same code sample as above.

    Image

    &nbps;

    Here's my log file:

    Dart-Code-Log-2025-11-04 02-44-55.txt

  23. DanTup commented on Dec 11, 2025

    @DanTup
    Member

    @NBA2K1 thanks! A similar issue also came up at #5829 and while debugging that I reproduced what I think is the issue you see here - it appears to be the same VS Code bug again.

    I've opened microsoft/vscode#280933 with a repro of that issue using their Mock Debug package - please add 👍 to that issue.

    But it turns out there is also another issue (which is what #5829 really was about) where isolates can hang at startup. That issue is still being investigated.

    Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions