Skip to content

VM Service WebSocket disconnects after idle period on Windows 11 with Norton 360, causing errno 232 pipe crash #6026

Closed

Description

@gabriel9004

VM Service WebSocket connection (ws://127.0.0.1:.../ws) disconnects after a period of inactivity (between 4-20 minutes, variable), causing a pipe crash when hot reload is attempted. This affects both Chrome and Android targets.
The DTD WebSocket ping fix from PR #5828 (v3.124) does not cover the VM Service WebSocket. A similar keepalive ping is needed for the VM Service connection.
Stack trace:
ResidentRunner._serviceDisconnected (resident_runner.dart:1405)
WindowsStdoutLogger.writeToStdOut (logger.dart:737)
FileSystemException: writeFrom failed (OS Error: The pipe is being closed, errno = 232)
Log evidence:
21:12:12 | supabase init completed
21:16:34 | Performing hot reload...
21:16:35 | getVM: (-32000) Service connection disposed
4 minutes 22 seconds of inactivity → VM Service disconnected.
Environment:

Flutter 3.41.4, Dart 3.11.1
Dart-Code extension v3.132
Windows 11 25H2 (10.0.26200.8117)
Norton 360 installed (even with all protection disabled, issue persists)
Reproducible on: Chrome web, Android device

Related: #5794, PR #5828

Activity

  1. DanTup commented on Apr 6, 2026

    @DanTup
    Member

    @gabriel9004 can you provide steps to reproduce this?

    We set pingInterval in the base debug adapter when connecting to the VM Service here:

    https://github.com/dart-lang/sdk/blob/da2dc44dda58c24dfd3664117579f7d0aaa8cfaa/pkg/dds/lib/src/dap/adapters/dart.dart#L2835

    I would expect that to handle the issue you describe.

  2. added
    awaiting infoRequires more information from the customer to progress
    on Apr 6, 2026
  3. NicoHype commented on Apr 9, 2026

    @NicoHype

    I can confirm this issue on my end as well.

    Environment:

    • Windows 11
    • Norton 360 installed
    • Dart-Code extension v3.132 (also tested with pre-release versions of both Dart and Flutter extensions)
    • Flutter stable channel and dev channel (3.13.0-5.0.dev) — both affected
    • Target: Windows desktop, but the issue is target-independent (reproduces on Android and Chrome as well)

    The disconnection happens after a period of inactivity regardless of the target platform, but it also occurs during normal development with eventual hot reloads — sometimes as soon as 1–3 minutes into a session, even with a fresh empty project.

    Disabling Norton does not resolve the issue — only fully uninstalling it does.

    This has been quite frustrating to work around and is significantly impacting the development experience. Happy to provide any additional logs or information if helpful.

    Thanks!

  4. DanTup commented on Apr 9, 2026

    @DanTup
    Member

    @NicoHype same question as above - are you able to provide exact steps that reproduce this for you? For example exactly how you're launching the app, and exactly where you're seeing the error messages (a screenshot might help).

    Thanks!

  5. NicoHype commented on Apr 10, 2026

    @NicoHype

    @DanTup Using the F5 shortcut in VS Code, the debug session exits after about 3-5 minutes even with periodic hot reloads every 10–30 seconds:

    Launching lib\main.dart on Windows in debug mode...
    √ Built build\windows\x64\runner\Debug\flutter_application_3.exe
    Connecting to VM Service at ws://127.0.0.1:56206/k9J3yoo-Fw0=/ws
    Connected to the VM Service.
    Reloaded 1 of 753 libraries in 518ms (compile: 34 ms, reload: 200 ms, reassemble: 198 ms).
    Reloaded 1 of 753 libraries in 421ms (compile: 14 ms, reload: 152 ms, reassemble: 176 ms).
    Reloaded 1 of 753 libraries in 353ms (compile: 14 ms, reload: 122 ms, reassemble: 149 ms).
    Reloaded 1 of 753 libraries in 360ms (compile: 13 ms, reload: 120 ms, reassemble: 161 ms).
    Reloaded 1 of 753 libraries in 345ms (compile: 13 ms, reload: 118 ms, reassemble: 149 ms).
    Reloaded 1 of 753 libraries in 418ms (compile: 14 ms, reload: 141 ms, reassemble: 197 ms).
    Reloaded 1 of 753 libraries in 339ms (compile: 12 ms, reload: 120 ms, reassemble: 144 ms).
    Reloaded 1 of 753 libraries in 383ms (compile: 13 ms, reload: 151 ms, reassemble: 154 ms).
    Reloaded 1 of 753 libraries in 341ms (compile: 21 ms, reload: 122 ms, reassemble: 137 ms).
    Lost connection to device.
    Exited.
    

    second error type:

    Restarted application in 2.291ms.
    Reloaded 1 of 748 libraries in 1.329ms (compile: 22 ms, reload: 496 ms, reassemble: 518 ms).
    Reloaded 1 of 748 libraries in 897ms (compile: 13 ms, reload: 365 ms, reassemble: 321 ms).
    Reloaded 1 of 748 libraries in 838ms (compile: 14 ms, reload: 405 ms, reassemble: 308 ms).
    Unhandled exception:
    FileSystemException: writeFrom failed, path = '' (OS Error: The pipe is being closed, errno = 232)
    #0      _RandomAccessFile.writeFromSync (dart:io/file_impl.dart:999:7)
    file_impl.dart:999
    #1      _StdConsumer.addStream.<anonymous closure> (dart:io/stdio.dart:328:17)
    stdio.dart:328
    #2      _rootRunUnary (dart:async/zone_root.dart:48:47)
    zone_root.dart:48
    #3      _CustomZone.runUnary (dart:async/zone.dart:733:19)
    zone.dart:733
    #4      _CustomZone.runUnaryGuarded (dart:async/zone.dart:633:7)
    zone.dart:633
    #5      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:381:11)
    stream_impl.dart:381
    #6      _BufferingStreamSubscription._add (dart:async/stream_impl.dart:312:7)
    stream_impl.dart:312
    #7      _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:798:19)
    stream_controller.dart:798
    #8      _StreamController._add (dart:async/stream_controller.dart:663:7)
    stream_controller.dart:663
    #9      _StreamController.add (dart:async/stream_controller.dart:618:5)
    stream_controller.dart:618
    #10     _StreamSinkImpl.add (dart:io/io_sink.dart:155:17)
    io_sink.dart:155
    #11     _StdSink.add (dart:io/stdio.dart:466:11)
    stdio.dart:466
    #12     DaemonStreams.send (package:flutter_tools/src/daemon.dart:221:19)
    #13     DaemonConnection.sendEvent (package:flutter_tools/src/daemon.dart:303:20)
    #14     Domain.sendEvent (package:flutter_tools/src/commands/daemon.dart:335:23)
    #15     AppDomain._sendAppEvent (package:flutter_tools/src/commands/daemon.dart:994:5)
    #16     MachineOutputLogger._sendProgressEvent (package:flutter_tools/src/commands/daemon.dart:1840:14)
    #17     MachineOutputLogger.startProgress (package:flutter_tools/src/commands/daemon.dart:1810:5)
    #18     HotRunner._hotReloadHelper (package:flutter_tools/src/run_hot.dart:939:36)
    #19     HotRunner.restart (package:flutter_tools/src/run_hot.dart:815:42)
    <asynchronous suspension>
    #20     _AsyncCompleter.complete (dart:async/future_impl.dart:96:3)
    future_impl.dart:96
    <asynchronous suspension>
    #21     Domain.handleCommand.<anonymous closure> (package:flutter_tools/src/commands/daemon.dart:323:7)
    <asynchronous suspension>
    
    Exited (255).
    
  6. DanTup commented on Apr 10, 2026

    @DanTup
    Member

    @NicoHype thanks - the "Lost connection to device" error looks like the flutter tool losing the connection to the device rather than VS Code/the debugger losing connection to the VM/DTD/etc. (which was the original issue).

    @bkonyi what kind of connections does the flutter tool hold open to the device? Am I right in thinking it also holds a VM Service connection open over a WebSocket too? If so, I wonder whether that also needs a pingInterval setting (similar to we did for DAP)?

  7. bkonyi commented on Apr 10, 2026

    @bkonyi

    @bkonyi what kind of connections does the flutter tool hold open to the device? Am I right in thinking it also holds a VM Service connection open over a WebSocket too? If so, I wonder whether that also needs a pingInterval setting (similar to we did for DAP)?

    Yup, it does keep a VM service connection active, so we probably do need a ping interval setting as well.

  8. DanTup commented on Apr 14, 2026

    @DanTup
    Member

    @bkonyi thanks! Would package:vm_service be a better place to do this, so all clients get it?

    I'm not sure we can do it from the server because of flutter/dart-intellij-third-party#208, but I think doing it from the client should be fine, because we know that the Dart client itself handles it (both sides of the connection are Dart, no external users).

  9. added this to the v3.134.0 milestone on Apr 14, 2026
  10. added
    in flutterRelates to running Flutter apps
    in debuggingRelates to the debug adapter or process of running debug sessions
    and removed
    awaiting infoRequires more information from the customer to progress
    on Apr 14, 2026
  11. bkonyi commented on Apr 14, 2026

    @bkonyi

    Yeah, that would make sense. Is there any situation where we wouldn't want a ping interval, or do you think this is something safe to enable all the time?

  12. DanTup commented on Apr 14, 2026

    @DanTup
    Member

    Yeah, that would make sense. Is there any situation where we wouldn't want a ping interval, or do you think this is something safe to enable all the time?

    I don't think so. It could make the connection drop a bit more eagerly (eg. if nothing is using the connection but it dropped, previously we just wouldn't know until we tried to use it, whereas with pingInterval it would close as soon as a ping fails to respond). I'm not sure that's a bad thing though.

    We enable it always for outbound connections from Dart-Code/DAP now. We had to revert it on the server-side from DTD due to the IntelliJ plugin WebSocket library not implementing it (despite it being part of the standard), but I think once that's fixed we should re-enable it there too (to cover any other clients connecting to it on machines with Norton/etc.).

  13. gabriel9004 commented on Apr 17, 2026

    @gabriel9004
    Author

    Sorry for the late reply! I uninstalled Norton completely and confirmed that was the problem. I'm not getting the error anymore.

  14. DanTup commented on Apr 23, 2026

    @DanTup
    Member

    If anyone is able to test on latest Flutter master, the VM Service connection should now have the same pingInterval to keep it alive that we added elsewhere.

    I expect this will resolve the problem, but if it does not, please let me know and we can re-open this and dig further.

  15. NicoHype commented on May 5, 2026

    @NicoHype

    I tested on the latest Flutter master, and the issue still persists.

    Flutter 3.44.0-1.0.pre-419 • channel master • https://github.com/flutter/flutter.git
    Framework • revision d2184011a3 (2 hours ago) • 2026-05-05 04:03:33 -0700
    Engine • hash cdd70252f3fa372dcae3e8b280db11c365bea8d8 (revision d2184011a3) (76 minutes ago) • 2026-05-05 11:03:33.000Z
    Tools • Dart 3.13.0 (build 3.13.0-96.0.dev) • DevTools 2.57.0
    

    I'm using Dart/Flutter VS Code extensions v3.134.0

  16. DanTup commented on May 5, 2026

    @DanTup
    Member

    @NicoHype thanks for testing, and I'm sorry to hear it didn't resolve the problem.

    Is it possible you could try running from the terminal (flutter run) and leaving that to see whether the issue reproduces there? It might help eliminate some parts (like VS Code and the debug adapter) to help narrow down what's being dropped.

    cc @bkonyi in case he has any other ideas about what connections might be open besides the one we just updated.

  17. NicoHype commented on May 5, 2026

    @NicoHype

    @NicoHype thanks for testing, and I'm sorry to hear it didn't resolve the problem.

    Is it possible you could try running from the terminal (flutter run) and leaving that to see whether the issue reproduces there? It might help eliminate some parts (like VS Code and the debug adapter) to help narrow down what's being dropped.

    cc @bkonyi in case he has any other ideas about what connections might be open besides the one we just updated.

    Using flutter run, the behavior is the same, unfortunately.

  18. DanTup commented on May 5, 2026

    @DanTup
    Member

    @NicoHype thanks, that's useful info. Do you want to file an issue at https://github.com/flutter/flutter/ (and link back to this issue for context), since it makes sense to track instead of here (since it's not something fixable here in the VS Code extension).

    I wonder if there's any way to get Norton to log the connections that it's proxying (and terminating!) that might help narrow this down.

    It might also be useful to know how long between the app launching and the disconnection (I think originally we saw issues at 30s or 60s, but the first message in this thread suggests 4-20 minutes which is quite different).

    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

    in debuggingRelates to the debug adapter or process of running debug sessionsin flutterRelates to running Flutter appsis bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions